Finished debug of emailcollector module

This commit is contained in:
Laurent Destailleur 2019-04-10 17:35:33 +02:00
parent 621709ed42
commit 203cbd56c2
3 changed files with 15 additions and 11 deletions

View File

@ -520,8 +520,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'; print '<td>';
$arrayoftypes=array( $arrayoftypes=array(
'loadthirdparty'=>'LoadThirdPartyFromName', 'loadthirdparty'=>$langs->trans('LoadThirdPartyFromName', $langs->transnoentities("ThirdPartyName")),
'loadandcreatethirdparty'=>'LoadThirdPartyFromNameOrCreate', 'loadandcreatethirdparty'=>$langs->trans('LoadThirdPartyFromNameOrCreate', $langs->transnoentities("ThirdPartyName")),
'recordevent'=>'RecordEvent'); 'recordevent'=>'RecordEvent');
if ($conf->projet->enabled) $arrayoftypes['project']='CreateLeadAndThirdParty'; if ($conf->projet->enabled) $arrayoftypes['project']='CreateLeadAndThirdParty';
if ($conf->ticket->enabled) $arrayoftypes['ticket']='CreateTicketAndThirdParty'; if ($conf->ticket->enabled) $arrayoftypes['ticket']='CreateTicketAndThirdParty';

View File

@ -1380,7 +1380,15 @@ class EmailCollector extends CommonObject
} }
elseif ($result == 0) elseif ($result == 0)
{ {
if ($operation['type'] == 'loadandcreatethirdparty') if ($operation['type'] == 'loadthirdparty')
{
dol_syslog("Third party with name ".$nametouseforthirdparty." was not found");
$errorforactions++;
$this->error = 'ErrorFailedToLoadThirdParty';
$this->errors[] = 'ErrorFailedToLoadThirdParty';
}
elseif ($operation['type'] == 'loadandcreatethirdparty')
{ {
dol_syslog("Third party with name ".$nametouseforthirdparty." was not found. We try to create it."); dol_syslog("Third party with name ".$nametouseforthirdparty." was not found. We try to create it.");
@ -1407,10 +1415,6 @@ class EmailCollector extends CommonObject
} }
} }
} }
else
{
dol_syslog("Third party with name ".$nametouseforthirdparty." was not found");
}
} }
} }
} }
@ -1565,10 +1569,10 @@ class EmailCollector extends CommonObject
} }
else else
{ {
if (is_numeric($projecttocreate->ref) && $projecttocreate->ref <= 0) if (empty($projecttocreate->ref) || (is_numeric($projecttocreate->ref) && $projecttocreate->ref <= 0))
{ {
$errorforactions++; $errorforactions++;
$this->error = 'Failed to create project: Can\'t get a valid value for project Ref'; $this->error = 'Failed to create project: Can\'t get a valid value for project Ref with numbering template '.$modele;
} }
else else
{ {

View File

@ -1842,8 +1842,8 @@ CreateLeadAndThirdParty=Create lead (and third party if necessary)
CreateTicketAndThirdParty=Create ticket (and third party if necessary) CreateTicketAndThirdParty=Create ticket (and third party if necessary)
CodeLastResult=Latest result code CodeLastResult=Latest result code
NbOfEmailsInInbox=Number of emails in source directory NbOfEmailsInInbox=Number of emails in source directory
LoadThirdPartyFromName=Load third party from name (load only) LoadThirdPartyFromName=Load third party searching on %s (load only)
LoadThirdPartyFromNameOrCreate=Load third party from name (create if not found) LoadThirdPartyFromNameOrCreate=Load third party searching on %s (create if not found)
WithDolTrackingID=Dolibarr Tracking ID found WithDolTrackingID=Dolibarr Tracking ID found
WithoutDolTrackingID=Dolibarr Tracking ID not found WithoutDolTrackingID=Dolibarr Tracking ID not found
FormatZip=Zip FormatZip=Zip