This commit is contained in:
Anthony Berton 2021-04-29 00:03:16 +02:00
parent d3053c0c1b
commit c1e6109c4b
3 changed files with 35 additions and 20 deletions

View File

@ -204,16 +204,32 @@ print '</td>';
print '</tr>';
$arrayofnotifto = array(
'',
$langs->trans('notiftouser'),
$langs->trans('notiftofixedemail'),
$langs->trans('notiftouserandtofixedemail')
-1 => '',
1 => $langs->trans('notiftouser'),
2 => $langs->trans('notiftofixedemail'),
3 => $langs->trans('notiftouserandtofixedemail')
);
print '<tr class="oddeven"><td>';
print $langs->trans("NotificationDisableConfirmMessage").'</td>';
print $langs->trans("NotificationDisableConfirmMessageUser").'</td>';
print '<td>';
print $form->selectarray("notif_disable", $arrayofnotifto, $conf->global->NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE, 0, 0, 0, '', 1, 0, 0, '', 'maxwidth400', 1);
if ($conf->use_javascript_ajax) {
print ajax_constantonoff('NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_USER');
} else {
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
print $form->selectarray("NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_USER", $arrval, $conf->global->NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_USER);
}
print '</td>';
print '</tr>';
print '<tr class="oddeven"><td>';
print $langs->trans("NotificationDisableConfirmMessageFix").'</td>';
print '<td>';
if ($conf->use_javascript_ajax) {
print ajax_constantonoff('NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_FIX');
} else {
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
print $form->selectarray("NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_FIX", $arrval, $conf->global->NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_FIX);
}
print '</td>';
print '</tr>';
print '</table>';

View File

@ -112,21 +112,19 @@ class Notify
$langs->load("mails");
$listofnotiftodo = $this->getNotificationsArray($action, $socid, $object, 0);
if (!empty($conf->global->NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE)) {
if ($conf->global->NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE == 1 || $conf->global->NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE == 3) {
foreach ($listofnotiftodo as $val) {
if ($val['type'] == 'touser') {
unset($listofnotiftodo[$val['email']]);
$listofnotiftodo = array_merge($listofnotiftodo);
}
if (!empty($conf->global->NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_USER)) {
foreach ($listofnotiftodo as $val) {
if ($val['type'] == 'touser') {
unset($listofnotiftodo[$val['email']]);
$listofnotiftodo = array_merge($listofnotiftodo);
}
}
if ($conf->global->NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE == 2 || $conf->global->NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE == 3) {
foreach ($listofnotiftodo as $val) {
if ($val['type'] == 'tofixedemail') {
unset($listofnotiftodo[$val['email']]);
$listofnotiftodo = array_merge($listofnotiftodo);
}
}
if (!empty($conf->global->NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE_FIX)) {
foreach ($listofnotiftodo as $val) {
if ($val['type'] == 'tofixedemail') {
unset($listofnotiftodo[$val['email']]);
$listofnotiftodo = array_merge($listofnotiftodo);
}
}
}

View File

@ -1673,7 +1673,8 @@ MailingDelay=Seconds to wait after sending next message
NotificationSetup=Email Notification module setup
NotificationEMailFrom=Sender email (From) for emails sent by the Notifications module
FixedEmailTarget=Recipient
NotificationDisableConfirmMessage=Notification disable in confirm message
NotificationDisableConfirmMessageFix=Disable notification info in confirm message for fix notification
NotificationDisableConfirmMessageUser=Disable notification info in confirm message for user notification
##### Sendings #####
SendingsSetup=Shipping module setup
SendingsReceiptModel=Sending receipt model