Subversion Repositories Applications.papyrus

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
448 ddelon 1
<?php
2
/*vim: set expandtab tabstop=4 shiftwidth=4: */
3
// +------------------------------------------------------------------------------------------------------+
4
// | PHP version 4.1                                                                                      |
5
// +------------------------------------------------------------------------------------------------------+
6
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
7
// +------------------------------------------------------------------------------------------------------+
8
// | This library is free software; you can redistribute it and/or                                        |
9
// | modify it under the terms of the GNU Lesser General Public                                           |
10
// | License as published by the Free Software Foundation; either                                         |
11
// | version 2.1 of the License, or (at your option) any later version.                                   |
12
// |                                                                                                      |
13
// | This library is distributed in the hope that it will be useful,                                      |
14
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
15
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU                                    |
16
// | Lesser General Public License for more details.                                                      |
17
// |                                                                                                      |
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                                  |
20
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
21
// +------------------------------------------------------------------------------------------------------+
1625 alexandre_ 22
// CVS : $Id: inscription.class.php,v 1.27 2007-10-01 12:14:50 alexandre_tb Exp $
448 ddelon 23
/**
24
* Inscription
25
*
1430 alexandre_ 26
* Un module d'inscription, en general ce code est specifique a
448 ddelon 27
* un site web
28
*
29
*@package inscription
30
//Auteur original :
31
*@author        Alexandre GRANIER <alexandre@tela-botanica.org>
32
//Autres auteurs :
33
*@copyright     Tela-Botanica 2000-2004
1625 alexandre_ 34
*@version       $Revision: 1.27 $ $Date: 2007-10-01 12:14:50 $
448 ddelon 35
// +------------------------------------------------------------------------------------------------------+
36
*/
37
 
38
// +------------------------------------------------------------------------------------------------------+
39
// |                                            ENTETE du PROGRAMME                                       |
40
// +------------------------------------------------------------------------------------------------------+
41
 
1344 alexandre_ 42
require_once PAP_CHEMIN_API_PEAR.'HTML/QuickForm.php' ;
448 ddelon 43
 
1344 alexandre_ 44
class ListeDePays extends PEAR{
448 ddelon 45
 
46
    var $_db ;
47
    /** Constructeur
1430 alexandre_ 48
     *  Verifie l'existance de la table gen_pays_traduction
448 ddelon 49
     *
50
     *  @param  DB  Un objet PEAR::DB
51
     * @return
52
     */
53
 
54
    function ListeDePays(&$objetDB) {
55
        $this->_db = $objetDB ;
603 florian 56
        $requete = 'SHOW TABLES';
448 ddelon 57
        $resultat = $objetDB->query ($requete) ;
58
        if (DB::isError ($resultat)) {
59
            die ("Echec de la requete : $requete<br />".$resultat->getMessage()) ;
60
        }
61
        while ($ligne = $resultat->fetchRow()) {
62
            if ($ligne[0] == INS_TABLE_PAYS) {
63
                return ;
64
            }
65
        }
1430 alexandre_ 66
        return $this->raiseError('La table gen_i18n_pays n\'est pas presente dans la base de donnee !') ;
448 ddelon 67
    }
68
 
69
    /** Renvoie la liste des pays traduite
70
     *
71
     *  @param  string  une chaine de type i18n ou une chaine code iso langue (fr_FR ou fr ou FR)
1430 alexandre_ 72
     * @return  un tableau contenant en cle, le code iso du pays, en majuscule et en valeur le nom du pays traduit
448 ddelon 73
     */
74
    function getListePays($i18n) {
75
	    if (strlen($i18n) == 2) {
76
		    $i18n = strtolower($i18n)."-".strtoupper($i18n) ;
77
	    }
1298 neiluj 78
	    $requete = 'select '.INS_CHAMPS_ID_PAYS.', '.INS_CHAMPS_LABEL_PAYS.' from '.INS_TABLE_PAYS
79
							.' where '.INS_CHAMPS_I18N_PAYS.'="'.$i18n.'"';
448 ddelon 80
	    $resultat = $this->_db->query($requete) ;
81
 
82
	    if (DB::isError($resultat)) {
83
		    die ("Echec de la requete : $requete<br />".$resultat->getMessage()) ;
84
	    }
85
	    if ($resultat->numRows() == 0) {
1430 alexandre_ 86
		    return $this->raiseError('Le code fourni ne correspond a aucun pays ou n\'est pas dans la table!') ;
448 ddelon 87
	    }
88
	    $retour = array() ;
89
	    while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
90
		    $retour[$ligne[INS_CHAMPS_ID_PAYS]] = $ligne[INS_CHAMPS_LABEL_PAYS] ;
91
	    }
92
	    return $retour ;
93
    }
673 alexandre_ 94
 
95
    /** Renvoie le nom d'un pays traduit dans la langue passé en paramètre
96
     *
97
     *  @param  string  une chaine de type i18n ou une chaine code iso langue (fr_FR ou fr ou FR)
1430 alexandre_ 98
     * @return  un tableau contenant en cle, le code iso du pays, en majuscule et en valeur le nom du pays traduit
673 alexandre_ 99
     */
100
    function getNomPays($codeIso, $i18n = INS_LANGUE_DEFAUT) {
101
	    if (strlen($i18n) == 2) {
102
		    $i18n = strtolower($i18n)."-".strtoupper($i18n) ;
103
	    }
104
	    $requete = 'select '.INS_CHAMPS_LABEL_PAYS.' from '.INS_TABLE_PAYS.
1298 neiluj 105
							' where '.INS_CHAMPS_I18N_PAYS.'="'.$i18n.'" and '.
106
							INS_CHAMPS_ID_PAYS.'="'.$codeIso.'"';
895 alexandre_ 107
	    $resultat = $this->_db->query($requete) ;
108
 
673 alexandre_ 109
	    if (DB::isError($resultat)) {
110
		    die ("Echec de la requete : $requete<br />".$resultat->getMessage()) ;
111
	    }
112
	    if ($resultat->numRows() == 0) {
1430 alexandre_ 113
		    return $this->raiseError('Le code fourni ne correspond a aucun pays ou n\'est pas dans la table!') ;
673 alexandre_ 114
	    }
115
	    $ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC) ;
116
	    return $ligne[INS_CHAMPS_LABEL_PAYS] ;
117
    }
448 ddelon 118
}
119
 
120
class HTML_formulaireInscription extends HTML_Quickform {
121
 
122
 
123
    /**
124
     *  Constructeur
125
     *
126
     * @param string formName Le nom du formulaire
1430 alexandre_ 127
     * @param string method Methode post ou get
448 ddelon 128
     * @param string action L'action du formulaire.
129
     * @param int target La cible.
130
     * @param Array attributes Les attributs HTML en plus.
131
     * @param bool trackSubmit ??
132
     * @return void
133
     * @access public
134
     */
135
 
136
    function HTML_formulaireInscription( $formName,  $method = "post",  $action,  $target = "_self",  $attributes,  $trackSubmit = false ) {
137
        HTML_Quickform::HTML_Quickform($formName, $method, $action, $target, $attributes, $trackSubmit) ;
138
    }
139
 
140
    /**
141
     *
142
     *
143
     * @return void
144
     * @access public
145
     */
146
    function construitFormulaire($url)
147
    {
1298 neiluj 148
		$squelette =& $this->defaultRenderer();
149
   		$squelette->setFormTemplate("\n".'<form {attributes}>'."\n".'<table style="border:0;width:100%;">'."\n".'{content}'."\n".'</table>'."\n".'</form>'."\n");
150
    	$squelette->setElementTemplate( '<tr>'."\n".
151
										'<td style="font-size:12px;width:140px;text-align:right;">'."\n".'{label}'.
152
										'<!-- BEGIN required --><span class="symbole_obligatoire">&nbsp;*</span><!-- END required -->'."\n".
153
										' :</td>'."\n".
154
										'<td style="text-align:left;padding:5px;"> '."\n".'{element}'."\n".
155
										'<!-- BEGIN error --><span class="erreur">{error}</span><!-- END error -->'."\n".
156
										'</td>'."\n".
157
										'</tr>'."\n");
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');
160
        $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->setRequiredNoteTemplate("\n".'<tr>'."\n".'<td colspan="2" class="symbole_obligatoire">* {requiredNote}</td></tr>'."\n");
163
		//Traduction de champs requis
164
		$this->setRequiredNote(INS_CHAMPS_REQUIS) ;
165
		$this->setJsWarnings(INS_ERREUR_SAISIE,INS_VEUILLEZ_CORRIGER);
1467 alexandre_ 166
 
167
		$script = '
1420 alexandre_ 168
	        // Variables globales
169
	        var map = null;
170
	    	var geocoder = null;
171
			var lat = document.getElementById("latitude");
172
	        var lon = document.getElementById("longitude");
173
 
174
	        function load() {
175
	        if (GBrowserIsCompatible()) {
176
	          map = new GMap2(document.getElementById("map"));
177
	          map.addControl(new GSmallMapControl());
178
			  map.addControl(new GMapTypeControl());
179
			  map.addControl(new GScaleControl());
180
			  map.enableContinuousZoom();
181
 
182
			  // On centre la carte sur le languedoc roussillon
183
			  center = new GLatLng(43.84245116699036, 3.768310546875);
184
	          map.setCenter(center, 7);
185
			  //marker = new GMarker(center, {draggable: true}) ;
186
	          GEvent.addListener(map, "click", function(marker, point) {
187
	  		    if (marker) {
188
	    	      map.removeOverlay(marker);
189
	    	      var lat = document.getElementById("latitude");
190
	              var lon = document.getElementById("longitude");
191
	    	      lat.value = "";
192
	              lon.value = "";
193
			    } else {
194
			      // On ajoute un marqueur a l endroit du clic et on place les coordonnees dans les champs latitude et longitude
195
			      marker = new GMarker(point, {draggable: true}) ;
196
			      GEvent.addListener(marker, "dragend", function () {
197
	                coordMarker = marker.getPoint() ;
198
	                var lat = document.getElementById("latitude");
199
	                var lon = document.getElementById("longitude");
200
		            lat.value = coordMarker.lat();
201
	                lon.value = coordMarker.lng();
202
	              });
203
		          map.addOverlay(marker);
204
		          setLatLonForm(marker);
205
	  		    }
206
	        });' ;
1490 neiluj 207
 
208
			if($_REQUEST['action'] == 'modifier') {
1550 alexandre_ 209
				$requete_defaut = 'select a_longitude, a_latitude from annuaire where a_id='.$GLOBALS['AUTH']->getAuthData(INS_CHAMPS_ID);
210
				$resultat_defaut = $GLOBALS['ins_db']->query($requete_defaut);
211
				$ligne = $resultat_defaut->fetchRow(DB_FETCHMODE_OBJECT) ;
212
				if ($ligne->a_latitude != '' && $ligne->a_longitude != '') {
1490 neiluj 213
					$script .= '
1550 alexandre_ 214
							point = new GLatLng('.$ligne->a_latitude.', '.$ligne->a_longitude.');
1490 neiluj 215
							marker = new GMarker(point, {draggable: true});
216
							map.addOverlay(marker);' ;
217
				}
218
			}
219
		    $script .= 'geocoder = new GClientGeocoder();
1550 alexandre_ 220
	    };' .
221
	    		'}
1420 alexandre_ 222
	    function showAddress() {
1467 alexandre_ 223
	      var adress_1 = document.getElementById("a_adresse1").value ;
1604 alexandre_ 224
	      if (document.getElementById("a_adresse2")) ' .
225
	      '	var adress_2 = document.getElementById("a_adresse2").value ;' .
226
	      ' else var adress_2 = "";
1467 alexandre_ 227
	      var ville = document.getElementById("a_ville").value ;
228
	      var cp = document.getElementById("a_code_postal").value ;
1550 alexandre_ 229
	      if (document.getElementById("a_ce_pays").type == "select-one") {
230
	      	var selectIndex = document.getElementById("a_ce_pays").selectedIndex;
231
	      	var pays = document.getElementById("a_ce_pays").options[selectIndex].text ;
232
	      } else {
233
	      	var pays = document.getElementById("a_ce_pays").value;
234
	      }
1420 alexandre_ 235
 
236
	      var address = adress_1 + \' \' + adress_2 + \' \' + \' \' + cp + \' \' + ville + \' \' +pays ;
237
	      if (geocoder) {
238
	        geocoder.getLatLng(
239
	          address,
240
	          function(point) {
241
	            if (!point) {
242
	              alert(address + " not found");
243
	            } else {
244
	              map.setCenter(point, 13);
245
	              var marker = new GMarker(point, {draggable: true});
246
	              GEvent.addListener(marker, "dragend", function () {
247
	      coordMarker = marker.getPoint() ;
248
	      var lat = document.getElementById("latitude");
249
	      var lon = document.getElementById("longitude");
250
		  lat.value = coordMarker.lat();
251
	      lon.value = coordMarker.lng();
252
	    });
253
 
254
	              map.addOverlay(marker);
255
	              setLatLonForm(marker)
256
	              marker.openInfoWindowHtml(address+ "'.INS_GOOGLE_MSG.'");
257
	            }
258
	          }
259
	        );
260
	      }
261
	    }
262
	    function setLatLonForm(marker) {
263
	      coordMarker = marker.getPoint() ;
264
	      var lat = document.getElementById("latitude");
265
	      var lon = document.getElementById("longitude");
266
		  lat.value = coordMarker.lat();
267
	      lon.value = coordMarker.lng();
268
	    }
269
	    ';
1467 alexandre_ 270
 
271
		// Mise en place du systeme de template du bazar
272
		include_once GEN_CHEMIN_API.'/formulaire/formulaire.fonct.inc.php';
273
		$tableau= formulaire_valeurs_template_champs($GLOBALS['ins_config']['ic_inscription_template']);
274
 
275
		if (isset ($_REQUEST['action']) && $_REQUEST['action']=='modifier') {
276
			//Ajout des valeurs par defaut
277
			$requete_defaut = 'select * from annuaire where a_id='.$GLOBALS['AUTH']->getAuthData(INS_CHAMPS_ID);
278
			$resultat_defaut = $GLOBALS['ins_db']->query($requete_defaut);
279
			$valeurs_par_defaut = $resultat_defaut->fetchRow(DB_FETCHMODE_ASSOC);
280
 
281
			for ($i=0; $i<count($tableau); $i++) {
282
				if ( $tableau[$i]['type']=='liste' || $tableau[$i]['type']=='checkbox' ) {
283
					if (is_int ($tableau[$i]['nom_bdd'])) $def=$tableau[$i]['type'].$tableau[$i]['nom_bdd'];
284
							else $def = $tableau[$i]['nom_bdd'];
285
				}
286
				elseif ( $tableau[$i]['type']=='texte' || $tableau[$i]['type']=='textelong' ||
287
							$tableau[$i]['type']=='listedatedeb' || $tableau[$i]['type']=='listedatefin' ||
1625 alexandre_ 288
							 $tableau[$i]['type']=='champs_mail' || $tableau[$i]['type']=='champs_cache'
289
							 || $tableau[$i]['type']=='lien_internet') {
1467 alexandre_ 290
					$def=$tableau[$i]['nom_bdd'];
291
				} elseif ($tableau[$i]['type']=='carte_google') {
292
					$def = 'carte_google';
293
					$valeurs_par_defaut[$def] = array ('latitude' => $valeurs_par_defaut[$tableau[$i]['limite1']],
294
												'longitude' => $valeurs_par_defaut[$tableau[$i]['limite2']]);
295
					GEN_stockerCodeScript($script);
1585 alexandre_ 296
					// On ajoute l attribut load a la balise body
297
					GEN_AttributsBody('onload', 'load()');
1467 alexandre_ 298
				}
299
				$tableau[$i]['type']($this, $tableau[$i]['nom_bdd'], $tableau[$i]['label'], $tableau[$i]['limite1'],
300
			                         $tableau[$i]['limite2'], $valeurs_par_defaut[$def], $tableau[$i]['table_source'],
301
			                         $tableau[$i]['obligatoire']) ;
302
			}
303
		}
304
		else {
305
			for ($i=0; $i<count($tableau); $i++) {
306
				if ($tableau[$i]['type'] == 'carte_google') {
307
					GEN_stockerCodeScript($script);
1585 alexandre_ 308
					// On ajoute l attribut load a la balise body
309
					GEN_AttributsBody('onload', 'load()');
1467 alexandre_ 310
				}
311
				$tableau[$i]['type']($this, $tableau[$i]['nom_bdd'], $tableau[$i]['label'], $tableau[$i]['limite1'],
312
			                         $tableau[$i]['limite2'], $tableau[$i]['defaut'], $tableau[$i]['table_source'], $tableau[$i]['obligatoire']) ;
313
			 }
314
		}
315
 
316
        $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')) ;
1420 alexandre_ 335
        }
1467 alexandre_ 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'));
362
 
363
        }
364
        */
365
        //$this->setDefaults($defauts);
366
        // 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."'",
368
        												'id' => 'annuler', 'class' => 'bouton'));
369
        $boutons[] = &HTML_QuickForm::createElement('submit', 'valider', INS_VALIDER, array ('id' => 'valider', 'class' =>'bouton'));
370
        $this->addGroup($boutons, 'groupe_bouton', '', "\n");
371
 
372
        if (isset ($GLOBALS['ins_config']['ic_google_key']) && $GLOBALS['ins_config']['ic_google_key'] != '') {
373
        	GEN_stockerFichierScript('googleMapScript', $GLOBALS['ins_config']['ic_google_key']);
374
 
375
 
376
 
377
 
378
        }
448 ddelon 379
    } // end of member function construitFormulaire
380
 
381
    /** Modifie le formulaire pour l'adapter au cas des structures
382
     *
383
     *
384
     * @return void
385
     * @access public
386
     */
387
    function formulaireStructure()
388
    {
1467 alexandre_ 389
        /*
448 ddelon 390
        $this->removeElement('nom', false) ;
603 florian 391
        $this->removeElement('prenom') ;
448 ddelon 392
        $this->removeElement('email', false) ;
1467 alexandre_ 393
        $this->removeElement('telephone', false) ;
394
        $nom_structure = & HTML_QuickForm::createElement('text', 'nom', INS_NOM_STRUCTURE) ;
395
        $this->insertElementBefore($nom_structure, 'mot_de_passe') ;
396
 
448 ddelon 397
        $mail = & HTML_QuickForm::createElement('text', 'email', INS_MAIL_STRUCTURE) ;
398
        $this->insertElementBefore($mail, 'mot_de_passe') ;
1467 alexandre_ 399
 
603 florian 400
        $this->addRule('nom', INS_NOM_REQUIS, 'required', '', 'client') ;
1467 alexandre_ 401
        /*
603 florian 402
        $sigle_structure = & HTML_QuickForm::createElement('text', 'sigle_structure', INS_SIGLE_DE_LA_STRUCTURE) ;
403
        $this->insertElementBefore($sigle_structure, 'email') ;
1467 alexandre_ 404
        */
405
        // not required
406
        //$this->addRule('sigle_structure', INS_SIGLE_REQUIS, 'required', '', 'client') ;
407
 
408
        // what's this ?
409
        //$num_agrement = & HTML_QuickForm::createElement('text', 'num_agrement', INS_NUM_AGREMENT) ;
410
        //$this->insertElementBefore($num_agrement, 'email') ;
411
        /*
412
        $telephone = & HTML_QuickForm::createElement('text', 'telephone', INS_TELEPHONE_STRUCTURE) ;
413
        $this->insertElementBefore($telephone, 'lettre') ;
414
        $fax = & HTML_QuickForm::createElement('text', 'fax', INS_FAX_STRUCTURE) ;
415
        $this->insertElementBefore($fax, 'lettre') ;
416
 
603 florian 417
        $this->removeElement('site', false) ;
448 ddelon 418
        $site_structure = & HTML_QuickForm::createElement('text', 'site', INS_SITE_STRUCTURE) ;
419
        $this->insertElementBefore($site_structure, 'lettre') ;
1467 alexandre_ 420
 
421
        // bloc contact
422
        $coord = & HTML_QuickForm::createElement('html', '<tr><td colspan="2"><strong>'.INS_COORD_CONTACT.'</strong></td></tr>') ;
423
        $nom = & HTML_QuickForm::createElement('text', 'nom_contact', INS_NOM_CONTACT) ;
424
        $prenom = & HTML_QuickForm::createElement('text', 'prenom_contact', INS_PRENOM_CONTACT) ;
425
        $poste = & HTML_QuickForm::createElement('text', 'poste_contact', INS_POSTE_CONTACT) ;
426
        $tel = & HTML_QuickForm::createElement('text', 'tel_contact', INS_TEL_CONTACT) ;
427
		$this->insertElementBefore($coord, 'lettre') ;
428
		$this->insertElementBefore($nom, 'lettre') ;
429
		$this->insertElementBefore($prenom, 'lettre') ;
430
		$this->insertElementBefore($poste, 'lettre') ;
431
		$this->insertElementBefore($tel, 'lettre') ;
432
        */
433
        $separateur = & HTML_QuickForm::createElement('html', '<tr><td colspan="2"><hr /></td></tr>') ;
434
        $this->insertElementBefore($separateur, 'lettre') ;
435
 
436
        //$fax = & HTML_QuickForm::createElement('text', 'fax', INS_FAX) ;
437
        //$image = & HTML_QuickForm::createElement('file', 'image', INS_LOGO_OU_IMAGE) ;
438
 
439
		//$this->insertElementBefore($image, 'lettre') ;
440
		//$this->setMaxFileSize(150000); //logo de 150 ko maximum
441
 
448 ddelon 442
        $this->removeElement('est_structure', false) ;
603 florian 443
        $this->addElement('hidden', 'est_structure', 1) ;
444
        $this->addElement('hidden', 'form_structure', 1) ;
1430 alexandre_ 445
 
448 ddelon 446
    }
447
    /**
448
     *
449
     *
450
     * @return string
451
     * @access public
452
     */
453
    function toHTML( )
454
    {
455
        $res = HTML_QuickForm::toHTML() ;
456
        return $res ;
457
    } // end of member function toHTML
458
}
459
 
1298 neiluj 460
?>