Subversion Repositories Applications.papyrus

Rev

Rev 1625 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1625 Rev 1637
Line 17... Line 17...
17
// |                                                                                                      |
17
// |                                                                                                      |
18
// | You should have received a copy of the GNU Lesser General Public                                     |
18
// | You should have received a copy of the GNU Lesser General Public                                     |
19
// | License along with this library; if not, write to the Free Software                                  |
19
// | License along with this library; if not, write to the Free Software                                  |
20
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
20
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
21
// +------------------------------------------------------------------------------------------------------+
21
// +------------------------------------------------------------------------------------------------------+
22
// CVS : $Id: inscription.class.php,v 1.27 2007-10-01 12:14:50 alexandre_tb Exp $
22
// CVS : $Id: inscription.class.php,v 1.28 2007-10-10 12:23:15 alexandre_tb Exp $
23
/**
23
/**
24
* Inscription
24
* Inscription
25
*
25
*
26
* Un module d'inscription, en general ce code est specifique a
26
* Un module d'inscription, en general ce code est specifique a
27
* un site web
27
* un site web
Line 29... Line 29...
29
*@package inscription
29
*@package inscription
30
//Auteur original :
30
//Auteur original :
31
*@author        Alexandre GRANIER <alexandre@tela-botanica.org>
31
*@author        Alexandre GRANIER <alexandre@tela-botanica.org>
32
//Autres auteurs :
32
//Autres auteurs :
33
*@copyright     Tela-Botanica 2000-2004
33
*@copyright     Tela-Botanica 2000-2004
34
*@version       $Revision: 1.27 $ $Date: 2007-10-01 12:14:50 $
34
*@version       $Revision: 1.28 $ $Date: 2007-10-10 12:23:15 $
35
// +------------------------------------------------------------------------------------------------------+
35
// +------------------------------------------------------------------------------------------------------+
36
*/
36
*/
Line 37... Line 37...
37
 
37
 
38
// +------------------------------------------------------------------------------------------------------+
38
// +------------------------------------------------------------------------------------------------------+
Line 155... Line 155...
155
										'<!-- BEGIN error --><span class="erreur">{error}</span><!-- END error -->'."\n".
155
										'<!-- BEGIN error --><span class="erreur">{error}</span><!-- END error -->'."\n".
156
										'</td>'."\n".
156
										'</td>'."\n".
157
										'</tr>'."\n");  	  	
157
										'</tr>'."\n");  	  	
158
  	  	$squelette->setElementTemplate( '<tr><td colspan="2" style="font-size:12px;text-align:left;">{label}{element}</td></tr>'."\n", 'lettre');
158
  	  	$squelette->setElementTemplate( '<tr><td colspan="2" style="font-size:12px;text-align:left;">{label}{element}</td></tr>'."\n", 'lettre');
159
        $squelette->setElementTemplate( '<tr><td colspan="2" style="font-size:12px;text-align:left;">{label}{element}</td></tr>'."\n", 'visible');
159
        $squelette->setElementTemplate( '<tr><td colspan="2" style="font-size:12px;text-align:left;">{label}{element}</td></tr>'."\n", 'visible');
-
 
160
        
160
        $squelette->setElementTemplate( '<tr><td colspan="2" class="bouton" id="bouton_annuler">{label}{element}</td></tr>'."\n", 'groupe_bouton');        
161
        $squelette->setElementTemplate( '<tr><td colspan="2" class="bouton" id="bouton_annuler">{label}{element}</td></tr>'."\n", 'groupe_bouton');        
161
        $squelette->setGroupTemplate('<tr><td colspan="2">{content}</td></tr>'."\n", 'groupe_bouton');
162
        $squelette->setGroupTemplate('<tr><td colspan="2">{content}</td></tr>'."\n", 'groupe_bouton');
162
        $squelette->setRequiredNoteTemplate("\n".'<tr>'."\n".'<td colspan="2" class="symbole_obligatoire">* {requiredNote}</td></tr>'."\n");
163
        $squelette->setRequiredNoteTemplate("\n".'<tr>'."\n".'<td colspan="2" class="symbole_obligatoire">* {requiredNote}</td></tr>'."\n");
163
		//Traduction de champs requis
164
		//Traduction de champs requis
164
		$this->setRequiredNote(INS_CHAMPS_REQUIS) ;
165
		$this->setRequiredNote(INS_CHAMPS_REQUIS) ;
Line 284... Line 285...
284
							else $def = $tableau[$i]['nom_bdd'];
285
							else $def = $tableau[$i]['nom_bdd'];
285
				}
286
				}
286
				elseif ( $tableau[$i]['type']=='texte' || $tableau[$i]['type']=='textelong' || 
287
				elseif ( $tableau[$i]['type']=='texte' || $tableau[$i]['type']=='textelong' || 
287
							$tableau[$i]['type']=='listedatedeb' || $tableau[$i]['type']=='listedatefin' ||
288
							$tableau[$i]['type']=='listedatedeb' || $tableau[$i]['type']=='listedatefin' ||
288
							 $tableau[$i]['type']=='champs_mail' || $tableau[$i]['type']=='champs_cache' 
289
							 $tableau[$i]['type']=='champs_mail' || $tableau[$i]['type']=='champs_cache' 
289
							 || $tableau[$i]['type']=='lien_internet') {
290
							 || $tableau[$i]['type']=='lien_internet' || $tableau[$i]['type']=='newsletter') {
290
					$def=$tableau[$i]['nom_bdd'];					
291
					$def=$tableau[$i]['nom_bdd'];					
291
				} elseif ($tableau[$i]['type']=='carte_google') {
292
				} elseif ($tableau[$i]['type']=='carte_google') {
292
					$def = 'carte_google';
293
					$def = 'carte_google';
293
					$valeurs_par_defaut[$def] = array ('latitude' => $valeurs_par_defaut[$tableau[$i]['limite1']], 
294
					$valeurs_par_defaut[$def] = array ('latitude' => $valeurs_par_defaut[$tableau[$i]['limite1']], 
294
												'longitude' => $valeurs_par_defaut[$tableau[$i]['limite2']]);
295
												'longitude' => $valeurs_par_defaut[$tableau[$i]['limite2']]);
Line 313... Line 314...
313
			 }
314
			 }
314
		}
315
		}
Line 315... Line 316...
315
		
316
		
316
        $debut = inscription::getTemplate(INS_TEMPLATE_TITRE_FORMULAIRE, $GLOBALS['ins_config']['ic_id_inscription'])."\n";
317
        $debut = inscription::getTemplate(INS_TEMPLATE_TITRE_FORMULAIRE, $GLOBALS['ins_config']['ic_id_inscription'])."\n";
317
        $this->addElement('html', $debut);
-
 
318
        /*
-
 
319
        $this->addElement('text', 'email', INS_EMAIL) ;
-
 
320
        $this->addRule('email', INS_EMAIL_REQUIS, 'required','', 'client') ;
-
 
321
        $this->addRule('email', INS_MAIL_INCORRECT, 'email', '', 'client') ; 
-
 
322
        /*       
-
 
323
        $this->addElement('password', 'mot_de_passe', INS_MOT_DE_PASSE, array('size' => '10')) ;
-
 
324
        $this->addElement('password', 'mot_de_passe_repete', INS_REPETE_MOT_DE_PASSE, array('size' => '10')) ;
-
 
325
        $this->addRule('mot_de_passe', INS_MOT_DE_PASSE_REQUIS, 'required', '', 'client') ;
-
 
326
        $this->addRule('mot_de_passe_repete', INS_MOT_DE_PASSE_REQUIS, 'required', '', 'client') ;
-
 
327
        $this->addRule(array ('mot_de_passe', 'mot_de_passe_repete'), INS_MOTS_DE_PASSE_DIFFERENTS, 'compare', '', 'client') ;
-
 
328
 
-
 
329
        $this->addElement('text', 'nom', INS_NOM) ;
-
 
330
        $this->addRule('nom', INS_NOM_REQUIS, 'required', '', 'client') ;
-
 
331
        $this->addElement('text', 'prenom', INS_PRENOM) ;
-
 
332
        $this->addRule('prenom', INS_PRENOM_REQUIS, 'required', '', 'client') ;
-
 
333
        if ($GLOBALS['ins_config']['ic_utilise_nom_wiki'] && ! $GLOBALS['ins_config']['ic_genere_nom_wiki']) {
-
 
334
        		$this->addElement('text', 'nomwiki', INS_NOM_WIKI, array('id' => 'nom_wiki')) ;
-
 
335
        }
-
 
336
        $this->addElement('text', 'adresse_1', INS_ADRESSE_1, array('id' => 'adresse_1')) ;
-
 
337
        $this->addElement('text', 'adresse_2', INS_ADRESSE_2, array('id' => 'adresse_2')) ;
-
 
338
        $this->addElement('text', 'cp', INS_CODE_POSTAL, array('id' => 'cp')) ;
-
 
339
        $this->addRule('cp', INS_CODE_POSTAL_REQUIS, 'required', '', 'client') ;
-
 
340
        $this->addElement('text', 'ville', INS_VILLE, array('id' => 'ville')) ;
-
 
341
        // L'element pays est construit a partir du tableau liste_pays
-
 
342
        $liste_pays = new ListeDePays($GLOBALS['ins_db']) ;
-
 
343
        $this->addElement('select', 'pays', INS_PAYS, $liste_pays->getListePays(INS_LANGUE_DEFAUT), array('id' => 'pays')) ;
-
 
344
        */
-
 
345
        //$this->addElement('text', 'telephone', INS_TELEPHONE, array('size' => '12')) ;
-
 
346
        //$this->addElement('text', 'fax', INS_FAX, array('size' => '12')) ;
-
 
347
        //$this->addElement('text', 'site', INS_SITE_INTERNET) ;
-
 
348
        /*
-
 
349
        $this->addElement('file', 'image', INS_LOGO_OU_IMAGE) ;
-
 
350
		$this->setMaxFileSize(150000); //logo de 15ko maximum
-
 
351
		*/
-
 
352
        //if (INS_CHAMPS_LETTRE != '') $this->addElement('checkbox', 'lettre',INS_LETTRE, '<br />') ;
-
 
353
        //$this->addElement('checkbox', 'visible',INS_VISIBLE, '<br />') ;
-
 
354
        /*
-
 
355
        $this->addElement('hidden', 'est_structure', 0) ;
-
 
356
        $defauts=array ('lettre'=>1,'pays'=>'FR');
-
 
357
        if (isset ($GLOBALS['ins_config']['ic_google_key']) && $GLOBALS['ins_config']['ic_google_key'] != '') {
-
 
358
	        $this->addElement('button', 'chercher_sur_carte', 'VĂ©rifier mon adresse avec la carte', array("onclick" => "showAddress();"));
-
 
359
	        $this->addElement('html', '<tr><td colspan="2"	><div id="map" style="width: 600px; height: 450px"></div></td></tr>');
-
 
360
	        $this->addElement('text', 'latitude', 'Latitude', array('id' => 'latitude', 'size' => 6, 'readonly' => 'readonly'));
-
 
361
	        $this->addElement('text', 'longitude', 'longitude', array('id' => 'longitude', 'size' => 6, 'readonly' => 'readonly'));
318
        $this->addElement('html', $debut);
362
	        
-
 
363
        } 
-
 
364
        */     
-
 
365
        //$this->setDefaults($defauts);	
319
      
366
        // on fait un groupe avec les boutons pour les mettres sur la meme ligne
320
        // on fait un groupe avec les boutons pour les mettres sur la meme ligne
367
        $boutons[] = &HTML_QuickForm::createElement('button', 'annuler', INS_ANNULER, array ("onclick" => "javascript:document.location.href='".$url."'",
321
        $boutons[] = &HTML_QuickForm::createElement('button', 'annuler', INS_ANNULER, array ("onclick" => "javascript:document.location.href='".$url."'",
368
        												'id' => 'annuler', 'class' => 'bouton'));
322
        												'id' => 'annuler', 'class' => 'bouton'));
369
        $boutons[] = &HTML_QuickForm::createElement('submit', 'valider', INS_VALIDER, array ('id' => 'valider', 'class' =>'bouton'));
323
        $boutons[] = &HTML_QuickForm::createElement('submit', 'valider', INS_VALIDER, array ('id' => 'valider', 'class' =>'bouton'));