Add a common function to delete the linked contact
This commit is contained in:
parent
be94ad3d07
commit
b1cf164eb9
@ -517,8 +517,23 @@ class Fichinter extends CommonObject
|
|||||||
function delete($user)
|
function delete($user)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
|
$error=0;
|
||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
|
if (! $error)
|
||||||
|
{
|
||||||
|
// Delete linked contacts
|
||||||
|
$res = $this->delete_linked_contact();
|
||||||
|
if ($res < 0)
|
||||||
|
{
|
||||||
|
$this->error='ErrorFailToDeleteLinkedContact';
|
||||||
|
//$error++;
|
||||||
|
$this->db->rollback();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."fichinterdet";
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."fichinterdet";
|
||||||
$sql.= " WHERE fk_fichinter = ".$this->id;
|
$sql.= " WHERE fk_fichinter = ".$this->id;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user