diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index 31209e2692b..87fa039725e 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -1406,14 +1406,14 @@ class EmailCollector extends CommonObject } } - if (empty($targetdir)) { // Use last date as filter if there is no targetdir defined. + if (empty($targetdir) || !getDolGlobalString('EMAILCOLLECTOR_NO_FILTER_ON_DATE_IF_THERE_IS_A_TARGETDIR')) { // Use last date as filter if there is no targetdir defined. $fromdate = 0; if ($this->datelastok) { $fromdate = $this->datelastok; } if ($fromdate > 0) { // $search .= ($search ? ' ' : '').'SINCE '.date('j-M-Y', $fromdate - 1); // SENTSINCE not supported. Date must be X-Abc-9999 (X on 1 digit if < 10) - array_push($criteria, array("SINCE" => date('j-M-Y', $fromdate - 1))); + array_push($criteria, array("SINCE" => date('j-M-Y', $fromdate - 1))); // -1 is to add a security to no forgot some email } //$search.=($search?' ':'').'SINCE 8-Apr-2022'; } diff --git a/htdocs/langs/en_US/mails.lang b/htdocs/langs/en_US/mails.lang index 3570e6a36c4..55fcf6d0bfe 100644 --- a/htdocs/langs/en_US/mails.lang +++ b/htdocs/langs/en_US/mails.lang @@ -190,7 +190,7 @@ NoMoreRecipientToSendTo=No more recipient to send the email to EmailOptedOut=Email owner has requested to not contact him with this email anymore EvenUnsubscribe=Include opt-out emails EvenUnsubscribeDesc=Include opt-out emails when you select emails as targets. Useful for mandatory service emails for example. -XEmailsDoneYActionsDone=%s emails pre-qualified, %s emails successfully processed (for %s record/actions done) +XEmailsDoneYActionsDone=%s emails pre-qualified, %s emails successfully processed (for %s operations done) YouCanMakeSomeInstructionForEmail=You can make some instructions for your Email (Example: generate image in email template...) ModelTemplate=Email template YouCanChooseAModelForYouMailContent= You can choose one of template models or generate one with AI diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index 89ddb7179c7..a6121973fe0 100644 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -897,15 +897,25 @@ if ($action == 'create' || $action == 'presend') { $createdbyshown++; } + $createdfrompublicticket = 0; + $createdfromemailcollector = 0; + if (!empty($object->origin_email) && (empty($object->email_msgid) || preg_match('/dolibarr\-tic\d+/', $object->email_msgid))) { + // If ticket create from public interface - TODO Add a more robust test to know if created by public interface + $createdfrompublicticket = 1; + } elseif (!empty($object->email_msgid)) { + // If ticket create by emailcollector - TODO Add a more robust test to know if created by email collector (using import ky ?) + $createdfromemailcollector = 1; + } + //var_dump($object); - if (!empty($object->origin_email)) { // If ticket create from public interface - TODO Add a more robust test to know if created by pubic interface + if ($createdfrompublicticket) { $htmltooptip = $langs->trans("OriginEmail").': '.$object->origin_email; $htmltooptip .= '
'.$langs->trans("IP").': '.$object->ip; $morehtmlref .= ($createdbyshown ? ' - ' : '
'); $morehtmlref .= ($createdbyshown ? '' : $langs->trans("CreatedBy").' : '); $morehtmlref .= img_picto('', 'email', 'class="paddingrightonly"'); $morehtmlref .= dol_escape_htmltag($object->origin_email).' - '.$form->textwithpicto($langs->trans("CreatedByPublicPortal"), $htmltooptip, 1, 'help', '', 0, 3, 'tooltip').''; - } elseif (!empty($object->email_msgid)) { // If ticket create by emailcollector - TODO Add a more robust test to know if created by email collector (using import ky ?) + } elseif ($createdfromemailcollector) { $langs->load("mails"); $htmltooltip = $langs->trans("EmailMsgID").': '.$object->email_msgid; $htmltooltip .= '
'.$langs->trans("EmailDate").': '.dol_print_date($object->email_date, 'dayhour');