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>'; print '</tr>';
$arrayofnotifto = array( $arrayofnotifto = array(
'', -1 => '',
$langs->trans('notiftouser'), 1 => $langs->trans('notiftouser'),
$langs->trans('notiftofixedemail'), 2 => $langs->trans('notiftofixedemail'),
$langs->trans('notiftouserandtofixedemail') 3 => $langs->trans('notiftouserandtofixedemail')
); );
print '<tr class="oddeven"><td>'; print '<tr class="oddeven"><td>';
print $langs->trans("NotificationDisableConfirmMessage").'</td>'; print $langs->trans("NotificationDisableConfirmMessageUser").'</td>';
print '<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 '</td>';
print '</tr>'; print '</tr>';
print '</table>'; print '</table>';

View File

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

View File

@ -1673,7 +1673,8 @@ MailingDelay=Seconds to wait after sending next message
NotificationSetup=Email Notification module setup NotificationSetup=Email Notification module setup
NotificationEMailFrom=Sender email (From) for emails sent by the Notifications module NotificationEMailFrom=Sender email (From) for emails sent by the Notifications module
FixedEmailTarget=Recipient 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 ##### ##### Sendings #####
SendingsSetup=Shipping module setup SendingsSetup=Shipping module setup
SendingsReceiptModel=Sending receipt model SendingsReceiptModel=Sending receipt model