Clean code

This commit is contained in:
Laurent Destailleur 2019-09-09 13:31:14 +02:00
parent 6b355997da
commit 28ba5abb89
2 changed files with 19 additions and 19 deletions

View File

@ -335,15 +335,15 @@ class Mailing extends CommonObject
$target_array=array(); $target_array=array();
$sql = "SELECT fk_contact, "; $sql = "SELECT fk_contact,";
$sql.=" lastname, "; $sql.= " lastname,";
$sql.=" firstname,"; $sql.= " firstname,";
$sql.=" email,"; $sql.= " email,";
$sql.=" other,"; $sql.= " other,";
$sql.=" source_url,"; $sql.= " source_url,";
$sql.=" source_id ,"; $sql.= " source_id ,";
$sql.=" source_type "; $sql.= " source_type";
$sql.= " FROM ".MAIN_DB_PREFIX."mailing_cibles "; $sql.= " FROM ".MAIN_DB_PREFIX."mailing_cibles";
$sql.= " WHERE fk_mailing = ".$fromid; $sql.= " WHERE fk_mailing = ".$fromid;
$result=$this->db->query($sql); $result=$this->db->query($sql);
@ -353,14 +353,16 @@ class Mailing extends CommonObject
{ {
while ($obj = $this->db->fetch_object($result)) { while ($obj = $this->db->fetch_object($result)) {
$target_array[]=array('fk_contact'=>$obj->fk_contact, $target_array[]=array(
'lastname'=>$obj->lastname, 'fk_contact'=>$obj->fk_contact,
'firstname'=>$obj->firstname, 'lastname'=>$obj->lastname,
'email'=>$obj->email, 'firstname'=>$obj->firstname,
'other'=>$obj->other, 'email'=>$obj->email,
'source_url'=>$obj->source_url, 'other'=>$obj->other,
'source_id'=>$obj->source_id, 'source_url'=>$obj->source_url,
'source_type'=>$obj->source_type); 'source_id'=>$obj->source_id,
'source_type'=>$obj->source_type
);
} }
} }
} }

View File

@ -88,7 +88,6 @@ class mailing_advthirdparties extends MailingTargets
dol_syslog(get_class($this)."::add_to_target mailing ".$num." targets found", LOG_DEBUG); dol_syslog(get_class($this)."::add_to_target mailing ".$num." targets found", LOG_DEBUG);
$old = '';
while ($i < $num) while ($i < $num)
{ {
$obj = $this->db->fetch_object($result); $obj = $this->db->fetch_object($result);
@ -144,7 +143,6 @@ class mailing_advthirdparties extends MailingTargets
dol_syslog(get_class($this)."::add_to_target mailing ".$num." targets found"); dol_syslog(get_class($this)."::add_to_target mailing ".$num." targets found");
$old = '';
while ($i < $num) while ($i < $num)
{ {
$obj = $this->db->fetch_object($result); $obj = $this->db->fetch_object($result);