From cd51211292b27ab0eaf7c97e5348a9d5f2a41076 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 6 Feb 2011 02:02:33 +0000 Subject: [PATCH] Fix: Bad value of selected year --- htdocs/core/class/html.form.class.php | 15 +++++---------- htdocs/fourn/facture/index.php | 3 +-- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 8473cd79a76b4..8ead4f3f7b5a3 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -3098,7 +3098,7 @@ function select_month($selected='',$htmlname='monthid',$useempty=0) /** * \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) @@ -3115,19 +3115,14 @@ function select_year($selected='',$htmlname='yearid',$useempty=0, $min_year=10, print '\n"; } diff --git a/htdocs/fourn/facture/index.php b/htdocs/fourn/facture/index.php index f6a21d116e900..d6bfbc7ba1a70 100644 --- a/htdocs/fourn/facture/index.php +++ b/htdocs/fourn/facture/index.php @@ -204,10 +204,9 @@ 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 '';