Clean code

This commit is contained in:
Laurent Destailleur 2018-11-19 15:14:46 +01:00
parent 0886928a64
commit 5f93315097
3 changed files with 10 additions and 6 deletions

View File

@ -1333,10 +1333,10 @@ class ActionComm extends CommonObject
$linkstart.=$linkclose.'>'; $linkstart.=$linkclose.'>';
$linkend='</a>'; $linkend='</a>';
if ($option == 'nolink') { if ($option == 'nolink') {
$linkstart = ''; $linkstart = '';
$linkend = ''; $linkend = '';
} }
//print 'rrr'.$this->libelle.'rrr'.$this->label.'rrr'.$withpicto; //print 'rrr'.$this->libelle.'rrr'.$this->label.'rrr'.$withpicto;
if ($withpicto == 2) if ($withpicto == 2)

View File

@ -769,7 +769,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->sendtoid=0; $object->sendtoid=0;
} }
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login; $object->actionmsg = $langs->transnoentities("Author").': '.$user->login."\n".$object->actionmsg;
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);

View File

@ -697,7 +697,7 @@ class EmailCollector extends CommonObject
$this->error.='EmailCollector ID '.$emailcollector->id.':'.$emailcollector->error.'<br>'; $this->error.='EmailCollector ID '.$emailcollector->id.':'.$emailcollector->error.'<br>';
if (! empty($emailcollector->errors)) $this->error.=join('<br>', $emailcollector->errors); if (! empty($emailcollector->errors)) $this->error.=join('<br>', $emailcollector->errors);
$this->output.='EmailCollector ID '.$emailcollector->id.': '.$emailcollector->output.'<br>'; $this->output.='EmailCollector ID '.$emailcollector->id.': '.$emailcollector->lastresult.'<br>';
} }
return $nberror; return $nberror;
@ -1286,6 +1286,8 @@ class EmailCollector extends CommonObject
// Create thirdparty // Create thirdparty
$thirdpartystatic->name = $nametouseforthirdparty; $thirdpartystatic->name = $nametouseforthirdparty;
if ($fromtext != $nametouseforthirdparty) $thirdpartystatic->name_alias = $fromtext;
$thirdpartystatic->email = $from;
// Overwrite values with values extracted from source email // Overwrite values with values extracted from source email
$errorforthisaction = $this->overwritePropertiesOfObject($thirdpartystatic, $operation['actionparam'], $messagetext, $subject); $errorforthisaction = $this->overwritePropertiesOfObject($thirdpartystatic, $operation['actionparam'], $messagetext, $subject);
@ -1389,6 +1391,7 @@ class EmailCollector extends CommonObject
$projecttocreate->title = $subject; $projecttocreate->title = $subject;
$projecttocreate->date_start = $now; $projecttocreate->date_start = $now;
$projecttocreate->date_end = '';
$projecttocreate->opp_status = $id_opp_status; $projecttocreate->opp_status = $id_opp_status;
$projecttocreate->opp_percent = $percent_opp_status; $projecttocreate->opp_percent = $percent_opp_status;
$projecttocreate->description = ($note_private?$note_private."\n":'').$messagetext; $projecttocreate->description = ($note_private?$note_private."\n":'').$messagetext;
@ -1516,6 +1519,7 @@ class EmailCollector extends CommonObject
$this->datelastresult = $now; $this->datelastresult = $now;
$this->lastresult = $output; $this->lastresult = $output;
if (! empty($this->errors)) $this->lastresult.= " - ".join(" - ", $this->errors); if (! empty($this->errors)) $this->lastresult.= " - ".join(" - ", $this->errors);
$this->codelastresult = ($error ? 'KO' : 'OK'); $this->codelastresult = ($error ? 'KO' : 'OK');
$this->update($user); $this->update($user);