diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php index 7e011482f43..df5f19a64bf 100644 --- a/htdocs/core/class/notify.class.php +++ b/htdocs/core/class/notify.class.php @@ -71,7 +71,6 @@ class Notify 'PROPAL_VALIDATE', 'PROPAL_CLOSE_REFUSED', 'PROPAL_CLOSE_SIGNED', - 'PROPAL_SENTBYMAIL', 'FICHINTER_VALIDATE', 'FICHINTER_ADD_CONTACT', 'ORDER_SUPPLIER_VALIDATE', @@ -83,7 +82,6 @@ class Notify 'HOLIDAY_VALIDATE', 'HOLIDAY_APPROVE', 'ACTION_CREATE', - 'FUNDING_SENTBYMAIL', ); /** @@ -358,17 +356,26 @@ class Notify global $dolibarr_main_url_root; global $action; - if (!in_array($notifcode, Notify::$arrayofnotifsupported)) { - return 0; - } - - include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; if (!is_object($hookmanager)) { include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; $hookmanager = new HookManager($this->db); } $hookmanager->initHooks(array('notification')); + + $reshook = $hookmanager->executeHooks('notifsupported'); + if (empty($reshook)) { + if (!empty($hookmanager->resArray['arrayofnotifsupported'])) { + Notify::$arrayofnotifsupported = array_merge(Notify::$arrayofnotifsupported, $hookmanager->resArray['arrayofnotifsupported']); + } + } + + if (!in_array($notifcode, Notify::$arrayofnotifsupported)) { + return 0; + } + + include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + dol_syslog(get_class($this)."::send notifcode=".$notifcode.", object=".$object->id); $langs->load("other"); diff --git a/htdocs/core/triggers/interface_50_modNotification_Notification.class.php b/htdocs/core/triggers/interface_50_modNotification_Notification.class.php index 3c52f89cd41..2013933e54b 100644 --- a/htdocs/core/triggers/interface_50_modNotification_Notification.class.php +++ b/htdocs/core/triggers/interface_50_modNotification_Notification.class.php @@ -99,8 +99,7 @@ class InterfaceNotification extends DolibarrTriggers } $hookmanager->initHooks(array('notification')); - $parameters = array('arrayofnotifsupported'=>$arrayofnotifsupported); - $reshook = $hookmanager->executeHooks('notifsupported', $parameters); + $reshook = $hookmanager->executeHooks('notifsupported'); if (empty($reshook)) { if (!empty($hookmanager->resArray['arrayofnotifsupported'])) { $this->listofmanagedevents = array_merge($this->listofmanagedevents, $hookmanager->resArray['arrayofnotifsupported']);