Skip to content
Snippets Groups Projects
Commit 0523f226 authored by Phf's avatar Phf
Browse files

FIX : when mailing is deleted, the targets list was kept in database

parent 97530977
No related branches found
No related tags found
No related merge requests found
......@@ -421,7 +421,7 @@ class Mailing extends CommonObject
$resql=$this->db->query($sql);
if ($resql)
{
return 1;
return $this->delete_targets();
}
else
{
......@@ -429,6 +429,29 @@ class Mailing extends CommonObject
return -1;
}
}
/**
* Delete targets emailing
*
* @return int 1 if OK, 0 if error
*/
function delete_targets()
{
$sql = "DELETE FROM ".MAIN_DB_PREFIX."mailing_cibles";
$sql.= " WHERE fk_mailing = ".$this->id;
dol_syslog("Mailing::delete_targets", LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
{
return 1;
}
else
{
$this->error=$this->db->lasterror();
return 0;
}
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment