From 750e1ccc900c2373797fd0fc2ec0ef3b4dcb8929 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 13 Jan 2026 16:10:34 +0100 Subject: [PATCH] NEW Global option do diable email is on each email setup page --- htdocs/admin/mails.php | 7 +++---- htdocs/admin/mails_emailing.php | 16 +++++++++++++++- htdocs/admin/mails_passwordreset.php | 16 +++++++++++++++- htdocs/admin/mails_ticket.php | 16 +++++++++++++++- 4 files changed, 48 insertions(+), 7 deletions(-) diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index e0e67787509..98b69aaf4c5 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -28,10 +28,6 @@ // Load Dolibarr environment require '../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php'; - /** * @var Conf $conf * @var DoliDB $db @@ -40,6 +36,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php'; * @var Translate $langs * @var User $user */ +require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php'; // Load translation files required by the page $langs->loadLangs(array("companies", "products", "admin", "mails", "other", "errors")); diff --git a/htdocs/admin/mails_emailing.php b/htdocs/admin/mails_emailing.php index d24ba593a13..1bdd57acae6 100644 --- a/htdocs/admin/mails_emailing.php +++ b/htdocs/admin/mails_emailing.php @@ -570,7 +570,21 @@ if ($action == 'edit') { print dol_get_fiche_head($head, 'common_emailing', '', -1); print ''.$langs->trans("EMailsDesc")."
\n"; - print "

\n"; + print "
\n"; + + print $langs->trans("MAIN_DISABLE_ALL_MAILS"); + if (!empty($conf->use_javascript_ajax)) { + print ajax_constantonoff('MAIN_DISABLE_ALL_MAILS', array(), null, 0, 0, 1, 2, 0, 0, '_red').''; + } else { + print yn(getDolGlobalString('MAIN_DISABLE_ALL_MAILS')); + if (getDolGlobalString('MAIN_DISABLE_ALL_MAILS')) { + print img_warning($langs->trans("Disabled")); + } + } + + print "
\n"; + print "
\n"; + print "
\n"; print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table print ''; diff --git a/htdocs/admin/mails_passwordreset.php b/htdocs/admin/mails_passwordreset.php index d146f38a90d..a6681757971 100644 --- a/htdocs/admin/mails_passwordreset.php +++ b/htdocs/admin/mails_passwordreset.php @@ -589,7 +589,21 @@ if ($action == 'edit') { print dol_get_fiche_head($head, 'common_passwordreset', '', -1); print ''.$langs->trans("EMailsDesc")."
\n"; - print "

\n"; + print "
\n"; + + print $langs->trans("MAIN_DISABLE_ALL_MAILS"); + if (!empty($conf->use_javascript_ajax)) { + print ajax_constantonoff('MAIN_DISABLE_ALL_MAILS', array(), null, 0, 0, 1, 2, 0, 0, '_red').''; + } else { + print yn(getDolGlobalString('MAIN_DISABLE_ALL_MAILS')); + if (getDolGlobalString('MAIN_DISABLE_ALL_MAILS')) { + print img_warning($langs->trans("Disabled")); + } + } + + print "
\n"; + print "
\n"; + print "
\n"; print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table print '
'; diff --git a/htdocs/admin/mails_ticket.php b/htdocs/admin/mails_ticket.php index a8bb56a3ee8..d353151b42c 100644 --- a/htdocs/admin/mails_ticket.php +++ b/htdocs/admin/mails_ticket.php @@ -564,7 +564,21 @@ if ($action == 'edit') { print dol_get_fiche_head($head, 'common_ticket', '', -1); print ''.$langs->trans("EMailsDesc")."
\n"; - print "

\n"; + print "
\n"; + + print $langs->trans("MAIN_DISABLE_ALL_MAILS"); + if (!empty($conf->use_javascript_ajax)) { + print ajax_constantonoff('MAIN_DISABLE_ALL_MAILS', array(), null, 0, 0, 1, 2, 0, 0, '_red').''; + } else { + print yn(getDolGlobalString('MAIN_DISABLE_ALL_MAILS')); + if (getDolGlobalString('MAIN_DISABLE_ALL_MAILS')) { + print img_warning($langs->trans("Disabled")); + } + } + + print "
\n"; + print "
\n"; + print "
\n"; print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table print '
';