/[dolibarr]/dolibarr/htdocs/includes/modules/modAdherent.class.php
ViewVC logotype

Diff of /dolibarr/htdocs/includes/modules/modAdherent.class.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.23 by eldy, Thu Aug 11 19:18:11 2005 UTC revision 1.24 by eldy, Sun Sep 4 18:58:26 2005 UTC
# Line 21  Line 21 
21   *   *
22   * $Id$   * $Id$
23   * $Source$   * $Source$
  *  
24   */   */
25    
26  /**  /**
# Line 37  Line 36 
36    
37  include_once "DolibarrModules.class.php";  include_once "DolibarrModules.class.php";
38    
39  /** \class modAdherent  /**
40            \class      modAdherent
41          \brief      Classe de description et activation du module Adherent          \brief      Classe de description et activation du module Adherent
42  */  */
43    
44  class modAdherent extends DolibarrModules  class modAdherent extends DolibarrModules
45  {  {
46    
47     /**      /**
48      *   \brief      Constructeur. Definit les noms, constantes et boites       *   \brief      Constructeur. Definit les noms, constantes et boites
49      *   \param      DB      handler d'accès base       *   \param      DB      handler d'accès base
50      */       */
51    function modAdherent($DB)      function modAdherent($DB)
52    {      {
53      $this->db = $DB ;          $this->db = $DB ;
54      $this->numero = 310 ;          $this->numero = 310 ;
55        
56      $this->family = "hr";          $this->family = "hr";
57      $this->name = "Adhérents";          $this->name = "Adhérents";
58      $this->description = "Gestion des adhérents d'une association";          $this->description = "Gestion des adhérents d'une association";
59      $this->version = 'dolibarr';                        // 'experimental' or 'dolibarr' or version          $this->version = 'dolibarr';                        // 'experimental' or 'dolibarr' or version
60      $this->const_name = "MAIN_MODULE_ADHERENT";          $this->const_name = "MAIN_MODULE_ADHERENT";
61      $this->const_config = MAIN_MODULE_ADHERENT;          $this->const_config = MAIN_MODULE_ADHERENT;
62      $this->special = 1;          $this->special = 1;
63      $this->picto='user';          $this->picto='user';
64            
65      // Dir          // Dir
66      $this->dirs = array();          //----
67            $this->dirs = array();
68      // Config pages      
69      $this->config_page_url = "adherent.php";          // Config pages
70            //-------------
71      // Dépendances          $this->config_page_url = "adherent.php";
72      $this->depends = array();      
73      $this->requiredby = array();          // Dépendances
74            //------------
75      // Constantes          $this->depends = array();
76      $this->const = array();          $this->requiredby = array();
77      $this->const[0]= array("ADHERENT_MAIL_RESIL","texte","Votre adhesion sur %SERVEUR% vient d'etre resilie.\r\nNous esperons vous revoir tres bientot","Mail de résiliation");      
78      $this->const[1]=array("ADHERENT_MAIL_VALID","texte","Votre adhesion vient d'etre validee. \r\nVoici le rappel de vos coordonnees (toute information erronee entrainera la non validation de votre inscription) :\r\n\r\n%INFO%\r\n\r\nVous pouvez a tout moment, grace a votre login et mot de passe, modifier vos coordonnees a l'adresse suivante : \r\n%SERVEUR%public/adherents/","Mail de validation");          // Constantes
79      $this->const[2]= array("ADHERENT_MAIL_EDIT","texte","Voici le rappel des coordonnees que vous avez modifiees (toute information erronee entrainera la non validation de votre inscription) :\r\n\r\n%INFO%\r\n\r\nVous pouvez a tout moment, grace a votre login et mot de passe, modifier vos coordonnees a l'adresse suivante :\r\n%SERVEUR%public/adherents/","Mail d'edition");          //-----------
80      $this->const[3] = array("ADHERENT_MAIL_RESIL","texte","Votre adhesion sur %SERVEUR% vient d'etre resilie.\r\nNous esperons vous revoir tres bientot","Mail de résiliation");          $this->const = array();
81      $this->const[4] = array("ADHERENT_MAIL_NEW","texte","Merci de votre inscription. Votre adhesion devrait etre rapidement validee.^M\nVoici le rappel des coordonnees que vous avez rentrees (toute information erronee entrainera la non validation de votre inscription) :\r\n\r\n%INFO%\r\n\r\nVous pouvez a tout moment, grace a votre login et mot de passe, modifier vos coordonnees a l'adresse suivante :\r\n%SERVEUR%public/adherents/","Mail de nouvel inscription");          $this->const[0]= array("ADHERENT_MAIL_RESIL","texte","Votre adhesion sur %SERVEUR% vient d'etre resilie.\r\nNous esperons vous revoir tres bientot","Mail de résiliation");
82      $this->const[5] = array("ADHERENT_MAIL_VALID_SUBJECT","chaine"," Votre adh<E9>sion a ete valid<E9>e sur %SERVEUR%","sujet du mail de validation");          $this->const[1]=array("ADHERENT_MAIL_VALID","texte","Votre adhesion vient d'etre validee. \r\nVoici le rappel de vos coordonnees (toute information erronee entrainera la non validation de votre inscription) :\r\n\r\n%INFO%\r\n\r\nVous pouvez a tout moment, grace a votre login et mot de passe, modifier vos coordonnees a l'adresse suivante : \r\n%SERVEUR%public/adherents/","Mail de validation");
83      $this->const[6] = array("ADHERENT_MAIL_RESIL_SUBJECT","chaine","Resiliation de votre adhesion sur %SERVEUR% ","sujet du mail de resiliation");          $this->const[2]= array("ADHERENT_MAIL_EDIT","texte","Voici le rappel des coordonnees que vous avez modifiees (toute information erronee entrainera la non validation de votre inscription) :\r\n\r\n%INFO%\r\n\r\nVous pouvez a tout moment, grace a votre login et mot de passe, modifier vos coordonnees a l'adresse suivante :\r\n%SERVEUR%public/adherents/","Mail d'edition");
84      $this->const[7] = array("ADHERENT_MAIL_NEW_SUBJECT","chaine","Bienvenue sur %SERVEUR%","Sujet du mail de nouvelle adhesion");          $this->const[3] = array("ADHERENT_MAIL_RESIL","texte","Votre adhesion sur %SERVEUR% vient d'etre resilie.\r\nNous esperons vous revoir tres bientot","Mail de résiliation");
85      $this->const[8] = array("ADHERENT_MAIL_EDIT_SUBJECT","chaine","Votre fiche a ete editee sur %SERVEUR%","Sujet du mail d'edition");          $this->const[4] = array("ADHERENT_MAIL_NEW","texte","Merci de votre inscription. Votre adhesion devrait etre rapidement validee.^M\nVoici le rappel des coordonnees que vous avez rentrees (toute information erronee entrainera la non validation de votre inscription) :\r\n\r\n%INFO%\r\n\r\nVous pouvez a tout moment, grace a votre login et mot de passe, modifier vos coordonnees a l'adresse suivante :\r\n%SERVEUR%public/adherents/","Mail de nouvel inscription");
86      $this->const[9] = array("ADHERENT_GLASNOST_SERVEUR","chaine","","serveur glasnost");          $this->const[5] = array("ADHERENT_MAIL_VALID_SUBJECT","chaine"," Votre adh<E9>sion a ete valid<E9>e sur %SERVEUR%","sujet du mail de validation");
87      $this->const[10] = array("ADHERENT_MAILMAN_UNSUB_URL","chaine","http://%SERVER%/cgi-bin/mailman/admin/%LISTE%/members?adminpw=%ADMINPW%&user=%EMAIL%","Url de desinscription aux listes mailman");          $this->const[6] = array("ADHERENT_MAIL_RESIL_SUBJECT","chaine","Resiliation de votre adhesion sur %SERVEUR% ","sujet du mail de resiliation");
88      $this->const[11] = array("ADHERENT_MAILMAN_URL","chaine","http://%SERVER%/cgi-bin/mailman/admin/%LISTE%/members?adminpw=%ADMINPW%&send_welcome_msg_to_this_batch=1&subscribees=%EMAIL%","url pour les inscriptions mailman");          $this->const[7] = array("ADHERENT_MAIL_NEW_SUBJECT","chaine","Bienvenue sur %SERVEUR%","Sujet du mail de nouvelle adhesion");
89      $this->const[12] = array("ADHERENT_MAILMAN_LISTS","chaine","","Listes auxquelles les nouveaux adhérents sont inscris");          $this->const[8] = array("ADHERENT_MAIL_EDIT_SUBJECT","chaine","Votre fiche a ete editee sur %SERVEUR%","Sujet du mail d'edition");
90      $this->const[13] = array("ADHERENT_GLASNOST_USER","chaine","","Administrateur glasnost");          $this->const[9] = array("ADHERENT_GLASNOST_SERVEUR","chaine","","serveur glasnost");
91      $this->const[14] = array("ADHERENT_GLASNOST_PASS","chaine","","password de l'administrateur");          $this->const[10] = array("ADHERENT_MAILMAN_UNSUB_URL","chaine","http://%SERVER%/cgi-bin/mailman/admin/%LISTE%/members?adminpw=%ADMINPW%&user=%EMAIL%","Url de desinscription aux listes mailman");
92      $this->const[15] = array("ADHERENT_USE_GLASNOST_AUTO","yesno","","inscription automatique a glasnost ?");          $this->const[11] = array("ADHERENT_MAILMAN_URL","chaine","http://%SERVER%/cgi-bin/mailman/admin/%LISTE%/members?adminpw=%ADMINPW%&send_welcome_msg_to_this_batch=1&subscribees=%EMAIL%","url pour les inscriptions mailman");
93      $this->const[16] = array("ADHERENT_USE_SPIP_AUTO","yesno","","Utilisation de SPIP automatiquement");          $this->const[12] = array("ADHERENT_MAILMAN_LISTS","chaine","","Listes auxquelles les nouveaux adhérents sont inscris");
94      $this->const[17] = array("ADHERENT_SPIP_USER","chaine","","Utilisateur de connection a la base spip");          $this->const[13] = array("ADHERENT_GLASNOST_USER","chaine","","Administrateur glasnost");
95      $this->const[18] = array("ADHERENT_SPIP_PASS","chaine","","Mot de passe de connection a la base spip");          $this->const[14] = array("ADHERENT_GLASNOST_PASS","chaine","","password de l'administrateur");
96      $this->const[19] = array("ADHERENT_SPIP_SERVEUR","chaine","","serveur spip");          $this->const[15] = array("ADHERENT_USE_GLASNOST_AUTO","yesno","","inscription automatique a glasnost ?");
97      $this->const[20] = array("ADHERENT_SPIP_DB","chaine","","db spip");          $this->const[16] = array("ADHERENT_USE_SPIP_AUTO","yesno","","Utilisation de SPIP automatiquement");
98      $this->const[21] = array("ADHERENT_MAIL_FROM","chaine","","From des mails");          $this->const[17] = array("ADHERENT_SPIP_USER","chaine","","Utilisateur de connection a la base spip");
99      $this->const[22] = array("ADHERENT_MAIL_COTIS","texte","Bonjour %PRENOM%,^M\n^M\nCet email confirme que votre cotisation a ete recue\r\net enregistree","Mail de validation de cotisation");          $this->const[18] = array("ADHERENT_SPIP_PASS","chaine","","Mot de passe de connection a la base spip");
100      $this->const[23] = array("ADHERENT_MAIL_COTIS_SUBJECT","chaine"," Recu de votre cotisation","sujet du mail de validation de cotisation");          $this->const[19] = array("ADHERENT_SPIP_SERVEUR","chaine","","serveur spip");
101      $this->const[24] = array("ADHERENT_TEXT_NEW_ADH","texte","","Texte d'entete du formaulaire d'adhesion en ligne");          $this->const[20] = array("ADHERENT_SPIP_DB","chaine","","db spip");
102      $this->const[25] = array("ADHERENT_CARD_HEADER_TEXT","chaine","%ANNEE%","Texte imprime sur le haut de la carte adherent");          $this->const[21] = array("ADHERENT_MAIL_FROM","chaine","","From des mails");
103      $this->const[26] = array("ADHERENT_CARD_FOOTER_TEXT","chaine","Association %SERVER%","Texte imprime sur le bas de la carte adherent");          $this->const[22] = array("ADHERENT_MAIL_COTIS","texte","Bonjour %PRENOM%,^M\n^M\nCet email confirme que votre cotisation a ete recue\r\net enregistree","Mail de validation de cotisation");
104      $this->const[27] = array("ADHERENT_CARD_TEXT","texte","%PRENOM% %NOM%\r\nMembre n° %ID%\r\n%EMAIL%\r\n%ADRESSE%\r\n%CP% %VILLE%\r\n%PAYS%","Texte imprime sur la carte adherent");          $this->const[23] = array("ADHERENT_MAIL_COTIS_SUBJECT","chaine"," Recu de votre cotisation","sujet du mail de validation de cotisation");
105      $this->const[28] = array("ADHERENT_MAILMAN_ADMINPW","chaine","","Mot de passe Admin des liste mailman");          $this->const[24] = array("ADHERENT_TEXT_NEW_ADH","texte","","Texte d'entete du formaulaire d'adhesion en ligne");
106      $this->const[29] = array("ADHERENT_MAILMAN_SERVER","chaine","","Serveur hebergeant les interfaces d'Admin des listes mailman");          $this->const[25] = array("ADHERENT_CARD_HEADER_TEXT","chaine","%ANNEE%","Texte imprime sur le haut de la carte adherent");
107      $this->const[30] = array("ADHERENT_MAILMAN_LISTS_COTISANT","chaine","","Liste(s) auxquelles les nouveaux cotisants sont inscris automatiquement");          $this->const[26] = array("ADHERENT_CARD_FOOTER_TEXT","chaine","Association %SERVER%","Texte imprime sur le bas de la carte adherent");
108      $this->const[31] = array("ADHERENT_BANK_USE_AUTO","yesno","","Insertion automatique des cotisation dans le compte banquaire");          $this->const[27] = array("ADHERENT_CARD_TEXT","texte","%PRENOM% %NOM%\r\nMembre n° %ID%\r\n%EMAIL%\r\n%ADRESSE%\r\n%CP% %VILLE%\r\n%PAYS%","Texte imprime sur la carte adherent");
109      $this->const[32] = array("ADHERENT_BANK_ACCOUNT","chaine","","ID du Compte banquaire utilise");          $this->const[28] = array("ADHERENT_MAILMAN_ADMINPW","chaine","","Mot de passe Admin des liste mailman");
110      $this->const[33] = array("ADHERENT_BANK_CATEGORIE","chaine","","ID de la categorie banquaire des cotisations");          $this->const[29] = array("ADHERENT_MAILMAN_SERVER","chaine","","Serveur hebergeant les interfaces d'Admin des listes mailman");
111      $this->const[34] = array("ADHERENT_ETIQUETTE_TYPE","chaine","L7163","Type d etiquette (pour impression de planche d etiquette)");          $this->const[30] = array("ADHERENT_MAILMAN_LISTS_COTISANT","chaine","","Liste(s) auxquelles les nouveaux cotisants sont inscris automatiquement");
112            $this->const[31] = array("ADHERENT_BANK_USE_AUTO","yesno","","Insertion automatique des cotisation dans le compte banquaire");
113      // Boites          $this->const[32] = array("ADHERENT_BANK_ACCOUNT","chaine","","ID du Compte banquaire utilise");
114      $this->boxes = array();          $this->const[33] = array("ADHERENT_BANK_CATEGORIE","chaine","","ID de la categorie banquaire des cotisations");
115            $this->const[34] = array("ADHERENT_ETIQUETTE_TYPE","chaine","L7163","Type d etiquette (pour impression de planche d etiquette)");
116      // Permissions      
117      $this->rights = array();          // Boites
118      $this->rights_class = 'adherent';          //-------
119            $this->boxes = array();
120      $this->rights[1][0] = 71; // id de la permission      
121      $this->rights[1][1] = 'Lire les fiche adherents'; // libelle de la permission          // Permissions
122      $this->rights[1][2] = 'r'; // type de la permission (déprécié à ce jour)          //------------
123      $this->rights[1][3] = 1; // La permission est-elle une permission par défaut          $this->rights = array();
124      $this->rights[1][4] = 'lire';          $this->rights_class = 'adherent';
125            $r=0;
126      $this->rights[2][0] = 72; // id de la permission  
127      $this->rights[2][1] = 'Créer/modifier les adherents'; // libelle de la permission          // $this->rights[$r][0]     Id permission (unique tous modules confondus)
128      $this->rights[2][2] = 'w'; // type de la permission (déprécié à ce jour)          // $this->rights[$r][1]     Libellé par défaut si traduction de clé "PermissionXXX" non trouvée (XXX = Id permission)
129      $this->rights[2][3] = 0; // La permission est-elle une permission par défaut          // $this->rights[$r][2]     Non utilisé
130      $this->rights[2][4] = 'creer';          // $this->rights[$r][3]     1=Permis par defaut, 0=Non permis par defaut
131            // $this->rights[$r][4]     Niveau 1 pour nommer permission dans code
132      $this->rights[4][0] = 74; // id de la permission          // $this->rights[$r][5]     Niveau 2 pour nommer permission dans code
133      $this->rights[4][1] = 'Supprimer les adherents'; // libelle de la permission          
134      $this->rights[4][2] = 'd'; // type de la permission (déprécié à ce jour)          $r++;
135      $this->rights[4][3] = 0; // La permission est-elle une permission par défaut          $this->rights[$r][0] = 71;
136      $this->rights[4][4] = 'supprimer';          $this->rights[$r][1] = 'Lire les fiche adherents';
137            $this->rights[$r][2] = 'r';
138      $this->rights[5][0] = 75; // id de la permission          $this->rights[$r][3] = 1;
139      $this->rights[5][1] = 'Configurer les types et caractéristiques des adherents'; // libelle de la permission          $this->rights[$r][4] = 'lire';
     $this->rights[5][2] = 'w'; // type de la permission (déprécié à ce jour)  
     $this->rights[5][3] = 0; // La permission est-elle une permission par défaut  
     $this->rights[5][4] = 'configurer';  
   
     $this->rights[6][0] = 78; // id de la permission  
     $this->rights[6][1] = 'Lire les cotisations'; // libelle de la permission  
     $this->rights[6][2] = 'r'; // type de la permission (déprécié à ce jour)  
     $this->rights[6][3] = 1; // La permission est-elle une permission par défaut  
     $this->rights[6][4] = 'cotisation';  
     $this->rights[6][5] = 'lire';  
   
     $this->rights[7][0] = 79; // id de la permission  
     $this->rights[7][1] = 'Créer/modifier les cotisations'; // libelle de la permission  
     $this->rights[7][2] = 'w'; // type de la permission (déprécié à ce jour)  
     $this->rights[7][3] = 0; // La permission est-elle une permission par défaut  
     $this->rights[7][4] = 'cotisation';  
     $this->rights[7][5] = 'creer';  
   
   }  
   
   
    /**  
     *   \brief      Fonction appelée lors de l'activation du module. Insère en base les constantes, boites, permissions du module.  
     *               Définit également les répertoires de données à créer pour ce module.  
     */  
   function init()  
   {  
     global $conf;  
       
     // Permissions  
     $this->remove();  
   
     // Dir  
     $this->dirs[0] = $conf->adherent->dir_output;  
     $this->dirs[1] = $conf->adherent->dir_output."/photos";  
     
     $sql = array();  
140            
141      return $this->_init($sql);          $r++;
142    }          $this->rights[$r][0] = 72;
143            $this->rights[$r][1] = 'Créer/modifier les adherents';
144            $this->rights[$r][2] = 'w';
145            $this->rights[$r][3] = 0;
146            $this->rights[$r][4] = 'creer';
147        
148            $r++;
149            $this->rights[$r][0] = 74;
150            $this->rights[$r][1] = 'Supprimer les adherents';
151            $this->rights[$r][2] = 'd';
152            $this->rights[$r][3] = 0;
153            $this->rights[$r][4] = 'supprimer';
154        
155            $r++;
156            $this->rights[$r][0] = 76;
157            $this->rights[$r][1] = 'Exporter les adhérents';
158            $this->rights[$r][2] = 'r';
159            $this->rights[$r][3] = 0;
160            $this->rights[$r][4] = 'export';
161        
162            $r++;
163            $this->rights[$r][0] = 75;
164            $this->rights[$r][1] = 'Configurer les types et caractéristiques des adherents';
165            $this->rights[$r][2] = 'w';
166            $this->rights[$r][3] = 0;
167            $this->rights[$r][4] = 'configurer';
168    
169            $r++;
170            $this->rights[$r][0] = 78;
171            $this->rights[$r][1] = 'Lire les cotisations';
172            $this->rights[$r][2] = 'r';
173            $this->rights[$r][3] = 1;
174            $this->rights[$r][4] = 'cotisation';
175            $this->rights[$r][5] = 'lire';
176        
177            $r++;
178            $this->rights[$r][0] = 79;
179            $this->rights[$r][1] = 'Créer/modifier les cotisations';
180            $this->rights[$r][2] = 'w';
181            $this->rights[$r][3] = 0;
182            $this->rights[$r][4] = 'cotisation';
183            $this->rights[$r][5] = 'creer';
184    
185            // Exports
186            //--------
187            $r=0;
188    
189            // $this->export_code[$r]          Code unique identifiant l'export (tous modules confondus)
190            // $this->export_label[$r]         Libellé par défaut si traduction de clé "ExportXXX" non trouvée (XXX = Code)
191            // $this->export_fields_sql[$r]    Liste des champs exportables en codif sql
192            // $this->export_fields_name[$r]   Liste des champs exportables en codif traduction
193            // $this->export_sql[$r]           Requete sql qui offre les données à l'export
194            // $this->export_permission[$r]    Liste des codes permissions requis pour faire l'export
195    
196            $r++;
197            $this->export_code[$r]=$this->numero.'_'.$r;
198            $this->export_label[$r]='Adhérents et attributs';
199            $this->export_fields_code[$r]=array(0=>'a.nom',1=>'a.prenom',2=>'a.login',3=>'a.cp',4=>'a.ville',5=>'a.pays',6=>'a.email',7=>'a.login',8=>'a.naiss');
200            $this->export_fields_label[$r]=array(0=>"Lastname",1=>"Firstname",2=>"Address",3=>"Zip",4=>"Town",5=>"Country",6=>"Email",7=>"Login",8=>"Birthday");
201            $this->export_sql[$r]="select ".join(',',$this->export_fields_code[$r]).' from '.MAIN_DB_PREFIX.'adherent';
202            $this->export_permission[$r]=array(array("adherent","export"));
203        }
204    
205    /**      
206     *    \brief      Fonction appelée lors de la désactivation d'un module.      /**
207     *                Supprime de la base les constantes, boites et permissions du module.       *   \brief      Fonction appelée lors de l'activation du module. Insère en base les constantes, boites, permissions du module.
208     */       *               Définit également les répertoires de données à créer pour ce module.
209    function remove()       */
210    {      function init()
211        {
212            global $conf;
213            
214            // Permissions
215            $this->remove();
216            
217            // Dir
218            $this->dirs[0] = $conf->adherent->dir_output;
219            $this->dirs[1] = $conf->adherent->dir_output."/photos";
220            $this->dirs[2] = $conf->adherent->dir_export;
221            
222            $sql = array();
223            
224            return $this->_init($sql);
225        }
226        
227        /**
228         *    \brief      Fonction appelée lors de la désactivation d'un module.
229         *                Supprime de la base les constantes, boites et permissions du module.
230         */
231        function remove()
232        {
233      $sql = array();      $sql = array();
234        
235      return $this->_remove($sql);      return $this->_remove($sql);
236    }      }
237    
238  }  }
239  ?>  ?>

Legend:
Removed from v.1.23  
changed lines
  Added in v.1.24

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26