From 032b8692b1b7425a7ee82bc834f3b32683a6d0a1 Mon Sep 17 00:00:00 2001 From: BB2A Anthony Berton Date: Wed, 9 Mar 2022 19:42:17 +0100 Subject: [PATCH] Add hook --- ...ce_50_modNotification_Notification.class.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/htdocs/core/triggers/interface_50_modNotification_Notification.class.php b/htdocs/core/triggers/interface_50_modNotification_Notification.class.php index fe89a05ab20..3c52f89cd41 100644 --- a/htdocs/core/triggers/interface_50_modNotification_Notification.class.php +++ b/htdocs/core/triggers/interface_50_modNotification_Notification.class.php @@ -90,9 +90,26 @@ class InterfaceNotification extends DolibarrTriggers public function getListOfManagedEvents() { global $conf; + global $hookmanager; + + + if (!is_object($hookmanager)) { + include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; + $hookmanager = new HookManager($this->db); + } + $hookmanager->initHooks(array('notification')); + + $parameters = array('arrayofnotifsupported'=>$arrayofnotifsupported); + $reshook = $hookmanager->executeHooks('notifsupported', $parameters); + if (empty($reshook)) { + if (!empty($hookmanager->resArray['arrayofnotifsupported'])) { + $this->listofmanagedevents = array_merge($this->listofmanagedevents, $hookmanager->resArray['arrayofnotifsupported']); + } + } $ret = array(); + $sql = "SELECT rowid, code, label, description, elementtype"; $sql .= " FROM ".MAIN_DB_PREFIX."c_action_trigger"; $sql .= $this->db->order("rang, elementtype, code");