From 821978d54c007df01b6d8aa0ac64911a2806c268 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 6 Feb 2017 20:08:47 +0100 Subject: [PATCH] FIX #6363 More complete fix --- htdocs/expensereport/class/expensereport.class.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 487515dcb99..4a6c9df691e 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -2036,9 +2036,10 @@ function select_expensereport_statut($selected='',$htmlname='fk_statut',$useempt * @param int $selected Preselected type * @param string $htmlname Name of field in form * @param int $showempty Add an empty field + * @param int $active 1=Active only, 0=Unactive only, -1=All * @return string Select html */ -function select_type_fees_id($selected='',$htmlname='type',$showempty=0) +function select_type_fees_id($selected='',$htmlname='type',$showempty=0, $active=1) { global $db,$langs,$user; $langs->load("trips"); @@ -2052,7 +2053,7 @@ function select_type_fees_id($selected='',$htmlname='type',$showempty=0) } $sql = "SELECT c.id, c.code, c.label as type FROM ".MAIN_DB_PREFIX."c_type_fees as c"; - $sql.= " WHERE c.active = 1"; + if ($active >= 0) $sql.= " WHERE c.active = ".$active; $sql.= " ORDER BY c.label ASC"; $resql=$db->query($sql); if ($resql)