From 203cbd56c2817cd34ffa39087b77ebae7a30a919 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 10 Apr 2019 17:35:33 +0200 Subject: [PATCH] Finished debug of emailcollector module --- htdocs/admin/emailcollector_card.php | 4 ++-- .../class/emailcollector.class.php | 18 +++++++++++------- htdocs/langs/en_US/admin.lang | 4 ++-- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/htdocs/admin/emailcollector_card.php b/htdocs/admin/emailcollector_card.php index cbf544bcad3..b098f090fa5 100644 --- a/htdocs/admin/emailcollector_card.php +++ b/htdocs/admin/emailcollector_card.php @@ -520,8 +520,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''; print ''; $arrayoftypes=array( - 'loadthirdparty'=>'LoadThirdPartyFromName', - 'loadandcreatethirdparty'=>'LoadThirdPartyFromNameOrCreate', + 'loadthirdparty'=>$langs->trans('LoadThirdPartyFromName', $langs->transnoentities("ThirdPartyName")), + 'loadandcreatethirdparty'=>$langs->trans('LoadThirdPartyFromNameOrCreate', $langs->transnoentities("ThirdPartyName")), 'recordevent'=>'RecordEvent'); if ($conf->projet->enabled) $arrayoftypes['project']='CreateLeadAndThirdParty'; if ($conf->ticket->enabled) $arrayoftypes['ticket']='CreateTicketAndThirdParty'; diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index 3e2e2126ff2..d89f0bc2bbd 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -1380,7 +1380,15 @@ class EmailCollector extends CommonObject } 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."); @@ -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 { - if (is_numeric($projecttocreate->ref) && $projecttocreate->ref <= 0) + if (empty($projecttocreate->ref) || (is_numeric($projecttocreate->ref) && $projecttocreate->ref <= 0)) { $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 { diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index d2042494191..9f8162deb8f 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1842,8 +1842,8 @@ CreateLeadAndThirdParty=Create lead (and third party if necessary) CreateTicketAndThirdParty=Create ticket (and third party if necessary) CodeLastResult=Latest result code NbOfEmailsInInbox=Number of emails in source directory -LoadThirdPartyFromName=Load third party from name (load only) -LoadThirdPartyFromNameOrCreate=Load third party from name (create if not found) +LoadThirdPartyFromName=Load third party searching on %s (load only) +LoadThirdPartyFromNameOrCreate=Load third party searching on %s (create if not found) WithDolTrackingID=Dolibarr Tracking ID found WithoutDolTrackingID=Dolibarr Tracking ID not found FormatZip=Zip