diff --git a/htdocs/adherents/subscription/list.php b/htdocs/adherents/subscription/list.php index 9a2243f4fea..5060a0224b6 100644 --- a/htdocs/adherents/subscription/list.php +++ b/htdocs/adherents/subscription/list.php @@ -715,7 +715,7 @@ while ($i < $imaxinloop) { // Label if (!empty($arrayfields['t.libelle']['checked'])) { - print ''; + print ''; print dol_escape_htmltag(dolGetFirstLineOfText($obj->note_private)); print ''; if (!$i) { diff --git a/htdocs/admin/emailcollector_card.php b/htdocs/admin/emailcollector_card.php index 452ae74d614..d8a79164e6f 100644 --- a/htdocs/admin/emailcollector_card.php +++ b/htdocs/admin/emailcollector_card.php @@ -395,9 +395,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $connectstringtarget = ''; // Note: $object->host has been loaded by the fetch - $usessl = 1; - - $connectstringserver = $object->getConnectStringIMAP($usessl); + $connectstringserver = $object->getConnectStringIMAP(); if ($action == 'scan') { if (!empty($conf->global->MAIN_IMAP_USE_PHPIMAP)) { diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php index 1b40486adad..5ce093f7868 100644 --- a/htdocs/core/class/notify.class.php +++ b/htdocs/core/class/notify.class.php @@ -547,7 +547,7 @@ class Notify break; case 'ORDER_SUPPLIER_VALIDATE': $link = ''.$newref.''; - $dir_output = $conf->fournisseur->commande->dir_output; + $dir_output = $conf->fournisseur->commande->multidir_output[$object->entity]."/".get_exdir(0, 0, 0, 1, $object); $object_type = 'order_supplier'; $mesg = $outputlangs->transnoentitiesnoconv("Hello").",\n\n"; $mesg .= $outputlangs->transnoentitiesnoconv("EMailTextOrderValidatedBy", $link, $user->getFullName($outputlangs)); @@ -555,7 +555,7 @@ class Notify break; case 'ORDER_SUPPLIER_APPROVE': $link = ''.$newref.''; - $dir_output = $conf->fournisseur->commande->dir_output; + $dir_output = $conf->fournisseur->commande->multidir_output[$object->entity]."/".get_exdir(0, 0, 0, 1, $object); $object_type = 'order_supplier'; $mesg = $outputlangs->transnoentitiesnoconv("Hello").",\n\n"; $mesg .= $outputlangs->transnoentitiesnoconv("EMailTextOrderApprovedBy", $link, $user->getFullName($outputlangs)); @@ -563,7 +563,7 @@ class Notify break; case 'ORDER_SUPPLIER_REFUSE': $link = ''.$newref.''; - $dir_output = $conf->fournisseur->commande->dir_output; + $dir_output = $conf->fournisseur->commande->multidir_output[$object->entity]."/".get_exdir(0, 0, 0, 1, $object); $object_type = 'order_supplier'; $mesg = $outputlangs->transnoentitiesnoconv("Hello").",\n\n"; $mesg .= $outputlangs->transnoentitiesnoconv("EMailTextOrderRefusedBy", $link, $user->getFullName($outputlangs)); @@ -815,7 +815,7 @@ class Notify break; case 'ORDER_SUPPLIER_VALIDATE': $link = ''.$newref.''; - $dir_output = $conf->fournisseur->commande->dir_output; + $dir_output = $conf->fournisseur->commande->multidir_output[$object->entity]."/".get_exdir(0, 0, 0, 1, $object); $object_type = 'order_supplier'; $mesg = $langs->transnoentitiesnoconv("Hello").",\n\n"; $mesg .= $langs->transnoentitiesnoconv("EMailTextOrderValidatedBy", $link, $user->getFullName($langs)); @@ -823,7 +823,7 @@ class Notify break; case 'ORDER_SUPPLIER_APPROVE': $link = ''.$newref.''; - $dir_output = $conf->fournisseur->commande->dir_output; + $dir_output = $conf->fournisseur->commande->multidir_output[$object->entity]."/".get_exdir(0, 0, 0, 1, $object); $object_type = 'order_supplier'; $mesg = $langs->transnoentitiesnoconv("Hello").",\n\n"; $mesg .= $langs->transnoentitiesnoconv("EMailTextOrderApprovedBy", $link, $user->getFullName($langs)); @@ -831,7 +831,7 @@ class Notify break; case 'ORDER_SUPPLIER_APPROVE2': $link = ''.$newref.''; - $dir_output = $conf->fournisseur->commande->dir_output; + $dir_output = $conf->fournisseur->commande->multidir_output[$object->entity]."/".get_exdir(0, 0, 0, 1, $object); $object_type = 'order_supplier'; $mesg = $langs->transnoentitiesnoconv("Hello").",\n\n"; $mesg .= $langs->transnoentitiesnoconv("EMailTextOrderApprovedBy", $link, $user->getFullName($langs)); diff --git a/htdocs/core/tpl/list_print_total.tpl.php b/htdocs/core/tpl/list_print_total.tpl.php index d18349dd107..21f86a8f242 100644 --- a/htdocs/core/tpl/list_print_total.tpl.php +++ b/htdocs/core/tpl/list_print_total.tpl.php @@ -13,7 +13,7 @@ if (isset($totalarray['pos'])) { while ($i < $totalarray['nbfield']) { $i++; if (!empty($totalarray['pos'][$i])) { - switch ($totalarray['type'][$i]) { + switch ($totalarray['pos'][$i]) { case 'duration'; print ''; print (!empty($totalarray['val'][$totalarray['pos'][$i]]) ? convertSecondToTime($totalarray['val'][$totalarray['pos'][$i]], 'allhourmin') : 0); diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index 78e19dbca1c..4231cb45075 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -131,6 +131,8 @@ class EmailCollector extends CommonObject 'host' => array('type'=>'varchar(255)', 'label'=>'EMailHost', 'visible'=>1, 'enabled'=>1, 'position'=>90, 'notnull'=>1, 'searchall'=>1, 'comment'=>"IMAP server", 'help'=>'Example: imap.gmail.com', 'csslist'=>'tdoverflowmax125'), 'port' => array('type'=>'varchar(10)', 'label'=>'EMailHostPort', 'visible'=>1, 'enabled'=>1, 'position'=>91, 'notnull'=>1, 'searchall'=>0, 'comment'=>"IMAP server port", 'help'=>'Example: 993', 'csslist'=>'tdoverflowmax50', 'default'=>'993'), 'hostcharset' => array('type'=>'varchar(16)', 'label'=>'HostCharset', 'visible'=>-1, 'enabled'=>1, 'position'=>92, 'notnull'=>0, 'searchall'=>0, 'comment'=>"IMAP server charset", 'help'=>'Example: "UTF-8" (May be "US-ASCII" with some Office365)', 'default'=>'UTF-8'), + 'imap_encryption' => array('type'=>'varchar(16)', 'label'=>'ImapEncryption', 'visible'=>1, 'enabled'=>1, 'position'=>93, 'searchall'=>0, 'comment'=>"IMAP encryption", 'help'=>'ImapEncryptionHelp', 'arrayofkeyval'=> array('ssl'=>'SSL', 'tls' => 'TLS', 'notls' => 'NOTLS'), 'default'=>'ssl'), + 'norsh' => array('type'=>'integer', 'label'=>'NoRSH', 'visible'=>1, 'enabled'=>"!getDolGlobalInt('MAIN_IMAP_USE_PHPIMAP')", 'position'=>94, 'searchall'=>0, 'help'=>'NoRSHHelp', 'arrayofkeyval'=> array(0 =>'No', 1 => 'Yes'), 'default'=> 0), 'acces_type' => array('type'=>'integer', 'label'=>'accessType', 'visible'=>-1, 'enabled'=>"getDolGlobalInt('MAIN_IMAP_USE_PHPIMAP')", 'position'=>101, 'notnull'=>1, 'index'=>1, 'comment'=>"IMAP login type", 'arrayofkeyval'=>array('0'=>'loginPassword', '1'=>'oauthToken'), 'default'=>'0', 'help'=>''), 'login' => array('type'=>'varchar(128)', 'label'=>'Login', 'visible'=>-1, 'enabled'=>1, 'position'=>102, 'notnull'=>-1, 'index'=>1, 'comment'=>"IMAP login", 'help'=>'Example: myaccount@gmail.com'), 'password' => array('type'=>'password', 'label'=>'Password', 'visible'=>-1, 'enabled'=>"1", 'position'=>103, 'notnull'=>-1, 'comment'=>"IMAP password", 'help'=>'WithGMailYouCanCreateADedicatedPassword'), @@ -213,6 +215,8 @@ class EmailCollector extends CommonObject public $password; public $acces_type; public $oauth_service; + public $imap_encryption; + public $norsh; public $source_directory; public $target_directory; public $maxemailpercollect; @@ -775,11 +779,9 @@ class EmailCollector extends CommonObject /** * Return the connectstring to use with IMAP connection function * - * @param int $ssl Add /ssl tag - * @param int $norsh Add /norsh to connectstring * @return string */ - public function getConnectStringIMAP($ssl = 1, $norsh = 0) + public function getConnectStringIMAP() { global $conf; @@ -787,15 +789,16 @@ class EmailCollector extends CommonObject $flags = '/service=imap'; // IMAP if (!empty($conf->global->IMAP_FORCE_TLS)) { $flags .= '/tls'; - } elseif (empty($conf->global->IMAP_FORCE_NOSSL)) { - if ($ssl) { - $flags .= '/ssl'; - } + } elseif (empty($this->imap_encryption) || ($this->imap_encryption == 'ssl' && !empty($conf->global->IMAP_FORCE_NOSSL))) { + $flags .= ''; + } else { + $flags .= '/' . $this->imap_encryption; } + $flags .= '/novalidate-cert'; //$flags.='/readonly'; //$flags.='/debug'; - if ($norsh || !empty($conf->global->IMAP_FORCE_NORSH)) { + if (!empty($this->norsh) || !empty($conf->global->IMAP_FORCE_NORSH)) { $flags .= '/norsh'; } //Used in shared mailbox from Office365 @@ -1191,7 +1194,7 @@ class EmailCollector extends CommonObject $client = $cm->make([ 'host' => $this->host, 'port' => $this->port, - 'encryption' => 'ssl', + 'encryption' => !empty($this->imap_encryption) ? $this->imap_encryption : false, 'validate_cert' => true, 'protocol' => 'imap', 'username' => $this->login, @@ -1204,7 +1207,7 @@ class EmailCollector extends CommonObject $client = $cm->make([ 'host' => $this->host, 'port' => $this->port, - 'encryption' => 'ssl', + 'encryption' => !empty($this->imap_encryption) ? $this->imap_encryption : false, 'validate_cert' => true, 'protocol' => 'imap', 'username' => $this->login, diff --git a/htdocs/index.php b/htdocs/index.php index 8fe8ffa377e..361de385a20 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -130,7 +130,10 @@ if (empty($conf->global->MAIN_REMOVE_INSTALL_WARNING)) { //if (!empty($message)) $message.='
'; $message .= info_admin($langs->transnoentities("WarningConfFileMustBeReadOnly").' '.$langs->trans("WarningUntilDirRemoved", DOL_DOCUMENT_ROOT."/install"), 0, 0, '1', 'clearboth'); } - + $reshook = $hookmanager->executeHooks('infoadmin', $action); // Note that $action and $object may have been modified by some hooks + if ($reshook == 0) { + $message .= $hookmanager->resPrint; + } if ($message) { print $message.'
'; //$message.='
'; diff --git a/htdocs/install/mysql/migration/17.0.0-18.0.0.sql b/htdocs/install/mysql/migration/17.0.0-18.0.0.sql index 5d72775f1b2..f7a513f788a 100644 --- a/htdocs/install/mysql/migration/17.0.0-18.0.0.sql +++ b/htdocs/install/mysql/migration/17.0.0-18.0.0.sql @@ -428,3 +428,8 @@ ALTER TABLE llx_c_stcomm ADD COLUMN sortorder smallint DEFAULT 0; ALTER TABLE llx_element_time ADD COLUMN ref_ext varchar(32); ALTER TABLE llx_c_ziptown ADD COLUMN town_up varchar(180); + + +-- Email Collector +ALTER TABLE llx_emailcollector_emailcollector ADD COLUMN imap_encryption varchar(16) DEFAULT "ssl" AFTER hostcharset; +ALTER TABLE llx_emailcollector_emailcollector ADD COLUMN norsh integer DEFAULT 0 AFTER imap_encryption; diff --git a/htdocs/install/mysql/tables/llx_emailcollector_emailcollector.sql b/htdocs/install/mysql/tables/llx_emailcollector_emailcollector.sql index 4119e7aac08..080e9cd0533 100644 --- a/htdocs/install/mysql/tables/llx_emailcollector_emailcollector.sql +++ b/htdocs/install/mysql/tables/llx_emailcollector_emailcollector.sql @@ -24,6 +24,8 @@ CREATE TABLE llx_emailcollector_emailcollector( host varchar(255), port varchar(10) DEFAULT '993', hostcharset varchar(16) DEFAULT 'UTF-8', + imap_encryption varchar(16) DEFAULT 'ssl', + norsh integer DEFAULT 0, login varchar(128), acces_type integer DEFAULT 0, oauth_service varchar(128), diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 462b265f3d8..d0e48a2bff7 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -2113,6 +2113,10 @@ oauthToken=Oauth2 token accessType=Acces type oauthService=Oauth service TokenMustHaveBeenCreated=Module OAuth2 must be enabled and an oauth2 token must have been created with the correct permissions (for example scope "gmail_full" with OAuth for Gmail). +ImapEncryption = IMAP encryption method +ImapEncryptionHelp = Example: none, ssl, tls, notls +NoRSH = Use the NoRSH configuration +NoRSHHelp = Do not use RSH or SSH protocols to establish an IMAP pre-identification session MailboxSourceDirectory=Mailbox source directory MailboxTargetDirectory=Mailbox target directory EmailcollectorOperations=Operations to do by collector diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 73de22ef572..71b6bd5629b 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -900,7 +900,9 @@ if (empty($reshook)) { } } $sectionwithinvoicelink .= '
'; - if (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "takeposconnector") { + if (getDolGlobalInt('TAKEPOS_PRINT_INVOICE_DOC_INSTEAD_OF_RECEIPT')) { + $sectionwithinvoicelink .= ' Invoice'; + } elseif (getDolGlobalString('TAKEPOS_PRINT_METHOD') == "takeposconnector") { if (getDolGlobalString('TAKEPOS_PRINT_SERVER') && filter_var($conf->global->TAKEPOS_PRINT_SERVER, FILTER_VALIDATE_URL) == true) { $sectionwithinvoicelink .= ' '; } else { @@ -1688,6 +1690,9 @@ print ''; if (($action == "valid" || $action == "history") && $invoice->type != Facture::TYPE_CREDIT_NOTE && empty($conf->global->TAKEPOS_NO_CREDITNOTE)) { print ''; + if (getDolGlobalInt('TAKEPOS_PRINT_INVOICE_DOC_INSTEAD_OF_RECEIPT')) { + print ' Invoice'; + } }