From 71045cbe8337634804955fa4486429576139e9e9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 Jul 2022 14:00:19 +0200 Subject: [PATCH] Fix popup message --- htdocs/admin/mails_emailing.php | 8 ++++++-- htdocs/admin/mails_ticket.php | 8 ++++++-- htdocs/comm/mailing/card.php | 8 +++++++- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/htdocs/admin/mails_emailing.php b/htdocs/admin/mails_emailing.php index 40af4c4ae2a..79ddda792e0 100644 --- a/htdocs/admin/mails_emailing.php +++ b/htdocs/admin/mails_emailing.php @@ -427,11 +427,15 @@ if ($action == 'edit') { // Method print ''.$langs->trans("MAIN_MAIL_SENDMODE").''; - $text = $listofmethods[$conf->global->MAIN_MAIL_SENDMODE_EMAILING]; + $text = $listofmethods[getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING')]; if (empty($text)) { $text = $langs->trans("Undefined").img_warning(); } - print $text; + if (getDolGlobalString('MAIN_MAIL_SENDMODE_EMAILING') == 'default') { + print ''.$text.''; + } else { + print $text; + } print ''; if (!empty($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && $conf->global->MAIN_MAIL_SENDMODE_EMAILING != 'default') { diff --git a/htdocs/admin/mails_ticket.php b/htdocs/admin/mails_ticket.php index 481fcad212c..a439bdabcf0 100644 --- a/htdocs/admin/mails_ticket.php +++ b/htdocs/admin/mails_ticket.php @@ -394,11 +394,15 @@ if ($action == 'edit') { // Method print ''.$langs->trans("MAIN_MAIL_SENDMODE").''; - $text = $listofmethods[$conf->global->MAIN_MAIL_SENDMODE_TICKET]; + $text = $listofmethods[getDolGlobalString('MAIN_MAIL_SENDMODE_TICKET')]; if (empty($text)) { $text = $langs->trans("Undefined").img_warning(); } - print $text; + if (getDolGlobalString('MAIN_MAIL_SENDMODE_TICKET') == 'default') { + print ''.$text.''; + } else { + print $text; + } print ''; if (!empty($conf->global->MAIN_MAIL_SENDMODE_TICKET) && $conf->global->MAIN_MAIL_SENDMODE_TICKET != 'default') { diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index 290a29c02ee..748c5fabf10 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -808,7 +808,13 @@ if ($action == 'create') { $linktoadminemailbefore = ''; $linktoadminemailend = ''; setEventMessages($langs->trans("MailSendSetupIs", $listofmethods[$sendingmode]), null, 'warnings'); - setEventMessages($langs->trans("MailSendSetupIs2", $linktoadminemailbefore, $linktoadminemailend, $langs->transnoentitiesnoconv("MAIN_MAIL_SENDMODE"), $listofmethods['smtps']), null, 'warnings'); + $messagetoshow = $langs->trans("MailSendSetupIs2", '{s1}', '{s2}', '{s3}', '{s4}'); + $messagetoshow = str_replace('{s1}', $linktoadminemailbefore, $messagetoshow); + $messagetoshow = str_replace('{s2}', $linktoadminemailend, $messagetoshow); + $messagetoshow = str_replace('{s3}', $langs->transnoentitiesnoconv("MAIN_MAIL_SENDMODE"), $messagetoshow); + $messagetoshow = str_replace('{s4}', $listofmethods['smtps'], $messagetoshow); + setEventMessages($messagetoshow, null, 'warnings'); + if (!empty($conf->global->MAILING_SMTP_SETUP_EMAILS_FOR_QUESTIONS)) { setEventMessages($langs->trans("MailSendSetupIs3", $conf->global->MAILING_SMTP_SETUP_EMAILS_FOR_QUESTIONS), null, 'warnings'); }