Subversion Repositories Applications.bazar

Rev

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

Rev 41 Rev 45
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.4 2005-10-25 13:53:02 alexandre_tb Exp $
22
// CVS : $Id: bazar.fonct.formulaire.php,v 1.5 2005-11-07 17:05:45 florian Exp $
23
/**
23
/**
24
* Inscription
24
* Formulaire
25
*
25
*
26
* Les fonctions de mise en page des formulaire
26
* Les fonctions de mise en page des formulaire
27
*
27
*
28
*@package bazar
28
*@package bazar
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.4 $ $Date: 2005-10-25 13:53:02 $
34
*@version       $Revision: 1.5 $ $Date: 2005-11-07 17:05:45 $
35
// +------------------------------------------------------------------------------------------------------+
35
// +------------------------------------------------------------------------------------------------------+
36
*/
36
*/
Line -... Line 37...
-
 
37
 
-
 
38
require_once 'bazar.fonct.formulaire.controles.php';
37
 
39
 
Line 38... Line 40...
38
//-------------------FONCTIONS DE MISE EN PAGE DES FORMULAIRES
40
//-------------------FONCTIONS DE MISE EN PAGE DES FORMULAIRES
39
 
41
 
40
/** liste() - Ajoute un élément de type liste au formulaire
42
/** liste() - Ajoute un élément de type liste au formulaire
Line 61... Line 63...
61
	$option=array('style'=>'width: '.$limite1.'px;');
63
	$option=array('style'=>'width: '.$limite1.'px;');
62
	require_once 'HTML/QuickForm/select.php';
64
	require_once 'HTML/QuickForm/select.php';
63
	$select= new HTML_QuickForm_select($nom_bdd, constant($label), $select, $option);
65
	$select= new HTML_QuickForm_select($nom_bdd, constant($label), $select, $option);
64
	$select->setSize($limite2); 
66
	$select->setSize($limite2); 
65
	$select->setMultiple(0);
67
	$select->setMultiple(0);
-
 
68
	$select->setSelected($defaut);
66
	$formtemplate->addElement($select) ;
69
	$formtemplate->addElement($select) ;
-
 
70
	
67
	//gestion des valeurs par défaut
71
	//gestion des champs obligatoire
68
	$defauts=array($nom_bdd=>$defaut);
-
 
69
	$formtemplate->setDefaults($defauts);
72
	$formtemplate->registerRule('saisir_liste','function','liste_choisir');
70
	//gestion du champs obligatoire
73
	$formtemplate->addRule($nom_bdd, BAZ_CHOISIR_OBLIGATOIRE, 'saisir_liste');
71
	$formtemplate->addRule('titre', BAZ_TITRE_REQUIS, 'required', '', 'client') ;
74
	print_r($formtemplate->getRegisteredRules());
72
	if (isset($obligatoire)and($obligatoire==1)) {$formtemplate->addRule($nom_bdd, constant($label.'_REQUIS'), 'required', '', 'client') ;}
75
	if (isset($obligatoire)and($obligatoire==1)) {$formtemplate->addRule($nom_bdd, constant($label.'_REQUIS'), 'required', '', 'client') ;}
73
}
76
}
Line 74... Line 77...
74
 
77
 
Line 182... Line 185...
182
}
185
}
Line 183... Line 186...
183
 
186
 
184
/* +--Fin du code ----------------------------------------------------------------------------------------+
187
/* +--Fin du code ----------------------------------------------------------------------------------------+
185
*
188
*
-
 
189
* $Log: not supported by cvs2svn $
-
 
190
* Revision 1.4  2005/10/25 13:53:02  alexandre_tb
-
 
191
* ajout d'un filtre dans les formulaire texte et textelong
186
* $Log: not supported by cvs2svn $
192
*
187
* Revision 1.3  2005/07/21 19:03:12  florian
193
* Revision 1.3  2005/07/21 19:03:12  florian
188
* nouveautés bazar: templates fiches, correction de bugs, ...
194
* nouveautés bazar: templates fiches, correction de bugs, ...
189
*
195
*
190
* Revision 1.1.1.1  2005/02/17 18:05:11  florian
196
* Revision 1.1.1.1  2005/02/17 18:05:11  florian