Skip to content
Snippets Groups Projects
Commit b47e6e45 authored by Sergio Sanchis Climent's avatar Sergio Sanchis Climent
Browse files

FIX #5544 Disabled Contact still appear in lists to send emails

parent 0e79cae9
No related branches found
No related tags found
No related merge requests found
......@@ -1936,12 +1936,24 @@ class Societe extends CommonObject
{
global $langs;
$contact_emails = $this->contact_property_array('email');
$contact_emails = $this->contact_property_array('email',1);
if ($this->email && $addthirdparty)
{
if (empty($this->name)) $this->name=$this->nom;
// TODO: Tester si email non deja present dans tableau contact
$contact_emails['thirdparty']=$langs->trans("ThirdParty").': '.dol_trunc($this->name,16)." <".$this->email.">";
$exist = 0;
foreach($contact_emails as $contacts){
if($exist ===0){
$contacts = str_replace('>','',$contacts);
$contacts = explode ('<',$contacts);
if($contacts[1]===$this->email){
$exist = 1;
}
}
}
if($exist ===0){
if (empty($this->name)) $this->name=$this->nom;
$contact_emails['thirdparty']=$langs->trans("ThirdParty").': '.dol_trunc($this->name,16)." <".$this->email.">";
}
}
return $contact_emails;
}
......
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