From 27cd74eaea79c8ade2a5570ab22ff7cc19dd7b51 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 8 Dec 2011 01:45:38 +0100 Subject: [PATCH] New: Add hidden option MAIN_LIST_FILTER_ON_DAY --- htdocs/compta/facture.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 6962fc2639b..82e2c659f15 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -3084,6 +3084,7 @@ else $pageprev = $page - 1; $pagenext = $page + 1; + $day = GETPOST('day','int'); $month = GETPOST('month','int'); $year = GETPOST('year','int'); @@ -3137,8 +3138,10 @@ else } if ($month > 0) { - if ($year > 0) + if ($year > 0 && empty($day)) $sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($year,$month,false))."' AND '".$db->idate(dol_get_last_day($year,$month,false))."'"; + else if ($year > 0 && ! empty($day)) + $sql.= " AND f.datef BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $month, $day, $year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $month, $day, $year))."'"; else $sql.= " AND date_format(f.datef, '%m') = '".$month."'"; } @@ -3202,11 +3205,9 @@ else print ''; print ''; print ''; + if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; print ''; - //print ' '.$langs->trans('Year').': '.$syear; - //print 'xx'.$syear.'zz'; - //if ($syear == '') $syear = date("Y"); - $htmlother->select_year($syear?$syear:-1,'year',1, 20, 5); + $htmlother->select_year($year?$year:-1,'year',1, 20, 5); print ''; print ' '; print '';