19,7 → 19,7 |
// | License along with this library; if not, write to the Free Software | |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
// +------------------------------------------------------------------------------------------------------+ |
// CVS : $Id: bazar.fonct.formulaire.php,v 1.8 2005-11-18 16:03:23 florian Exp $ |
// CVS : $Id: bazar.fonct.formulaire.php,v 1.9 2005-11-24 16:17:13 florian Exp $ |
/** |
* Formulaire |
* |
31,7 → 31,7 |
//Autres auteurs : |
*@author Aleandre GRANIER <alexandre@tela-botanica.org> |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.8 $ $Date: 2005-11-18 16:03:23 $ |
*@version $Revision: 1.9 $ $Date: 2005-11-24 16:17:13 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
|
77,6 → 77,40 |
} |
|
|
/** checkbox() - Ajoute un élément de type checkbox au formulaire |
* |
* @param mixed L'objet QuickForm du formulaire |
* @param string nom du champs dans la table bazar_fiche dans la base de donnée |
* @param string label à afficher dans le formulaire |
* @param string première restriction de la taille des champs du formulaire |
* @param string deuxième restriction de la taille des champs du formulaire |
* @param string valeur par défaut du formulaire |
* @param string table source pour les valeurs de la liste |
* @param string ce champs est il obligatoire? (required) |
* @return void |
*/ |
function checkbox(&$formtemplate, $nom_bdd , $label, $limite1, $limite2, $defaut, $source, $obligatoire) { |
$requete = 'SELECT * FROM '.$source; |
$resultat = & $GLOBALS['_BAZAR_']['db'] -> query($requete) ; |
if (DB::isError ($resultat)) { |
die ($GLOBALS['_BAZAR_']['db']->getMessage().$GLOBALS['_BAZAR_']['db']->getDebugInfo()) ; |
} |
require_once PAP_CHEMIN_RACINE.'api/pear/HTML/QuickForm/advcheckbox.php' ; |
$i=0; |
while ($ligne = $resultat->fetchRow()) { |
//$chkbox[$ligne[0]] = $ligne[1] ; |
if ($i==0) $labelchkbox=constant($label) ; else $labelchkbox=' ' ; |
$checkbox[]= & HTML_Quickform::createElement('checkbox', $ligne[0], $labelchkbox, $ligne[1], array ('style'=>'display:inline;margin-left:2px;')) ; |
$i++; |
} |
//if (isset($obligatoire)and($obligatoire==1)) { |
//$formtemplate->addRule($nom_bdd.'$i', BAZ_CHOISIR_OBLIGATOIRE.' '.constant($label) , 'nonzero', '', 'client') ; |
//$formtemplate->addRule($nom_bdd.'$i', constant($label.'_REQUIS'), 'required', '', 'client') ; |
//} |
$formtemplate->addGroup($checkbox, $nom_bdd, constant($label), '<br />'."\n"); |
} |
|
|
/** listedatedeb() - Ajoute un élément de type date sous forme de liste au formulaire pour designer une date de début |
* |
* @param mixed L'objet QuickForm du formulaire |
153,10 → 187,9 |
* @return void |
*/ |
function textelong(&$formtemplate, $nom_bdd , $label, $limite1, $limite2, $defaut, $source, $obligatoire) { |
$formtexte= new HTML_QuickForm_textarea($nom_bdd, constant($label)); |
$formtexte= new HTML_QuickForm_textarea($nom_bdd, constant($label), array('style'=>'white-space: normal;')); |
$formtexte->setCols($limite1); |
$formtexte->setRows($limite2); |
$formtexte->setWrap('HARD'); |
$formtemplate->addElement($formtexte) ; |
//gestion des valeurs par défaut |
$defauts=array($nom_bdd=>$defaut); |
181,7 → 214,7 |
*/ |
function labelhtml(&$formtemplate, $nom_bdd , $label, $limite1, $limite2, $defaut, $source, $obligatoire) { |
require_once PAP_CHEMIN_RACINE.'api/pear/HTML/QuickForm/html.php'; |
$formhtml= new HTML_QuickForm_html(constant($label)); |
$formhtml= new HTML_QuickForm_html('<li>'.constant($label).'</li>'."\n"); |
$formtemplate->addElement($formhtml) ; |
} |
|
188,6 → 221,9 |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* Revision 1.8 2005/11/18 16:03:23 florian |
* correction bug html entites |
* |
* Revision 1.7 2005/11/07 17:51:06 florian |
* correction bug liste |
* |