mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-01-04 16:12:39 +01:00
Clean code
This commit is contained in:
@@ -1273,16 +1273,16 @@ class ExtraFields
|
||||
//We have to join on extrafield table
|
||||
if (strpos($InfoFieldList[4], 'extra') !== false) {
|
||||
$sql .= ' as main, '.MAIN_DB_PREFIX.$InfoFieldList[0].'_extrafields as extra';
|
||||
$sqlwhere .= ' WHERE extra.fk_object=main.'.$InfoFieldList[2].' AND '.$InfoFieldList[4];
|
||||
$sqlwhere .= " WHERE extra.fk_object=main.".$InfoFieldList[2]." AND ".$InfoFieldList[4];
|
||||
} else {
|
||||
$sqlwhere .= ' WHERE '.$InfoFieldList[4];
|
||||
$sqlwhere .= " WHERE ".$InfoFieldList[4];
|
||||
}
|
||||
} else {
|
||||
$sqlwhere .= ' WHERE 1=1';
|
||||
}
|
||||
// Some tables may have field, some other not. For the moment we disable it.
|
||||
if (in_array($InfoFieldList[0], array('tablewithentity'))) {
|
||||
$sqlwhere .= ' AND entity = '.$conf->entity;
|
||||
$sqlwhere .= ' AND entity = '.((int) $conf->entity);
|
||||
}
|
||||
$sql .= $sqlwhere;
|
||||
//print $sql;
|
||||
@@ -1485,16 +1485,16 @@ class ExtraFields
|
||||
// We have to join on extrafield table
|
||||
if (strpos($InfoFieldList[4], 'extra.') !== false) {
|
||||
$sql .= ' as main, '.MAIN_DB_PREFIX.$InfoFieldList[0].'_extrafields as extra';
|
||||
$sqlwhere .= ' WHERE extra.fk_object=main.'.$InfoFieldList[2].' AND '.$InfoFieldList[4];
|
||||
$sqlwhere .= " WHERE extra.fk_object=main.".$InfoFieldList[2]." AND ".$InfoFieldList[4];
|
||||
} else {
|
||||
$sqlwhere .= ' WHERE '.$InfoFieldList[4];
|
||||
$sqlwhere .= " WHERE ".$InfoFieldList[4];
|
||||
}
|
||||
} else {
|
||||
$sqlwhere .= ' WHERE 1=1';
|
||||
}
|
||||
// Some tables may have field, some other not. For the moment we disable it.
|
||||
if (in_array($InfoFieldList[0], array('tablewithentity'))) {
|
||||
$sqlwhere .= ' AND entity = '.$conf->entity;
|
||||
$sqlwhere .= " AND entity = ".((int) $conf->entity);
|
||||
}
|
||||
// $sql.=preg_replace('/^ AND /','',$sqlwhere);
|
||||
// print $sql;
|
||||
|
||||
Reference in New Issue
Block a user