fix search socid
This commit is contained in:
parent
737407c953
commit
c34dbebcc5
1 changed files with 20 additions and 4 deletions
|
|
@ -2357,10 +2357,26 @@ class EmailCollector extends CommonObject
|
|||
if ($operation['type'] == 'loadthirdparty') {
|
||||
dol_syslog("Third party with id=".$idtouseforthirdparty." email=".$emailtouseforthirdparty." name=".$nametouseforthirdparty." name_alias=".$namealiastouseforthirdparty." was not found");
|
||||
|
||||
$errorforactions++;
|
||||
$langs->load("errors");
|
||||
$this->error = $langs->trans('ErrorFailedToLoadThirdParty', $idtouseforthirdparty, $emailtouseforthirdparty, $nametouseforthirdparty, $namealiastouseforthirdparty);
|
||||
$this->errors[] = $this->error;
|
||||
//TODO search into contacts of thirdparty
|
||||
$resultContact = $contactstatic->fetch('','','',$emailtouseforthirdparty);
|
||||
if($resultContact > 0) {
|
||||
$idtouseforthirdparty = $contactstatic->socid;
|
||||
$result = $thirdpartystatic->fetch($idtouseforthirdparty);
|
||||
if($result > 0) {
|
||||
dol_syslog("Third party with id=".$idtouseforthirdparty." email=".$emailtouseforthirdparty." name=".$nametouseforthirdparty." name_alias=".$namealiastouseforthirdparty." was found thanks to linked contact search");
|
||||
} else {
|
||||
$errorforactions++;
|
||||
$langs->load("errors");
|
||||
$this->error = $langs->trans('ErrorFailedToLoadThirdParty', $idtouseforthirdparty, $emailtouseforthirdparty, $nametouseforthirdparty, $namealiastouseforthirdparty);
|
||||
$this->errors[] = $this->error;
|
||||
}
|
||||
} else {
|
||||
$errorforactions++;
|
||||
$langs->load("errors");
|
||||
$this->error = $langs->trans('ErrorFailedToLoadThirdParty', $idtouseforthirdparty, $emailtouseforthirdparty, $nametouseforthirdparty, $namealiastouseforthirdparty);
|
||||
$this->errors[] = $this->error;
|
||||
}
|
||||
|
||||
} elseif ($operation['type'] == 'loadandcreatethirdparty') {
|
||||
dol_syslog("Third party with id=".$idtouseforthirdparty." email=".$emailtouseforthirdparty." name=".$nametouseforthirdparty." name_alias=".$namealiastouseforthirdparty." was not found. We try to create it.");
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue