| 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: bazar.fonct.formulaire.php,v 1.25 2007-04-11 08:30:12 neiluj Exp $
 | 22 | // CVS : $Id: bazar.fonct.formulaire.php,v 1.26 2007-06-04 15:24:31 alexandre_tb Exp $
 | 
          
            | 23 | /**
 | 23 | /**
 | 
          
            | 24 | * Formulaire
 | 24 | * Formulaire
 | 
          
            | 25 | *
 | 25 | *
 | 
          
            | 26 | * Les fonctions de mise en page des formulaire
 | 26 | * Les fonctions de mise en page des formulaire
 | 
          
            | 27 | *
 | 27 | *
 | 
          
            | Line 29... | Line 29... | 
          
            | 29 | //Auteur original :
 | 29 | //Auteur original :
 | 
          
            | 30 | *@author        Florian SCHMITT <florian@ecole-et-nature.org>
 | 30 | *@author        Florian SCHMITT <florian@ecole-et-nature.org>
 | 
          
            | 31 | //Autres auteurs :
 | 31 | //Autres auteurs :
 | 
          
            | 32 | *@author        Aleandre GRANIER <alexandre@tela-botanica.org>
 | 32 | *@author        Aleandre GRANIER <alexandre@tela-botanica.org>
 | 
          
            | 33 | *@copyright     Tela-Botanica 2000-2004
 | 33 | *@copyright     Tela-Botanica 2000-2004
 | 
          
            | 34 | *@version       $Revision: 1.25 $ $Date: 2007-04-11 08:30:12 $
 | 34 | *@version       $Revision: 1.26 $ $Date: 2007-06-04 15:24:31 $
 | 
          
            | 35 | // +------------------------------------------------------------------------------------------------------+
 | 35 | // +------------------------------------------------------------------------------------------------------+
 | 
          
            | 36 | */
 | 36 | */
 | 
          
            | Line 37... | Line 37... | 
          
            | 37 |  
 | 37 |  
 | 
          
            | Line 65... | Line 65... | 
          
            | 65 | 		$select[0]=BAZ_INDIFFERENT;
 | 65 | 		$select[0]=BAZ_INDIFFERENT;
 | 
          
            | 66 | 	}
 | 66 | 	}
 | 
          
            | 67 | 	while ($ligne = $resultat->fetchRow()) {
 | 67 | 	while ($ligne = $resultat->fetchRow()) {
 | 
          
            | 68 | 		$select[$ligne[1]] = $ligne[2] ;		
 | 68 | 		$select[$ligne[1]] = $ligne[2] ;		
 | 
          
            | 69 | 	}
 | 69 | 	}
 | 
          
            | 70 | 	$option=array('style'=>'width: '.$limite1.'px;');
 | 70 | 	$option=array('style'=>'width: '.$limite1.'px;', 'id' => 'liste'.$id_liste);
 | 
          
            | 71 | 	require_once PAP_CHEMIN_API_PEAR.'HTML/QuickForm/select.php';
 | 71 | 	require_once PAP_CHEMIN_API_PEAR.'HTML/QuickForm/select.php';
 | 
          
            | 72 | 	$select= new HTML_QuickForm_select('liste'.$id_liste, $label, $select, $option);
 | 72 | 	$select= new HTML_QuickForm_select('liste'.$id_liste, $label, $select, $option);
 | 
          
            | 73 | 	$select->setSize($limite2); 
 | 73 | 	$select->setSize($limite2); 
 | 
          
            | 74 | 	$select->setMultiple(0);
 | 74 | 	$select->setMultiple(0);
 | 
          
            | 75 | 	$select->setSelected($defaut);
 | 75 | 	$select->setSelected($defaut);
 | 
          
            | Line 187... | Line 187... | 
          
            | 187 | * @param    string  table source pour les valeurs du texte (inutile)
 | 187 | * @param    string  table source pour les valeurs du texte (inutile)
 | 
          
            | 188 | * @param    string  ce champs est il obligatoire? (required)
 | 188 | * @param    string  ce champs est il obligatoire? (required)
 | 
          
            | 189 | * @return   void
 | 189 | * @return   void
 | 
          
            | 190 | */
 | 190 | */
 | 
          
            | 191 | function texte(&$formtemplate, $nom_bdd , $label, $limite1, $limite2, $defaut, $source, $obligatoire, $dans_moteur_de_recherche=0) {
 | 191 | function texte(&$formtemplate, $nom_bdd , $label, $limite1, $limite2, $defaut, $source, $obligatoire, $dans_moteur_de_recherche=0) {
 | 
          
            | 192 | 	$option=array('size'=>$limite1,'maxlength'=>$limite2);
 | 192 | 	$option=array('size'=>$limite1,'maxlength'=>$limite2, 'id' => $nom_bdd);
 | 
          
            | 193 | 	$formtemplate->addElement('text', $nom_bdd, $label, $option) ;
 | 193 | 	$formtemplate->addElement('text', $nom_bdd, $label, $option) ;
 | 
          
            | 194 | 	//gestion des valeurs par défaut
 | 194 | 	//gestion des valeurs par défaut
 | 
          
            | 195 | 	$defauts=array($nom_bdd=>$defaut);
 | 195 | 	$defauts=array($nom_bdd=>$defaut);
 | 
          
            | 196 | 	$formtemplate->setDefaults($defauts);
 | 196 | 	$formtemplate->setDefaults($defauts);
 | 
          
            | 197 | 	$formtemplate->applyFilter($nom_bdd, 'addslashes') ;
 | 197 | 	$formtemplate->applyFilter($nom_bdd, 'addslashes') ;
 | 
          
            | Line 213... | Line 213... | 
          
            | 213 | * @param    string  table source pour les valeurs du texte (inutile)
 | 213 | * @param    string  table source pour les valeurs du texte (inutile)
 | 
          
            | 214 | * @param    string  ce champs est il obligatoire? (required)
 | 214 | * @param    string  ce champs est il obligatoire? (required)
 | 
          
            | 215 | * @return   void
 | 215 | * @return   void
 | 
          
            | 216 | */
 | 216 | */
 | 
          
            | 217 | function textelong(&$formtemplate, $nom_bdd , $label, $limite1, $limite2, $defaut, $source, $obligatoire, $dans_moteur_de_recherche=0) {
 | 217 | function textelong(&$formtemplate, $nom_bdd , $label, $limite1, $limite2, $defaut, $source, $obligatoire, $dans_moteur_de_recherche=0) {
 | 
          
            | 218 | 	$formtexte= new HTML_QuickForm_textarea($nom_bdd, $label, array('style'=>'white-space: normal;'));
 | 218 | 	$formtexte= new HTML_QuickForm_textarea($nom_bdd, $label, array('style'=>'white-space: normal;', 'id' => $nom_bdd));
 | 
          
            | 219 | 	$formtexte->setCols($limite1);
 | 219 | 	$formtexte->setCols($limite1);
 | 
          
            | 220 | 	$formtexte->setRows($limite2);
 | 220 | 	$formtexte->setRows($limite2);
 | 
          
            | 221 | 	$formtemplate->addElement($formtexte) ;
 | 221 | 	$formtemplate->addElement($formtexte) ;
 | 
          
            | 222 | 	//gestion des valeurs par défaut
 | 222 | 	//gestion des valeurs par défaut
 | 
          
            | 223 | 	$defauts=array($nom_bdd=>$defaut);
 | 223 | 	$defauts=array($nom_bdd=>$defaut);
 | 
          
            | Line 435... | Line 435... | 
          
            | 435 | 	require_once PAP_CHEMIN_API_PEAR.'HTML/QuickForm/html.php';
 | 435 | 	require_once PAP_CHEMIN_API_PEAR.'HTML/QuickForm/html.php';
 | 
          
            | 436 | 	$formhtml= new HTML_QuickForm_html('<tr>'."\n".'<td colspan="2" style="text-align:left;">'."\n".$label."\n".'</td>'."\n".'</tr>'."\n");
 | 436 | 	$formhtml= new HTML_QuickForm_html('<tr>'."\n".'<td colspan="2" style="text-align:left;">'."\n".$label."\n".'</td>'."\n".'</tr>'."\n");
 | 
          
            | 437 | 	$formtemplate->addElement($formhtml) ;
 | 437 | 	$formtemplate->addElement($formhtml) ;
 | 
          
            | 438 | }
 | 438 | }
 | 
          
            | Line -... | Line 439... | 
          
            | - |   | 439 |  
 | 
          
            | - |   | 440 | /** carte_google() - Ajoute un élément de carte google au formulaire
 | 
          
            | - |   | 441 | *
 | 
          
            | - |   | 442 | * @param    mixed   L'objet QuickForm du formulaire
 | 
          
            | - |   | 443 | * @param    string  l url vers la script google
 | 
          
            | - |   | 444 | * @param    string  label à afficher dans le formulaire
 | 
          
            | - |   | 445 | * @param    string  première restriction de la taille des champs du formulaire
 | 
          
            | - |   | 446 | * @param    string  deuxième restriction de la taille des champs du formulaire
 | 
          
            | - |   | 447 | * @param    string  valeur par défaut du formulaire
 | 
          
            | - |   | 448 | * @param    string  table source pour les valeurs de la liste
 | 
          
            | - |   | 449 | * @param    string  ce champs est il obligatoire? (required)
 | 
          
            | - |   | 450 | * @param    boolean sommes nous dans le moteur de recherche?
 | 
          
            | - |   | 451 | * @return   void
 | 
          
            | - |   | 452 | */
 | 
          
            | - |   | 453 | function carte_google(&$formtemplate, $url_google_script , $label, $limite1, $limite2, $defaut, $source, $obligatoire, $dans_moteur_de_recherche=0) {
 | 
          
            | - |   | 454 | 	
 | 
          
            | - |   | 455 | 	if (is_array ($defaut)) {
 | 
          
            | - |   | 456 |     	$formtemplate->setDefaults(array('latitude' => $defaut['latitude'], 'longitude' => $defaut['longitude']));
 | 
          
            | - |   | 457 |     }
 | 
          
            | - |   | 458 | 	
 | 
          
            | - |   | 459 | 	GEN_stockerFichierScript('googleMapScript', $url_google_script);
 | 
          
            | - |   | 460 |         	
 | 
          
            | - |   | 461 | 	$formtemplate->addElement('button', 'chercher_sur_carte', 'Vérifier mon adresse avec la carte', array("onclick" => "showAddress();"));
 | 
          
            | - |   | 462 |     $formtemplate->addElement('text', 'latitude', 'Latitude', array('id' => 'latitude', 'size' => 6, 'readonly' => 'readonly'));
 | 
          
            | - |   | 463 |     $formtemplate->addElement('text', 'longitude', 'longitude', array('id' => 'longitude', 'size' => 6, 'readonly' => 'readonly'));
 | 
          
            | - |   | 464 |     $formtemplate->addElement('html', '<tr><td colspan="2"	><div id="map" style="width: 600px; height: 450px"></div></td></tr>');
 | 
          
            | - |   | 465 |     
 | 
          
            | - |   | 466 |     include_once BAZ_CHEMIN_APPLI.'bibliotheque/bazar.fonct.google.php';
 | 
          
            | - |   | 467 |     GEN_stockerCodeScript($script);
 | 
          
            | - |   | 468 | }
 | 
          
            | 439 |  
 | 469 |  
 | 
          
            | 440 | /* +--Fin du code ----------------------------------------------------------------------------------------+
 | 470 | /* +--Fin du code ----------------------------------------------------------------------------------------+
 | 
          
            | 441 | *
 | 471 | *
 | 
          
            | - |   | 472 | * $Log: not supported by cvs2svn $
 | 
          
            | - |   | 473 | * Revision 1.25  2007/04/11 08:30:12  neiluj
 | 
          
            | - |   | 474 | * remise en état du CVS...
 | 
          
            | 442 | * $Log: not supported by cvs2svn $
 | 475 | *
 | 
          
            | 443 | * Revision 1.22.2.3  2007/03/16 14:48:32  alexandre_tb
 | 476 | * Revision 1.22.2.3  2007/03/16 14:48:32  alexandre_tb
 | 
          
            | 444 | * on peut maintenant saisir une date par défaut
 | 477 | * on peut maintenant saisir une date par défaut
 | 
          
            | 445 | * et 0000-00-00 pour des champs vide
 | 478 | * et 0000-00-00 pour des champs vide
 | 
          
            | 446 | *
 | 479 | *
 |