Add a common function to delete the linked contact

This commit is contained in:
Regis Houssin 2010-04-30 05:44:19 +00:00
parent be94ad3d07
commit b1cf164eb9

View File

@ -517,8 +517,23 @@ class Fichinter extends CommonObject
function delete($user)
{
global $conf;
$error=0;
$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.= " WHERE fk_fichinter = ".$this->id;