From f4e461e60ae7ad808a445b550c061a663a243d22 Mon Sep 17 00:00:00 2001 From: activdev Date: Mon, 28 Jul 2008 08:38:29 +0000 Subject: [PATCH] New : added function seelct_year : display a select box to choose a year (4 digits) with various initialization options --- htdocs/html.form.class.php | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/htdocs/html.form.class.php b/htdocs/html.form.class.php index 11c9ba45785..c4a4613a38f 100644 --- a/htdocs/html.form.class.php +++ b/htdocs/html.form.class.php @@ -3058,6 +3058,40 @@ class Form $select_month .= ''; return $select_month; } + /** + * \brief Retourne la liste des années + * \param selected Année pré-sélectionné + * \param htmlname Nom de la zone select + * \param useempty Affiche valeur vide dans liste + * \param $min_year Valeur minimum de l'année dans la liste (par défaut année courante -10) + * \param $max_year Valeur maximum de l'année dans la liste (par défaut année courante + 5) + */ + function select_year($selected='',$htmlname='yearid',$useempty=0, $min_year='', $max_year='') + { + if($max_year == '') + $max_year = date("Y") +5; + if($min_year == '') + $min_year = date("Y") - 10; + + print '\n"; + } /** * \brief Affiche tableau avec ref et bouton navigation pour un objet metier