Subversion Repositories Applications.bazar

Rev

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

Rev 346 Rev 356
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.php,v 1.75 2007-12-04 09:07:21 alexandre_tb Exp $
22
// CVS : $Id: bazar.fonct.php,v 1.76 2007-12-14 09:56:02 alexandre_tb Exp $
23
/**
23
/**
24
*
24
*
25
* Fonctions du module bazar
25
* Fonctions du module bazar
26
* 
26
* 
27
*
27
*
Line 29... Line 29...
29
//Auteur original :
29
//Auteur original :
30
*@author        Alexandre Granier <alexandre@tela-botanica.org>
30
*@author        Alexandre Granier <alexandre@tela-botanica.org>
31
*@author        Florian Schmitt <florian@ecole-et-nature.org>
31
*@author        Florian Schmitt <florian@ecole-et-nature.org>
32
//Autres auteurs :
32
//Autres auteurs :
33
*@copyright     Tela-Botanica 2000-2004
33
*@copyright     Tela-Botanica 2000-2004
34
*@version       $Revision: 1.75 $ $Date: 2007-12-04 09:07:21 $
34
*@version       $Revision: 1.76 $ $Date: 2007-12-14 09:56:02 $
35
// +------------------------------------------------------------------------------------------------------+
35
// +------------------------------------------------------------------------------------------------------+
36
*/
36
*/
Line 37... Line 37...
37
 
37
 
38
// +------------------------------------------------------------------------------------------------------+
38
// +------------------------------------------------------------------------------------------------------+
Line 544... Line 544...
544
	
544
	
545
		//contruction du squelette du formulaire
545
		//contruction du squelette du formulaire
546
		$formtemplate = new HTML_QuickForm('formulaire', 'post', preg_replace ('/&amp;/', '&', $lien_formulaire->getURL()) );
546
		$formtemplate = new HTML_QuickForm('formulaire', 'post', preg_replace ('/&amp;/', '&', $lien_formulaire->getURL()) );
547
		$squelette =& $formtemplate->defaultRenderer();
547
		$squelette =& $formtemplate->defaultRenderer();
548
   		$squelette->setFormTemplate("\n".'<form {attributes}>'."\n".'<table style="border:0;width:100%;">'."\n".'{content}'."\n".'</table>'."\n".'</form>'."\n");
548
   		$squelette->setFormTemplate("\n".'<form {attributes}>'."\n".'<table style="border:0;width:100%;">'."\n".'{content}'."\n".'</table>'."\n".'</form>'."\n");
549
    	$squelette->setElementTemplate( '<tr>'."\n".'<td style="font-size:12px;width:120px;text-align:right;">'."\n".'{label}'.
549
    	$squelette->setElementTemplate( '<tr>'."\n".'<td>'."\n".'{label}'.
550
    		                        '<!-- BEGIN required --><span class="symbole_obligatoire">&nbsp;*</span><!-- END required -->'."\n".
550
    		                        '<!-- BEGIN required --><span class="symbole_obligatoire">&nbsp;*</span><!-- END required -->'."\n".
551
    								' </td>'."\n".'<td style="text-align:left;padding:5px;"> '."\n".'{element}'."\n".
551
    								' </td>'."\n".'<td style="text-align:left;padding:5px;"> '."\n".'{element}'."\n".
552
                                    '<!-- BEGIN error --><span class="erreur">{error}</span><!-- END error -->'."\n".
552
                                    '<!-- BEGIN error --><span class="erreur">{error}</span><!-- END error -->'."\n".
553
                                    '</td>'."\n".'</tr>'."\n");
553
                                    '</td>'."\n".'</tr>'."\n");
Line 751... Line 751...
751
			                         isset ($valeurs_par_defaut[$def]) ? $valeurs_par_defaut[$def] : '', 
751
			                         isset ($valeurs_par_defaut[$def]) ? $valeurs_par_defaut[$def] : '', 
752
			                         $tableau[$i]['table_source'], $tableau[$i]['obligatoire']) ;
752
			                         $tableau[$i]['table_source'], $tableau[$i]['obligatoire']) ;
753
				if ($tableau[$i]['type']=='carte_google') {
753
				if ($tableau[$i]['type']=='carte_google') {
754
					include_once GEN_CHEMIN_API.'formulaire/formulaire.fonct.google.php';
754
					include_once GEN_CHEMIN_API.'formulaire/formulaire.fonct.google.php';
755
    				GEN_stockerCodeScript($script);
755
    				GEN_stockerCodeScript($script);
-
 
756
    				// On ajoute l attribut load a la balise body
-
 
757
					GEN_AttributsBody('onload', 'load()');
756
				}	           
758
				}	           
757
			}
759
			}
758
		}
760
		}
759
		else {
761
		else {
760
			for ($i=0; $i<count($tableau); $i++) {
762
			for ($i=0; $i<count($tableau); $i++) {
761
				$tableau[$i]['type']($formtemplate, $tableau[$i]['nom_bdd'], $tableau[$i]['label'], $tableau[$i]['limite1'],
763
				$tableau[$i]['type']($formtemplate, $tableau[$i]['nom_bdd'], $tableau[$i]['label'], $tableau[$i]['limite1'],
762
			                         $tableau[$i]['limite2'], $tableau[$i]['defaut'], $tableau[$i]['table_source'], $tableau[$i]['obligatoire']) ;
764
			                         $tableau[$i]['limite2'], $tableau[$i]['defaut'], $tableau[$i]['table_source'], $tableau[$i]['obligatoire']) ;
763
			    if ($tableau[$i]['type'] == 'carte_google') {
765
			    if ($tableau[$i]['type'] == 'carte_google') {
764
			    	include_once GEN_CHEMIN_API.'formulaire/formulaire.fonct.google.php';
766
			    	include_once GEN_CHEMIN_API.'formulaire/formulaire.fonct.google.php';
765
    				GEN_stockerCodeScript($script);
767
    				GEN_stockerCodeScript($script);
-
 
768
    				// On ajoute l attribut load a la balise body
-
 
769
					GEN_AttributsBody('onload', 'load()');
766
			    }
770
			    }
767
			 }
771
			 }
768
		}
772
		}
769
		$formtemplate->addElement('hidden', 'typeannonce', $GLOBALS['_BAZAR_']['id_typeannonce']);
773
		$formtemplate->addElement('hidden', 'typeannonce', $GLOBALS['_BAZAR_']['id_typeannonce']);
Line 1397... Line 1401...
1397
}
1401
}
Line 1398... Line 1402...
1398
 
1402
 
1399
/* +--Fin du code ----------------------------------------------------------------------------------------+
1403
/* +--Fin du code ----------------------------------------------------------------------------------------+
1400
*
1404
*
-
 
1405
* $Log: not supported by cvs2svn $
-
 
1406
* Revision 1.75  2007-12-04 09:07:21  alexandre_tb
-
 
1407
* Fusion avec la livraison AHA : 4 déc 2007
1401
* $Log: not supported by cvs2svn $
1408
*
1402
* Revision 1.74  2007-10-25 09:41:31  alexandre_tb
1409
* Revision 1.74  2007-10-25 09:41:31  alexandre_tb
1403
* mise en place de variable de session pour eviter que les formulaires soit valider 2 fois, pour les url, fichiers et image
1410
* mise en place de variable de session pour eviter que les formulaires soit valider 2 fois, pour les url, fichiers et image
1404
*
1411
*
1405
* Revision 1.73  2007-10-24 13:27:00  alexandre_tb
1412
* Revision 1.73  2007-10-24 13:27:00  alexandre_tb