From 05be90a220186d166268864275833fa7a439504f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a?= Date: Mon, 29 Apr 2013 22:50:58 +0200 Subject: [PATCH] Using month selector instead of direct input --- htdocs/holiday/month_report.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/holiday/month_report.php b/htdocs/holiday/month_report.php index f184cdc201e..ea87ea6fda0 100644 --- a/htdocs/holiday/month_report.php +++ b/htdocs/holiday/month_report.php @@ -54,7 +54,7 @@ $month = GETPOST('month_start'); $year = GETPOST('year_start'); if(empty($month)) { - $month = date('m'); + $month = date('n'); } if(empty($year)) { $year = date('Y'); @@ -65,7 +65,7 @@ $sql.= " FROM llx_holiday cp"; $sql.= " LEFT JOIN llx_user u ON cp.fk_user = u.rowid"; $sql.= " WHERE cp.statut = 3"; // Approved // TODO Use BETWEEN instead of date_format -$sql.= " AND (date_format(cp.date_debut, '%Y-%m') = '$year-$month' OR date_format(cp.date_fin, '%Y-%m') = '$year-$month')"; +$sql.= " AND (date_format(cp.date_debut, '%Y-%c') = '$year-$month' OR date_format(cp.date_fin, '%Y-%c') = '$year-$month')"; $sql.= " ORDER BY u.lastname,cp.date_debut"; $result = $db->query($sql); @@ -77,8 +77,9 @@ print '
'; print '
'."\n"; -print $langs->trans('Month').':  '; -$htmlother->select_year($year,'year_start',1,10,3); +print $langs->trans('Month').': '; +print $htmlother->select_month($month, 'month_start').' '; +print $htmlother->select_year($year,'year_start',1,10,3); print ''; @@ -126,7 +127,7 @@ if($num == '0') { print ''; print ''.$holidaystatic->getNomUrl(1).''; - print ''.$user->lastname.' '.$user->firstname.''; + print ''.$user->getNomUrl(1).''; print ''.dol_print_date($start_date,'day'); print ''; print ''.dol_print_date($end_date,'day');