diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index c1502d648f9..5f75c61f0ab 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -1083,7 +1083,7 @@ class FormOther * @param string $selected Preselected value * @param string $htmlname Name of HTML select object * @param int $useempty Show empty in list - * @param int $longlabel Show long label + * @param int $longlabel Show long label (1) or short label (0) * @param string $morecss More Css * @param bool $addjscombo Add js combo * @return string diff --git a/htdocs/holiday/month_report.php b/htdocs/holiday/month_report.php index 08f56f3dafa..d5fe33156a6 100644 --- a/htdocs/holiday/month_report.php +++ b/htdocs/holiday/month_report.php @@ -161,8 +161,8 @@ $help_url = 'EN:Module_Holiday'; llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-holiday page-month_report'); -$search_month = GETPOSTINT("remonth") ? GETPOSTINT("remonth") : date("m", time()); -$search_year = GETPOSTINT("reyear") ? GETPOSTINT("reyear") : date("Y", time()); +$search_month = GETPOSTINT("search_month") ? GETPOSTINT("search_month") : (int) dol_print_date(dol_now(), "%m"); +$search_year = GETPOSTINT("search_year") ? GETPOSTINT("search_year") : (int) dol_print_date(dol_now(), "%Y"); $year_month = sprintf("%04d", $search_year).'-'.sprintf("%02d", $search_month); $sql = "SELECT cp.rowid, cp.ref, cp.fk_user, cp.date_debut, cp.date_fin, cp.fk_type, cp.description, cp.halfday, cp.statut as status"; @@ -178,11 +178,11 @@ $sql .= " )"; if (!empty($search_ref)) { $sql .= natural_search('cp.ref', $search_ref); } -if (!empty($search_employee) && $search_employee > 0) { - $sql .= " AND cp.fk_user = ".((int) $search_employee); +if (!empty($search_employee) && $search_employee != '-1') { + $sql .= " AND cp.fk_user IN (".$db->sanitize($search_employee).")"; } if (!empty($search_type) && $search_type != '-1') { - $sql .= ' AND cp.fk_type IN ('.$db->sanitize($search_type).')'; + $sql .= " AND cp.fk_type IN (".$db->sanitize($search_type).")"; } if (!empty($search_description)) { $sql .= natural_search('cp.description', $search_description); @@ -208,15 +208,21 @@ if ($limit > 0 && $limit != $conf->liste_limit) { if (!empty($search_ref)) { $param .= '&search_ref='.urlencode($search_ref); } -if (!empty($search_employee)) { +if (!empty($search_employee) && $search_employee != '-1') { $param .= '&search_employee='.urlencode($search_employee); } -if (!empty($search_type)) { +if (!empty($search_type) && $search_type != '-1') { $param .= '&search_type='.urlencode($search_type); } if (!empty($search_description)) { $param .= '&search_description='.urlencode($search_description); } +if (!empty($search_month)) { + $param .= '&search_month='.((int) $search_month); +} +if (!empty($search_year)) { + $param .= '&search_year='.((int) $search_year); +} print '