FIX : when mailing is deleted, the targets list was kept in database
This commit is contained in:
parent
9753097731
commit
0523f226cf
@ -421,7 +421,7 @@ class Mailing extends CommonObject
|
|||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
return 1;
|
return $this->delete_targets();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -430,6 +430,29 @@ class Mailing extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Change status of each recipient
|
* Change status of each recipient
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user