FIX uniformize and fix code

This commit is contained in:
Regis Houssin
2022-01-27 10:57:20 +01:00
parent d78bcaa419
commit 153cd38c78
5 changed files with 37 additions and 37 deletions

View File

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