diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index f87d7a64d6e..2a8dbc53cfd 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -3074,11 +3074,11 @@ class Form /** * \brief Return HTML combo list of years - * \param selected Preselected value + * \param selected Preselected value (''=current year, -1=none, year otherwise) * \param htmlname Name of HTML select object * \param useempty Affiche valeur vide dans liste - * \param $min_year Valeur minimum de l'annee dans la liste (par defaut annee courante -10) - * \param $max_year Valeur maximum de l'annee dans la liste (par defaut annee courante + 5) + * \param $min_year Offset of minimum year into list (by default current year -10) + * \param $max_year Offset of maximum year into list (by default current year + 5) * TODO Move into html.formother */ function select_year($selected='',$htmlname='yearid',$useempty=0, $min_year=10, $max_year=5) @@ -3091,19 +3091,14 @@ class Form print '\n"; } diff --git a/htdocs/fourn/facture/index.php b/htdocs/fourn/facture/index.php index f6a21d116e9..d6bfbc7ba1a 100644 --- a/htdocs/fourn/facture/index.php +++ b/htdocs/fourn/facture/index.php @@ -204,10 +204,9 @@ if ($resql) print ''; print ''; //print ' '.$langs->trans('Year').': '; - $max_year = date("Y"); $syear = $year; //if ($syear == '') $syear = date("Y"); - $html->select_year($syear,'year',1, '', $max_year); + $html->select_year($syear?$syear:-1,'year',1, 10, 10); print ''; print ' '; print '';