diff --git a/htdocs/admin/mails_emailing.php b/htdocs/admin/mails_emailing.php index 1f638be3286..062aac55962 100644 --- a/htdocs/admin/mails_emailing.php +++ b/htdocs/admin/mails_emailing.php @@ -59,6 +59,16 @@ $substitutionarrayfortest = array( ); complete_substitutions_array($substitutionarrayfortest, $langs); +// List of sending methods +$listofmethods = array(); +$listofmethods['default'] = $langs->trans('DefaultOutgoingEmailSetup'); +$listofmethods['mail'] = 'PHP mail function'; +//$listofmethods['simplemail']='Simplemail class'; +$listofmethods['smtps'] = 'SMTP/SMTPS socket library'; +if (version_compare(phpversion(), '7.0', '>=')) { + $listofmethods['swiftmailer'] = 'Swift Mailer socket library'; +} + // Security check if (!$user->admin) { accessforbidden(); @@ -147,16 +157,6 @@ print load_fiche_titre($langs->trans("EMailsSetup"), '', 'title_setup'); $head = email_admin_prepare_head(); -// List of sending methods -$listofmethods = array(); -$listofmethods['default'] = $langs->trans('DefaultOutgoingEmailSetup'); -$listofmethods['mail'] = 'PHP mail function'; -//$listofmethods['simplemail']='Simplemail class'; -$listofmethods['smtps'] = 'SMTP/SMTPS socket library'; -if (version_compare(phpversion(), '7.0', '>=')) { - $listofmethods['swiftmailer'] = 'Swift Mailer socket library'; -} - // List of oauth services $oauthservices = array(); diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index f77833c0e37..2584f9c591c 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -77,8 +77,13 @@ $object->substitutionarrayfortest = $substitutionarray; // List of sending methods $listofmethods = array(); +//$listofmethods['default'] = $langs->trans('DefaultOutgoingEmailSetup'); $listofmethods['mail'] = 'PHP mail function'; +//$listofmethods['simplemail']='Simplemail class'; $listofmethods['smtps'] = 'SMTP/SMTPS socket library'; +if (version_compare(phpversion(), '7.0', '>=')) { + $listofmethods['swiftmailer'] = 'Swift Mailer socket library'; +} // Security check if (empty($user->rights->mailing->lire) || (empty($conf->global->EXTERNAL_USERS_ARE_AUTHORIZED) && $user->socid > 0)) { @@ -1005,6 +1010,26 @@ if ($action == 'create') { } print ''; + print ''; + print $langs->trans("MAIN_MAIL_SENDMODE"); + print ''; + if (getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING') && getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING') != 'default') { + $text = $listofmethods[getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING')]; + } elseif (getDolGlobalString('MAIN_MAIL_SENDMODE')) { + $text = $listofmethods[getDolGlobalString('MAIN_MAIL_SENDMODE')]; + } else { + $text = $listofmethods['mail']; + } + print $text; + if (getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING') != 'default') { + if (getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING') != 'mail') { + print ' ('.getDolGlobalString('MAIN_MAIL_SMTP_SERVER_EMAILING').')'; + } + } elseif (getDolGlobalString('MAIN_MAIL_SENDMODE') != 'mail' && getDolGlobalString('MAIN_MAIL_SMTP_SERVER')) { + print ' ('.getDolGlobalString('MAIN_MAIL_SMTP_SERVER').')'; + } + print ''; + // Other attributes. Fields from hook formObjectOptions and Extrafields. include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; @@ -1237,9 +1262,9 @@ if ($action == 'create') { */ // From - print ''.$langs->trans("MailFrom").''.dol_print_email($object->email_from, 0, 0, 0, 0, 1).''; + print ''.$langs->trans("MailFrom").''.dol_print_email($object->email_from, 0, 0, 0, 0, 1).''; // To - print ''.$langs->trans("MailErrorsTo").''.dol_print_email($object->email_errorsto, 0, 0, 0, 0, 1).''; + print ''.$langs->trans("MailErrorsTo").''.dol_print_email($object->email_errorsto, 0, 0, 0, 0, 1).''; print ''; print ''; @@ -1253,7 +1278,7 @@ if ($action == 'create') { // Number of distinct emails print ''; print $langs->trans("TotalNbOfDistinctRecipients"); - print ''; + print ''; $nbemail = ($object->nbemail ? $object->nbemail : 0); if (is_numeric($nbemail)) { $text = ''; @@ -1275,6 +1300,27 @@ if ($action == 'create') { } print ''; + print ''; + print $langs->trans("MAIN_MAIL_SENDMODE"); + print ''; + if (getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING') && getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING') != 'default') { + $text = $listofmethods[getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING')]; + } elseif (getDolGlobalString('MAIN_MAIL_SENDMODE')) { + $text = $listofmethods[getDolGlobalString('MAIN_MAIL_SENDMODE')]; + } else { + $text = $listofmethods['mail']; + } + print $text; + if (getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING') != 'default') { + if (getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING') != 'mail') { + print ' ('.getDolGlobalString('MAIN_MAIL_SMTP_SERVER_EMAILING').')'; + } + } elseif (getDolGlobalString('MAIN_MAIL_SENDMODE') != 'mail' && getDolGlobalString('MAIN_MAIL_SMTP_SERVER')) { + print ' ('.getDolGlobalString('MAIN_MAIL_SMTP_SERVER').')'; + } + print ''; + + // Other attributes $parameters = array(); $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index 16b73702be0..1ef954be276 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -73,14 +73,24 @@ $result = $object->fetch($id); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('ciblescard', 'globalcard')); +$sqlmessage = ''; + +// List of sending methods +$listofmethods = array(); +//$listofmethods['default'] = $langs->trans('DefaultOutgoingEmailSetup'); +$listofmethods['mail'] = 'PHP mail function'; +//$listofmethods['simplemail']='Simplemail class'; +$listofmethods['smtps'] = 'SMTP/SMTPS socket library'; +if (version_compare(phpversion(), '7.0', '>=')) { + $listofmethods['swiftmailer'] = 'Swift Mailer socket library'; +} + // Security check if (!$user->hasRight('mailing', 'lire') || (empty($conf->global->EXTERNAL_USERS_ARE_AUTHORIZED) && $user->socid > 0)) { accessforbidden(); } //$result = restrictedArea($user, 'mailing'); -$sqlmessage = ''; - /* * Actions @@ -354,6 +364,26 @@ if ($object->fetch($id) >= 0) { } print ''; + print ''; + print $langs->trans("MAIN_MAIL_SENDMODE"); + print ''; + if (getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING') && getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING') != 'default') { + $text = $listofmethods[getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING')]; + } elseif (getDolGlobalString('MAIN_MAIL_SENDMODE')) { + $text = $listofmethods[getDolGlobalString('MAIN_MAIL_SENDMODE')]; + } else { + $text = $listofmethods['mail']; + } + print $text; + if (getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING') != 'default') { + if (getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING') != 'mail') { + print ' ('.getDolGlobalString('MAIN_MAIL_SMTP_SERVER_EMAILING').')'; + } + } elseif (getDolGlobalString('MAIN_MAIL_SENDMODE') != 'mail' && getDolGlobalString('MAIN_MAIL_SMTP_SERVER')) { + print ' ('.getDolGlobalString('MAIN_MAIL_SMTP_SERVER').')'; + } + print ''; + // Other attributes. Fields from hook formObjectOptions and Extrafields. include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; diff --git a/htdocs/comm/mailing/class/mailing.class.php b/htdocs/comm/mailing/class/mailing.class.php index 451478e8058..4371848c522 100644 --- a/htdocs/comm/mailing/class/mailing.class.php +++ b/htdocs/comm/mailing/class/mailing.class.php @@ -195,7 +195,6 @@ class Mailing extends CommonObject */ public $substitutionarrayfortest; - const STATUS_DRAFT = 0; const STATUS_VALIDATED = 1; const STATUS_SENTPARTIALY = 2; @@ -209,6 +208,8 @@ class Mailing extends CommonObject */ public function __construct($db) { + global $langs; + $this->db = $db; // List of language codes for status diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index f1fcaee912c..5c24359c78b 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -80,6 +80,12 @@ class FactureRec extends CommonInvoice */ public $title; + /** + * @var string The label of recurring invoice + * @deprecated Use $title instead + */ + public $titre; + public $socid; public $number; public $date;