|
@@ -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)
|