2004-10-20 00:24:10 +02:00
< ? php
2005-02-11 16:34:56 +01:00
/* Copyright ( C ) 2003 , 2005 Rodolphe Quiedeville < rodolphe @ quiedeville . org >
2005-03-06 01:15:34 +01:00
* Copyright ( C ) 2003 Jean - Louis Bergamo < jlb @ j1b . org >
2012-04-08 13:05:58 +02:00
* Copyright ( C ) 2004 - 2012 Laurent Destailleur < eldy @ users . sourceforge . net >
2005-03-06 01:15:34 +01:00
* Copyright ( C ) 2004 Sebastien Di Cintio < sdicintio @ ressource - toi . org >
* Copyright ( C ) 2004 Benoit Mortier < benoit . mortier @ opensides . be >
2013-05-30 17:58:48 +02:00
* Copyright ( C ) 2013 Juanjo Menent < jmenent @ 2 byte . es >
2003-09-15 16:03:49 +02:00
*
* This program is free software ; you can redistribute it and / or modify
* it under the terms of the GNU General Public License as published by
2013-01-16 15:36:08 +01:00
* the Free Software Foundation ; either version 3 of the License , or
2003-09-15 16:03:49 +02:00
* ( at your option ) any later version .
*
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
*
* You should have received a copy of the GNU General Public License
2011-08-01 01:24:38 +02:00
* along with this program . If not , see < http :// www . gnu . org / licenses />.
2003-09-15 16:03:49 +02:00
*/
2005-03-06 01:15:34 +01:00
/**
2011-08-31 12:27:17 +02:00
* \defgroup member Module foundation
* \brief Module to manage members of a foundation
2011-10-24 14:11:49 +02:00
* \file htdocs / core / modules / modAdherent . class . php
2009-10-10 18:00:35 +02:00
* \ingroup member
* \brief File descriptor or module Member
2009-04-10 02:29:23 +02:00
*/
2012-08-23 02:04:35 +02:00
include_once DOL_DOCUMENT_ROOT . '/core/modules/DolibarrModules.class.php' ;
2003-09-15 16:03:49 +02:00
2005-09-04 20:58:06 +02:00
/**
2012-04-08 13:05:58 +02:00
* Classe de description et activation du module Adherent
2009-07-27 02:08:49 +02:00
*/
2003-11-15 18:42:11 +01:00
class modAdherent extends DolibarrModules
2003-09-15 16:03:49 +02:00
{
2005-09-04 20:58:06 +02:00
/**
2011-08-31 12:41:06 +02:00
* Constructor . Define names , constants , directories , boxes , permissions
*
2012-01-04 21:23:50 +01:00
* @ param DoliDB $db Database handler
2005-09-04 20:58:06 +02:00
*/
2012-07-30 17:17:33 +02:00
function __construct ( $db )
2005-09-04 20:58:06 +02:00
{
2013-05-31 13:30:24 +02:00
global $conf ;
2013-06-14 02:35:30 +02:00
2012-01-04 21:23:50 +01:00
$this -> db = $db ;
$this -> numero = 310 ;
2009-02-11 21:44:00 +01:00
2005-09-04 20:58:06 +02:00
$this -> family = " hr " ;
2008-10-01 21:10:17 +02:00
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
2009-10-21 15:09:42 +02:00
$this -> name = preg_replace ( '/^mod/i' , '' , get_class ( $this ));
2010-05-01 12:32:15 +02:00
$this -> description = " Gestion des adhérents d'une association " ;
2005-09-04 20:58:06 +02:00
$this -> version = 'dolibarr' ; // 'experimental' or 'dolibarr' or version
2008-10-06 09:39:52 +02:00
$this -> const_name = 'MAIN_MODULE_' . strtoupper ( $this -> name );
2007-12-28 15:53:52 +01:00
$this -> special = 0 ;
2005-09-04 20:58:06 +02:00
$this -> picto = 'user' ;
2009-02-11 21:44:00 +01:00
2009-04-28 15:52:08 +02:00
// Data directories to create when module is enabled
2011-06-21 14:39:09 +02:00
$this -> dirs = array ( " /adherent/temp " );
2009-02-11 21:44:00 +01:00
2005-09-04 20:58:06 +02:00
// Config pages
//-------------
2010-05-01 12:32:15 +02:00
$this -> config_page_url = array ( " adherent.php@adherents " );
2009-02-11 21:44:00 +01:00
2007-12-26 11:09:30 +01:00
// Dependances
2005-09-04 20:58:06 +02:00
//------------
$this -> depends = array ();
2012-01-11 18:43:38 +01:00
$this -> requiredby = array ( 'modMailmanSpip' );
2010-05-02 19:05:07 +02:00
$this -> langfiles = array ( " members " , " companies " );
2009-02-11 21:44:00 +01:00
2005-09-04 20:58:06 +02:00
// Constantes
//-----------
$this -> const = array ();
2011-08-09 19:59:45 +02:00
$this -> const [ 2 ] = array ( " MAIN_SEARCHFORM_ADHERENT " , " yesno " , " 1 " , " Show form for quick member search " );
$this -> const [ 3 ] = array ( " ADHERENT_MAIL_RESIL " , " texte " , " Votre adhésion vient d'être résiliée. \r \n Nous espérons vous revoir très bientôt " , " Mail de résiliation " );
$this -> const [ 4 ] = array ( " ADHERENT_MAIL_VALID " , " texte " , " Votre adhésion vient d'être validée. \r \n Voici le rappel de vos coordonnées (toute information erronée entrainera la non validation de votre inscription) : \r \n \r \n %INFOS% \r \n \r \n " , " Mail de validation " );
2010-09-22 11:39:08 +02:00
$this -> const [ 5 ] = array ( " ADHERENT_MAIL_VALID_SUBJECT " , " chaine " , " Votre adhésion a été validée " , " Sujet du mail de validation " );
$this -> const [ 6 ] = array ( " ADHERENT_MAIL_RESIL_SUBJECT " , " chaine " , " Résiliation de votre adhésion " , " Sujet du mail de résiliation " );
2005-09-04 20:58:06 +02:00
$this -> const [ 21 ] = array ( " ADHERENT_MAIL_FROM " , " chaine " , " " , " From des mails " );
2013-02-23 16:21:49 +01:00
$this -> const [ 22 ] = array ( " ADHERENT_MAIL_COTIS " , " texte " , " Bonjour %FIRSTNAME%, \r \n Cet email confirme que votre cotisation a été reçue \r \n et enregistrée " , " Mail de validation de cotisation " );
2010-09-22 11:39:08 +02:00
$this -> const [ 23 ] = array ( " ADHERENT_MAIL_COTIS_SUBJECT " , " chaine " , " Reçu de votre cotisation " , " Sujet du mail de validation de cotisation " );
$this -> const [ 25 ] = array ( " ADHERENT_CARD_HEADER_TEXT " , " chaine " , " %ANNEE% " , " Texte imprimé sur le haut de la carte adhérent " );
$this -> const [ 26 ] = array ( " ADHERENT_CARD_FOOTER_TEXT " , " chaine " , " Association AZERTY " , " Texte imprimé sur le bas de la carte adhérent " );
2012-04-28 16:37:58 +02:00
$this -> const [ 27 ] = array ( " ADHERENT_CARD_TEXT " , " texte " , " %FULLNAME% \r \n ID: %ID% \r \n %EMAIL% \r \n %ADDRESS% \r \n %ZIP% %TOWN% \r \n %COUNTRY% " , " Text to print on member cards " );
2005-09-04 20:58:06 +02:00
$this -> const [ 28 ] = array ( " ADHERENT_MAILMAN_ADMINPW " , " chaine " , " " , " Mot de passe Admin des liste mailman " );
2010-09-22 11:39:08 +02:00
$this -> const [ 31 ] = array ( " ADHERENT_BANK_USE_AUTO " , " yesno " , " " , " Insertion automatique des cotisations dans le compte banquaire " );
2005-09-04 20:58:06 +02:00
$this -> const [ 32 ] = array ( " ADHERENT_BANK_ACCOUNT " , " chaine " , " " , " ID du Compte banquaire utilise " );
2010-09-22 11:39:08 +02:00
$this -> const [ 33 ] = array ( " ADHERENT_BANK_CATEGORIE " , " chaine " , " " , " ID de la catégorie banquaire des cotisations " );
2012-04-28 16:37:58 +02:00
$this -> const [ 34 ] = array ( " ADHERENT_ETIQUETTE_TYPE " , " chaine " , " L7163 " , " Type of address sheets " );
$this -> const [ 35 ] = array ( " ADHERENT_ETIQUETTE_TEXT " , 'texte' , " %FULLNAME% \n %ADDRESS% \n %ZIP% %TOWN% \n %COUNTRY% " , " Text to print on member address sheets " );
2012-07-27 16:03:20 +02:00
2012-04-28 16:37:58 +02:00
// Boxes
2005-09-04 20:58:06 +02:00
//-------
$this -> boxes = array ();
2011-02-20 16:51:14 +01:00
$r = 0 ;
$this -> boxes [ $r ][ 1 ] = " box_members.php " ;
2009-02-11 21:44:00 +01:00
2005-09-04 20:58:06 +02:00
// Permissions
//------------
$this -> rights = array ();
$this -> rights_class = 'adherent' ;
$r = 0 ;
// $this->rights[$r][0] Id permission (unique tous modules confondus)
2007-12-26 11:09:30 +01:00
// $this->rights[$r][1] Libelle par defaut si traduction de cle "PermissionXXX" non trouvee (XXX = Id permission)
// $this->rights[$r][2] Non utilise
2005-09-04 20:58:06 +02:00
// $this->rights[$r][3] 1=Permis par defaut, 0=Non permis par defaut
// $this->rights[$r][4] Niveau 1 pour nommer permission dans code
// $this->rights[$r][5] Niveau 2 pour nommer permission dans code
2009-02-11 21:44:00 +01:00
2005-09-04 20:58:06 +02:00
$r ++ ;
$this -> rights [ $r ][ 0 ] = 71 ;
2009-07-18 17:01:45 +02:00
$this -> rights [ $r ][ 1 ] = 'Read members\' card' ;
2005-09-04 20:58:06 +02:00
$this -> rights [ $r ][ 2 ] = 'r' ;
$this -> rights [ $r ][ 3 ] = 1 ;
$this -> rights [ $r ][ 4 ] = 'lire' ;
2009-02-11 21:44:00 +01:00
2005-09-04 20:58:06 +02:00
$r ++ ;
$this -> rights [ $r ][ 0 ] = 72 ;
2009-07-18 17:01:45 +02:00
$this -> rights [ $r ][ 1 ] = 'Create/modify members (need also user module permissions if member linked to a user)' ;
2005-09-04 20:58:06 +02:00
$this -> rights [ $r ][ 2 ] = 'w' ;
$this -> rights [ $r ][ 3 ] = 0 ;
$this -> rights [ $r ][ 4 ] = 'creer' ;
2009-02-11 21:44:00 +01:00
2005-09-04 20:58:06 +02:00
$r ++ ;
$this -> rights [ $r ][ 0 ] = 74 ;
2009-07-18 17:01:45 +02:00
$this -> rights [ $r ][ 1 ] = 'Remove members' ;
2005-09-04 20:58:06 +02:00
$this -> rights [ $r ][ 2 ] = 'd' ;
$this -> rights [ $r ][ 3 ] = 0 ;
$this -> rights [ $r ][ 4 ] = 'supprimer' ;
2009-02-11 21:44:00 +01:00
2005-09-04 20:58:06 +02:00
$r ++ ;
$this -> rights [ $r ][ 0 ] = 76 ;
2009-07-18 17:01:45 +02:00
$this -> rights [ $r ][ 1 ] = 'Export members' ;
2005-09-04 20:58:06 +02:00
$this -> rights [ $r ][ 2 ] = 'r' ;
$this -> rights [ $r ][ 3 ] = 0 ;
$this -> rights [ $r ][ 4 ] = 'export' ;
2009-02-11 21:44:00 +01:00
2005-09-04 20:58:06 +02:00
$r ++ ;
$this -> rights [ $r ][ 0 ] = 75 ;
2009-07-18 17:01:45 +02:00
$this -> rights [ $r ][ 1 ] = 'Setup types and attributes of members' ;
2005-09-04 20:58:06 +02:00
$this -> rights [ $r ][ 2 ] = 'w' ;
$this -> rights [ $r ][ 3 ] = 0 ;
$this -> rights [ $r ][ 4 ] = 'configurer' ;
$r ++ ;
$this -> rights [ $r ][ 0 ] = 78 ;
2009-07-18 17:01:45 +02:00
$this -> rights [ $r ][ 1 ] = 'Read subscriptions' ;
2005-09-04 20:58:06 +02:00
$this -> rights [ $r ][ 2 ] = 'r' ;
$this -> rights [ $r ][ 3 ] = 1 ;
$this -> rights [ $r ][ 4 ] = 'cotisation' ;
$this -> rights [ $r ][ 5 ] = 'lire' ;
2009-02-11 21:44:00 +01:00
2005-09-04 20:58:06 +02:00
$r ++ ;
$this -> rights [ $r ][ 0 ] = 79 ;
2009-07-18 17:01:45 +02:00
$this -> rights [ $r ][ 1 ] = 'Create/modify/remove subscriptions' ;
2005-09-04 20:58:06 +02:00
$this -> rights [ $r ][ 2 ] = 'w' ;
$this -> rights [ $r ][ 3 ] = 0 ;
$this -> rights [ $r ][ 4 ] = 'cotisation' ;
$this -> rights [ $r ][ 5 ] = 'creer' ;
// Exports
//--------
$r = 0 ;
// $this->export_code[$r] Code unique identifiant l'export (tous modules confondus)
2007-12-26 11:09:30 +01:00
// $this->export_label[$r] Libelle par defaut si traduction de cle "ExportXXX" non trouvee (XXX = Code)
2008-01-10 23:21:18 +01:00
// $this->export_permission[$r] Liste des codes permissions requis pour faire l'export
2005-09-04 20:58:06 +02:00
// $this->export_fields_sql[$r] Liste des champs exportables en codif sql
// $this->export_fields_name[$r] Liste des champs exportables en codif traduction
2007-12-26 11:09:30 +01:00
// $this->export_sql[$r] Requete sql qui offre les donnees a l'export
2005-09-04 20:58:06 +02:00
$r ++ ;
2008-01-17 22:37:46 +01:00
$this -> export_code [ $r ] = $this -> rights_class . '_' . $r ;
2009-03-05 12:11:32 +01:00
$this -> export_label [ $r ] = 'MembersAndSubscriptions' ;
2008-01-10 23:21:18 +01:00
$this -> export_permission [ $r ] = array ( array ( " adherent " , " export " ));
2013-08-31 12:43:41 +02:00
$this -> export_fields_array [ $r ] = array ( 'a.rowid' => 'Id' , 'a.civilite' => " UserTitle " , 'a.lastname' => " Lastname " , 'a.firstname' => " Firstname " , 'a.login' => " Login " , 'a.morphy' => 'Nature' , 'a.societe' => 'Company' , 'a.address' => " Address " , 'a.zip' => " Zip " , 'a.town' => " Town " , 'd.nom' => " State " , 'p.code' => " CountryCode " , 'p.libelle' => " Country " , 'a.phone' => " PhonePro " , 'a.phone_perso' => " PhonePerso " , 'a.phone_mobile' => " PhoneMobile " , 'a.email' => " Email " , 'a.birth' => " Birthday " , 'a.statut' => " Status " , 'a.photo' => " Photo " , 'a.note' => " Note " , 'a.datec' => 'DateCreation' , 'a.datevalid' => 'DateValidation' , 'a.tms' => 'DateLastModification' , 'a.datefin' => 'DateEndSubscription' , 'ta.rowid' => 'MemberTypeId' , 'ta.libelle' => 'MemberTypeLabel' , 'c.rowid' => 'SubscriptionId' , 'c.dateadh' => 'DateSubscription' , 'c.cotisation' => 'Amount' );
$this -> export_TypeFields_array [ $r ] = array ( 'a.civilite' => " Text " , 'a.lastname' => " Text " , 'a.firstname' => " Text " , 'a.login' => " Text " , 'a.morphy' => 'Text' , 'a.societe' => 'Text' , 'a.address' => " Text " , 'a.zip' => " Text " , 'a.town' => " Text " , 'd.nom' => " Text " , 'p.code' => 'Text' , 'p.libelle' => " Text " , 'a.phone' => " Text " , 'a.phone_perso' => " Text " , 'a.phone_mobile' => " Text " , 'a.email' => " Text " , 'a.birth' => " Date " , 'a.statut' => " Status " , 'a.note' => " Text " , 'a.datec' => 'Date' , 'a.datevalid' => 'Date' , 'a.tms' => 'Date' , 'a.datefin' => 'Date' , 'ta.rowid' => 'List:fk_adherent_type:libelle' , 'ta.libelle' => 'Text' , 'c.dateadh' => 'Date' , 'c.cotisation' => 'Number' );
$this -> export_entities_array [ $r ] = array ( 'a.rowid' => 'member' , 'a.civilite' => " member " , 'a.lastname' => " member " , 'a.firstname' => " member " , 'a.login' => " member " , 'a.morphy' => 'member' , 'a.societe' => 'member' , 'a.address' => " member " , 'a.zip' => " member " , 'a.town' => " member " , 'd.nom' => " member " , 'p.code' => " member " , 'p.libelle' => " member " , 'a.phone' => " member " , 'a.phone_perso' => " member " , 'a.phone_mobile' => " member " , 'a.email' => " member " , 'a.birth' => " member " , 'a.statut' => " member " , 'a.photo' => " member " , 'a.note' => " member " , 'a.datec' => 'member' , 'a.datevalid' => 'member' , 'a.tms' => 'member' , 'a.datefin' => 'member' , 'ta.rowid' => 'member_type' , 'ta.libelle' => 'member_type' , 'c.rowid' => 'subscription' , 'c.dateadh' => 'subscription' , 'c.cotisation' => 'subscription' );
2011-06-22 13:05:06 +02:00
// Add extra fields
2013-06-14 02:35:30 +02:00
$sql = " SELECT name, label FROM " . MAIN_DB_PREFIX . " extrafields WHERE elementtype = 'adherent' AND entity = " . $conf -> entity ;
2007-05-21 03:49:37 +02:00
$resql = $this -> db -> query ( $sql );
while ( $obj = $this -> db -> fetch_object ( $resql ))
{
2011-06-22 13:05:06 +02:00
$fieldname = 'extra.' . $obj -> name ;
2007-05-21 03:49:37 +02:00
$fieldlabel = ucfirst ( $obj -> label );
$this -> export_fields_array [ $r ][ $fieldname ] = $fieldlabel ;
$this -> export_entities_array [ $r ][ $fieldname ] = 'member' ;
}
2011-06-22 13:05:06 +02:00
// End add axtra fields
2008-01-10 23:21:18 +01:00
$this -> export_sql_start [ $r ] = 'SELECT DISTINCT ' ;
2010-05-07 20:53:29 +02:00
$this -> export_sql_end [ $r ] = ' FROM (' . MAIN_DB_PREFIX . 'adherent_type as ta, ' . MAIN_DB_PREFIX . 'adherent as a)' ;
2011-06-22 13:05:06 +02:00
$this -> export_sql_end [ $r ] .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'adherent_extrafields as extra ON a.rowid = extra.fk_object' ;
2008-01-10 23:21:18 +01:00
$this -> export_sql_end [ $r ] .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'cotisation as c ON c.fk_adherent = a.rowid' ;
2013-08-31 12:43:41 +02:00
$this -> export_sql_end [ $r ] .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'c_departements as d ON a.state_id = d.rowid' ;
$this -> export_sql_end [ $r ] .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'c_pays as p ON a.country = p.rowid' ;
2008-01-10 23:21:18 +01:00
$this -> export_sql_end [ $r ] .= ' WHERE a.fk_adherent_type = ta.rowid' ;
2012-07-28 11:28:37 +02:00
$this -> export_dependencies_array [ $r ] = array ( 'subscription' => 'c.rowid' ); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them
2010-09-30 21:25:58 +02:00
// Imports
//--------
$r = 0 ;
2010-10-02 01:37:36 +02:00
$now = dol_now ();
2012-08-22 23:11:24 +02:00
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php' ;
2010-10-02 01:37:36 +02:00
2010-09-30 21:25:58 +02:00
$r ++ ;
$this -> import_code [ $r ] = $this -> rights_class . '_' . $r ;
$this -> import_label [ $r ] = " Members " ; // Translation key
$this -> import_icon [ $r ] = $this -> picto ;
2012-01-22 02:28:49 +01:00
$this -> import_entities_array [ $r ] = array (); // We define here only fields that use another icon that the one defined into import_icon
2012-03-03 16:33:38 +01:00
$this -> import_tables_array [ $r ] = array ( 'a' => MAIN_DB_PREFIX . 'adherent' , 'extra' => MAIN_DB_PREFIX . 'adherent_extrafields' );
2010-09-30 21:25:58 +02:00
$this -> import_tables_creator_array [ $r ] = array ( 'a' => 'fk_user_author' ); // Fields to store import user id
2013-08-31 12:43:41 +02:00
$this -> import_fields_array [ $r ] = array ( 'a.civilite' => " UserTitle " , 'a.lastname' => " Lastname* " , 'a.firstname' => " Firstname " , 'a.login' => " Login* " , " a.pass " => " Password " , " a.fk_adherent_type " => " MemberType* " , 'a.morphy' => 'Nature*' , 'a.societe' => 'Company' , 'a.address' => " Address " , 'a.zip' => " Zip " , 'a.town' => " Town " , 'a.state_id' => 'StateId' , 'a.country' => " CountryId " , 'a.phone' => " PhonePro " , 'a.phone_perso' => " PhonePerso " , 'a.phone_mobile' => " PhoneMobile " , 'a.email' => " Email " , 'a.birth' => " Birthday " , 'a.statut' => " Status* " , 'a.photo' => " Photo " , 'a.note' => " Note " , 'a.datec' => 'DateCreation' , 'a.datefin' => 'DateEndSubscription' );
2012-03-03 16:33:38 +01:00
// Add extra fields
2013-06-14 02:41:08 +02:00
$sql = " SELECT name, label, fieldrequired FROM " . MAIN_DB_PREFIX . " extrafields WHERE elementtype = 'adherent' AND entity = " . $conf -> entity ;
2012-03-03 16:33:38 +01:00
$resql = $this -> db -> query ( $sql );
if ( $resql ) // This can fail when class is used on old database (during migration for example)
{
while ( $obj = $this -> db -> fetch_object ( $resql ))
{
$fieldname = 'extra.' . $obj -> name ;
$fieldlabel = ucfirst ( $obj -> label );
2012-10-25 13:11:55 +02:00
$this -> import_fields_array [ $r ][ $fieldname ] = $fieldlabel . ( $obj -> fieldrequired ? '*' : '' );
2012-03-03 16:33:38 +01:00
}
}
// End add extra fields
$this -> import_fieldshidden_array [ $r ] = array ( 'extra.fk_object' => 'lastrowid-' . MAIN_DB_PREFIX . 'adherent' ); // aliastable.field => ('user->id' or 'lastrowid-'.tableparent)
$this -> import_regex_array [ $r ] = array ( 'a.civilite' => 'code@' . MAIN_DB_PREFIX . 'c_civilite' , 'a.fk_adherent_type' => 'rowid@' . MAIN_DB_PREFIX . 'adherent_type' , 'a.morphy' => '(phy|mor)' , 'a.statut' => '^[0|1]' , 'a.datec' => '^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$' , 'a.datefin' => '^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$' );
2013-04-25 23:49:24 +02:00
$this -> import_examplevalues_array [ $r ] = array ( 'a.civilite' => " MR " , 'a.lastname' => 'Smith' , 'a.firstname' => 'John' , 'a.login' => 'jsmith' , 'a.pass' => 'passofjsmith' , 'a.fk_adherent_type' => '1' , 'a.morphy' => '"mor" or "phy"' , 'a.societe' => 'JS company' , 'a.address' => '21 jump street' , 'a.zip' => '55000' , 'a.town' => 'New York' , 'a.country' => '1' , 'a.email' => 'jsmith@example.com' , 'a.birth' => '1972-10-10' , 'a.statut' => " 0 or 1 " , 'a.note' => " This is a comment on member " , 'a.datec' => dol_print_date ( $now , '%Y-%m-%d' ), 'a.datefin' => dol_print_date ( dol_time_plus_duree ( $now , 1 , 'y' ), '%Y-%m-%d' ));
2005-09-04 20:58:06 +02:00
}
2004-11-23 21:04:19 +01:00
2009-02-11 21:44:00 +01:00
2005-09-04 20:58:06 +02:00
/**
2011-08-31 12:41:06 +02:00
* Function called when module is enabled .
* The init function add constants , boxes , permissions and menus ( defined in constructor ) into Dolibarr database .
* It also creates data directories
*
* @ param string $options Options when enabling module ( '' , 'noboxes' )
* @ return int 1 if OK , 0 if KO
2005-09-04 20:58:06 +02:00
*/
2011-08-31 12:41:06 +02:00
function init ( $options = '' )
2005-09-04 20:58:06 +02:00
{
2009-02-11 21:44:00 +01:00
2005-09-04 20:58:06 +02:00
$sql = array ();
2009-02-11 21:44:00 +01:00
2011-08-31 12:41:06 +02:00
return $this -> _init ( $sql , $options );
2005-09-04 20:58:06 +02:00
}
2009-02-11 21:44:00 +01:00
2005-09-04 20:58:06 +02:00
/**
2011-08-31 12:41:06 +02:00
* Function called when module is disabled .
* Remove from database constants , boxes and permissions from Dolibarr database .
* Data directories are not deleted
*
* @ param string $options Options when enabling module ( '' , 'noboxes' )
* @ return int 1 if OK , 0 if KO
2005-09-04 20:58:06 +02:00
*/
2011-08-31 12:41:06 +02:00
function remove ( $options = '' )
2005-09-04 20:58:06 +02:00
{
2008-01-14 23:34:27 +01:00
$sql = array ();
2009-02-11 21:44:00 +01:00
2011-08-31 12:41:06 +02:00
return $this -> _remove ( $sql , $options );
2005-09-04 20:58:06 +02:00
}
2003-09-15 16:03:49 +02:00
}
?>