diff --git a/htdocs/partnership/class/partnership.class.php b/htdocs/partnership/class/partnership.class.php index 793cf118b64..0849f9ffc2b 100644 --- a/htdocs/partnership/class/partnership.class.php +++ b/htdocs/partnership/class/partnership.class.php @@ -1061,6 +1061,21 @@ class Partnership extends CommonObject return $result; } + /** + * Function used to replace a thirdparty id with another one. + * + * @param DoliDB $db Database handler + * @param int $origin_id Old thirdparty id + * @param int $dest_id New thirdparty id + * @return bool + */ + public static function replaceThirdparty($db, $origin_id, $dest_id) + { + $tables = array('partnership'); + + return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables); + } + /** * Return the label of the status * diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index a36088f41f5..d4d105b6d0e 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -5301,7 +5301,7 @@ class Societe extends CommonObject */ public function mergeCompany($soc_origin_id) { - global $langs, $hookmanager, $user, $action; + global $conf, $langs, $hookmanager, $user, $action; $error = 0; $soc_origin = new Societe($this->db); // The thirdparty that we will delete @@ -5413,16 +5413,16 @@ class Societe extends CommonObject 'Account' => '/compta/bank/class/account.class.php', 'ConferenceOrBoothAttendee' => '/eventorganization/class/conferenceorboothattendee.class.php' ); - if ($this->db->DDLListTables($this->db->database_name, 'don')) { + if ($this->db->DDLListTables($conf->db->name, $this->db->prefix().'don')) { $objects['Don'] = '/don/class/don.class.php'; } - if ($this->db->DDLListTables($this->db->database_name, 'partnership')) { + if ($this->db->DDLListTables($conf->db->name, $this->db->prefix().'partnership')) { $objects['PartnerShip'] = '/partnership/class/partnership.class.php'; } - if ($this->db->DDLListTables($this->db->database_name, 'fichinter')) { + if ($this->db->DDLListTables($conf->db->name, $this->db->prefix().'fichinter')) { $objects['Fichinter'] = '/fichinter/class/fichinter.class.php'; } - if ($this->db->DDLListTables($this->db->database_name, 'ticket')) { + if ($this->db->DDLListTables($conf->db->name, $this->db->prefix().'ticket')) { $objects['Ticket'] = '/ticket/class/ticket.class.php'; }