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