From 166082d3cb1b0fb43ff0b8ef762e00a5c6d7c75a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 3 Jun 2022 12:53:55 +0200 Subject: [PATCH] Debug v16 --- htdocs/admin/emailcollector_card.php | 52 +++---------------- htdocs/admin/emailcollector_list.php | 2 +- .../core/modules/modEmailCollector.class.php | 13 +++++ htdocs/langs/en_US/admin.lang | 3 +- htdocs/langs/en_US/products.lang | 2 +- 5 files changed, 23 insertions(+), 49 deletions(-) diff --git a/htdocs/admin/emailcollector_card.php b/htdocs/admin/emailcollector_card.php index 50e3faa7d51..4f3cf10e77b 100644 --- a/htdocs/admin/emailcollector_card.php +++ b/htdocs/admin/emailcollector_card.php @@ -360,47 +360,6 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $linkback = ''.$langs->trans("BackToList").''; $morehtmlref = '
'; - /* - // Ref bis - $morehtmlref.=$form->editfieldkey("RefBis", 'ref_client', $object->ref_client, $object, $user->rights->emailcollector->creer, 'string', '', 0, 1); - $morehtmlref.=$form->editfieldval("RefBis", 'ref_client', $object->ref_client, $object, $user->rights->emailcollector->creer, 'string', '', null, null, '', 1); - // Thirdparty - $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1); - // Project - if (! empty($conf->projet->enabled)) - { - $langs->load("projects"); - $morehtmlref.='
'.$langs->trans('Project') . ' '; - if ($user->rights->emailcollector->creer) - { - if ($action != 'classify') - { - $morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : '; - if ($action == 'classify') { - //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); - $morehtmlref.='
'; - $morehtmlref.=''; - $morehtmlref.=''; - $morehtmlref.=$formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); - $morehtmlref.=''; - $morehtmlref.='
'; - } else { - $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1); - } - } - } else { - if (! empty($object->fk_project)) { - $proj = new Project($db); - $proj->fetch($object->fk_project); - $morehtmlref.=''; - $morehtmlref.=$proj->ref; - $morehtmlref.=''; - } else { - $morehtmlref.=''; - } - } - } - */ $morehtmlref .= '
'; $morehtml = $langs->trans("NbOfEmailsInInbox").' : '; @@ -562,7 +521,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $rulefilterobj->fetch($rulefilter['id']); print ''; - print ''; + print ''; print $langs->trans($arrayoftypes[$rulefilter['type']]['label']); print ''; print ''.$rulefilter['rulevalue'].''; @@ -584,9 +543,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''; print ''.img_picto('', 'technic', 'class="pictofixedwidth"').$form->textwithpicto($langs->trans("EmailcollectorOperations"), $langs->trans("EmailcollectorOperationsDesc")).''; print ''; - // Add operation - print ''; - print ''; + $arrayoftypes = array( 'loadthirdparty'=>$langs->trans('LoadThirdPartyFromName', $langs->transnoentities("ThirdPartyName")), 'loadandcreatethirdparty'=>$langs->trans('LoadThirdPartyFromNameOrCreate', $langs->transnoentities("ThirdPartyName")), @@ -618,6 +575,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } } + // Add operation + print ''; + print ''; print $form->selectarray('operationtype', $arrayoftypes, '', 1, 0, 0, '', 1, 0, 0, '', 'maxwidth300', 1); print ''; print ''; @@ -638,7 +598,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $ruleactionobj->fetch($ruleaction['id']); print ''; - print ''; + print ''; print ''; if (array_key_exists($ruleaction['type'], $arrayoftypes)) { print $langs->trans($arrayoftypes[$ruleaction['type']]); diff --git a/htdocs/admin/emailcollector_list.php b/htdocs/admin/emailcollector_list.php index 35c483f33e6..f1cf4ca6385 100644 --- a/htdocs/admin/emailcollector_list.php +++ b/htdocs/admin/emailcollector_list.php @@ -205,7 +205,7 @@ $form = new Form($db); $now = dol_now(); $help_url = "EN:Module_EMail_Collector|FR:Module_Collecteur_de_courrier_électronique|ES:Module_EMail_Collector"; -$title = $langs->trans('ListOf', $langs->transnoentitiesnoconv("EmailCollector")); +$title = $langs->trans('EmailCollectors'); $morejs = array(); $morecss = array(); diff --git a/htdocs/core/modules/modEmailCollector.class.php b/htdocs/core/modules/modEmailCollector.class.php index 9261a354a97..145dd966044 100644 --- a/htdocs/core/modules/modEmailCollector.class.php +++ b/htdocs/core/modules/modEmailCollector.class.php @@ -168,6 +168,19 @@ class modEmailCollector extends DolibarrModules // Main menu entries $this->menu = array(); // List of menus to add + + $r = 0; + $this->menu[$r] = array('fk_menu'=>'fk_mainmenu=home,fk_leftmenu=admintools', // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode + 'type'=>'left', // This is a Left menu entry + 'titre'=>'EmailCollectors', + 'url'=>'/admin/emailcollector_list.php?leftmenu=admintools', + 'langs'=>'admin', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. + 'position'=>201, + 'enabled'=>'$conf->emailcollector->enabled && preg_match(\'/^(admintools|all)/\', $leftmenu)', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. + 'perms'=>'$user->admin', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules + 'target'=>'', + 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both + $r++; } /** diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index e69fee8738a..14e7649fec2 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -2059,6 +2059,7 @@ VATIsUsedIsOff=Note: The option to use Sales Tax or VAT has been set to SwapSenderAndRecipientOnPDF=Swap sender and recipient address position on PDF documents FeatureSupportedOnTextFieldsOnly=Warning, feature supported on text fields and combo lists only. Also an URL parameter action=create or action=edit must be set OR page name must end with 'new.php' to trigger this feature. EmailCollector=Email collector +EmailCollectors=Emails collectors EmailCollectorDescription=Add a scheduled job and a setup page to scan regularly email boxes (using IMAP protocol) and record emails received into your application, at the right place and/or create some records automatically (like leads). NewEmailCollector=New Email Collector EMailHost=Host of email IMAP server @@ -2073,7 +2074,7 @@ DateLastCollectResult=Date of latest collect try DateLastcollectResultOk=Date of latest collect success LastResult=Latest result EmailCollectorHideMailHeaders=Do not include the content of email header into the saved content of collected e-mails -EmailCollectorHideMailHeadersHelp=When enabled, e-mail headers are not added at the end of the email content that is saved as events. +EmailCollectorHideMailHeadersHelp=When enabled, e-mail headers are not added at the end of the email content that is saved as an agenda event. EmailCollectorConfirmCollectTitle=Email collect confirmation EmailCollectorConfirmCollect=Do you want to run this collector now? EmailCollectorExampleToCollectTicketRequestsDesc=Collect emails that match some rules and create automatically a ticket (Module Ticket must be enabled) with the email informations. You can use this collector if you provide some support by email, so your ticket request will be automatically generated. Activate also Collect_Responses to collect answers of your client directly on the ticket view (you must reply from Dolibarr). diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index 4b38515924b..94d77315217 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -262,7 +262,7 @@ Quarter1=1st. Quarter Quarter2=2nd. Quarter Quarter3=3rd. Quarter Quarter4=4th. Quarter -BarCodePrintsheet=Print barcode +BarCodePrintsheet=Print barcodes PageToGenerateBarCodeSheets=With this tool, you can print sheets of barcode stickers. Choose format of your sticker page, type of barcode and value of barcode, then click on button %s. NumberOfStickers=Number of stickers to print on page PrintsheetForOneBarCode=Print several stickers for one barcode