diff --git a/htdocs/admin/notification.php b/htdocs/admin/notification.php
index 8137c34e1e6..1b06e9dd25e 100644
--- a/htdocs/admin/notification.php
+++ b/htdocs/admin/notification.php
@@ -97,6 +97,10 @@ if ($action == 'setvalue' && $user->admin) {
$error++;
}
+ $result = dolibarr_set_const($db, "NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE", GETPOST("notif_disable", "alphawithlgt"), 'chaine', 0, '', $conf->entity);
+ if ($result < 0) {
+ $error++;
+ }
if (!$error) {
$db->commit();
@@ -199,6 +203,29 @@ if (!empty($conf->global->NOTIFICATION_EMAIL_FROM) && !isValidEmail($conf->globa
}
print '';
print '';
+
+print '
| ';
+print $langs->trans("NotificationDisableConfirmMessageUser").' | ';
+print '';
+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 ' | ';
+print '
';
+print '| ';
+print $langs->trans("NotificationDisableConfirmMessageFix").' | ';
+print '';
+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 ' | ';
+print '
';
print '';
print $form->buttonsSaveCancel("Save", '');
diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php
index 019618366d1..7128a6cf01d 100644
--- a/htdocs/core/class/notify.class.php
+++ b/htdocs/core/class/notify.class.php
@@ -108,10 +108,26 @@ class Notify
*/
public function confirmMessage($action, $socid, $object)
{
- global $langs;
+ global $conf, $langs;
$langs->load("mails");
$listofnotiftodo = $this->getNotificationsArray($action, $socid, $object, 0);
+ 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 (!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);
+ }
+ }
+ }
$texte = '';
$nb = -1;
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index f75ba12abe5..1c8fd23ddb3 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -1699,6 +1699,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
+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
diff --git a/htdocs/langs/en_US/other.lang b/htdocs/langs/en_US/other.lang
index ea280968ef4..9bc68dc3678 100644
--- a/htdocs/langs/en_US/other.lang
+++ b/htdocs/langs/en_US/other.lang
@@ -35,6 +35,9 @@ OnlyOneFieldForXAxisIsPossible=Only 1 field is currently possible as X-Axis. Onl
AtLeastOneMeasureIsRequired=At least 1 field for measure is required
AtLeastOneXAxisIsRequired=At least 1 field for X-Axis is required
LatestBlogPosts=Latest Blog Posts
+notiftouser=To users
+notiftofixedemail=To fixed mail
+notiftouserandtofixedemail=To user and fixed mail
Notify_ORDER_VALIDATE=Sales order validated
Notify_ORDER_SENTBYMAIL=Sales order sent by mail
Notify_ORDER_SUPPLIER_SENTBYMAIL=Purchase order sent by email