diff --git a/htdocs/admin/notification.php b/htdocs/admin/notification.php index 6609021cc2a..d467b6bb62d 100644 --- a/htdocs/admin/notification.php +++ b/htdocs/admin/notification.php @@ -208,7 +208,7 @@ $langs->trans('notiftouser'), $langs->trans('notiftofixedemail'), $langs->trans('notiftouserandtofixedemail') ); -var_dump($arrayofnotifto,$conf->global->NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE); +var_dump($arrayofnotifto, $conf->global->NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE); print ''; print $langs->trans("NotificationDisableConfirmMessage").''; print ''; diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php index 92555da891a..695a17a75d8 100644 --- a/htdocs/core/class/notify.class.php +++ b/htdocs/core/class/notify.class.php @@ -112,18 +112,18 @@ 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'){ + 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 ($conf->global->NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE == 2 || $conf->global->NOTIFICATION_EMAIL_DISABLE_CONFIRM_MESSAGE == 3){ - foreach($listofnotiftodo as $val){ - if ($val['type'] == 'tofixedemail'){ + 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); }