mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-01-10 11:02:56 +01:00
FIX uniformize and fix code
This commit is contained in:
@@ -536,7 +536,7 @@ abstract class CommonObject
|
||||
global $db, $conf;
|
||||
|
||||
$sql = "SELECT rowid, ref, ref_ext";
|
||||
$sql .= " FROM ".$this->db->prefix().$element;
|
||||
$sql .= " FROM ".$db->prefix().$element;
|
||||
$sql .= " WHERE entity IN (".getEntity($element).")";
|
||||
|
||||
if ($id > 0) {
|
||||
@@ -4105,7 +4105,7 @@ abstract class CommonObject
|
||||
|
||||
global $db;
|
||||
|
||||
$sql = "SELECT ".$field_select." FROM ".$this->db->prefix().$table_element." WHERE ".$field_where." = ".((int) $fk_object_where);
|
||||
$sql = "SELECT ".$field_select." FROM ".$db->prefix().$table_element." WHERE ".$field_where." = ".((int) $fk_object_where);
|
||||
$resql = $db->query($sql);
|
||||
|
||||
$TRes = array();
|
||||
@@ -4134,7 +4134,7 @@ abstract class CommonObject
|
||||
|
||||
global $db;
|
||||
|
||||
$sql = "DELETE FROM ".$this->db->prefix().$table_element." WHERE ".$field_where." = ".((int) $fk_object_where);
|
||||
$sql = "DELETE FROM ".$db->prefix().$table_element." WHERE ".$field_where." = ".((int) $fk_object_where);
|
||||
$resql = $db->query($sql);
|
||||
|
||||
if (empty($resql)) {
|
||||
@@ -8052,7 +8052,7 @@ abstract class CommonObject
|
||||
public static function commonReplaceThirdparty(DoliDB $db, $origin_id, $dest_id, array $tables, $ignoreerrors = 0)
|
||||
{
|
||||
foreach ($tables as $table) {
|
||||
$sql = 'UPDATE '.$this->db->prefix().$table.' SET fk_soc = '.((int) $dest_id).' WHERE fk_soc = '.((int) $origin_id);
|
||||
$sql = 'UPDATE '.$db->prefix().$table.' SET fk_soc = '.((int) $dest_id).' WHERE fk_soc = '.((int) $origin_id);
|
||||
|
||||
if (!$db->query($sql)) {
|
||||
if ($ignoreerrors) {
|
||||
|
||||
Reference in New Issue
Block a user