forked from Wavyzz/dolibarr
replace test by getEntity()
This commit is contained in:
@@ -69,9 +69,7 @@ abstract class CommonObject
|
|||||||
|
|
||||||
$sql = "SELECT rowid, ref, ref_ext";
|
$sql = "SELECT rowid, ref, ref_ext";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX.$element;
|
$sql.= " FROM ".MAIN_DB_PREFIX.$element;
|
||||||
|
$sql.= " WHERE entity IN (".getEntity($element).")" ;
|
||||||
if($conf->multicompany->enabled)$sql.= " WHERE entity=".$conf->entity;
|
|
||||||
else $sql.=" WHERE 1 ";
|
|
||||||
|
|
||||||
if ($id > 0) $sql.= " AND rowid = ".$db->escape($id);
|
if ($id > 0) $sql.= " AND rowid = ".$db->escape($id);
|
||||||
else if ($ref) $sql.= " AND ref = '".$db->escape($ref)."'";
|
else if ($ref) $sql.= " AND ref = '".$db->escape($ref)."'";
|
||||||
|
|||||||
Reference in New Issue
Block a user