NEW Global option do diable email is on each email setup page

This commit is contained in:
Laurent Destailleur 2026-01-13 16:10:34 +01:00
parent 72b746ddd3
commit 750e1ccc90
4 changed files with 48 additions and 7 deletions

View file

@ -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"));

View file

@ -570,7 +570,21 @@ if ($action == 'edit') {
print dol_get_fiche_head($head, 'common_emailing', '', -1);
print '<span class="opacitymedium">'.$langs->trans("EMailsDesc")."</span><br>\n";
print "<br><br>\n";
print "<br>\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').'</a>';
} else {
print yn(getDolGlobalString('MAIN_DISABLE_ALL_MAILS'));
if (getDolGlobalString('MAIN_DISABLE_ALL_MAILS')) {
print img_warning($langs->trans("Disabled"));
}
}
print "<br>\n";
print "<br>\n";
print "<br>\n";
print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
print '<table class="noborder centpercent">';

View file

@ -589,7 +589,21 @@ if ($action == 'edit') {
print dol_get_fiche_head($head, 'common_passwordreset', '', -1);
print '<span class="opacitymedium">'.$langs->trans("EMailsDesc")."</span><br>\n";
print "<br><br>\n";
print "<br>\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').'</a>';
} else {
print yn(getDolGlobalString('MAIN_DISABLE_ALL_MAILS'));
if (getDolGlobalString('MAIN_DISABLE_ALL_MAILS')) {
print img_warning($langs->trans("Disabled"));
}
}
print "<br>\n";
print "<br>\n";
print "<br>\n";
print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
print '<table class="noborder centpercent">';

View file

@ -564,7 +564,21 @@ if ($action == 'edit') {
print dol_get_fiche_head($head, 'common_ticket', '', -1);
print '<span class="opacitymedium">'.$langs->trans("EMailsDesc")."</span><br>\n";
print "<br><br>\n";
print "<br>\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').'</a>';
} else {
print yn(getDolGlobalString('MAIN_DISABLE_ALL_MAILS'));
if (getDolGlobalString('MAIN_DISABLE_ALL_MAILS')) {
print img_warning($langs->trans("Disabled"));
}
}
print "<br>\n";
print "<br>\n";
print "<br>\n";
print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
print '<table class="noborder centpercent">';