FIX #6363 More complete fix

This commit is contained in:
Laurent Destailleur 2017-02-06 20:08:47 +01:00
parent bee507c76c
commit 821978d54c

View File

@ -2036,9 +2036,10 @@ function select_expensereport_statut($selected='',$htmlname='fk_statut',$useempt
* @param int $selected Preselected type * @param int $selected Preselected type
* @param string $htmlname Name of field in form * @param string $htmlname Name of field in form
* @param int $showempty Add an empty field * @param int $showempty Add an empty field
* @param int $active 1=Active only, 0=Unactive only, -1=All
* @return string Select html * @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; global $db,$langs,$user;
$langs->load("trips"); $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 = "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"; $sql.= " ORDER BY c.label ASC";
$resql=$db->query($sql); $resql=$db->query($sql);
if ($resql) if ($resql)