Clean code

This commit is contained in:
Laurent Destailleur 2018-10-30 14:27:14 +01:00
parent b4c9df65f9
commit 7a268d8d9f
2 changed files with 5 additions and 5 deletions

View File

@ -7145,7 +7145,7 @@ class Form
} }
/** /**
* Return HTML to show the select categories of expense category * Return HTML to show the select of expense categories
* *
* @param string $selected preselected category * @param string $selected preselected category
* @param string $htmlname name of HTML select list * @param string $htmlname name of HTML select list
@ -7161,7 +7161,7 @@ class Form
global $db, $conf, $langs, $user; global $db, $conf, $langs, $user;
$sql = 'SELECT rowid, label FROM '.MAIN_DB_PREFIX.'c_exp_tax_cat WHERE active = 1'; $sql = 'SELECT rowid, label FROM '.MAIN_DB_PREFIX.'c_exp_tax_cat WHERE active = 1';
$sql.= ' AND entity IN (0,'.getEntity('').')'; $sql.= ' AND entity IN (0,'.getEntity('exp_tax_cat').')';
if (!empty($excludeid)) $sql.= ' AND rowid NOT IN ('.implode(',', $excludeid).')'; if (!empty($excludeid)) $sql.= ' AND rowid NOT IN ('.implode(',', $excludeid).')';
$sql.= ' ORDER BY label'; $sql.= ' ORDER BY label';

View File

@ -7682,7 +7682,7 @@ function getDictvalue($tablename, $field, $id, $checkentity=false, $rowidfield='
{ {
$dictvalues[$tablename] = array(); $dictvalues[$tablename] = array();
$sql = 'SELECT * FROM '.$tablename.' WHERE 1'; $sql = 'SELECT * FROM '.$tablename.' WHERE 1';
if ($checkentity) $sql.= ' AND entity IN (0,'.getEntity('').')'; if ($checkentity) $sql.= ' AND entity IN (0,'.getEntity($tablename).')';
$resql = $db->query($sql); $resql = $db->query($sql);
if ($resql) if ($resql)