Add Hook
This commit is contained in:
parent
032b8692b1
commit
e1e573c532
@ -71,7 +71,6 @@ class Notify
|
|||||||
'PROPAL_VALIDATE',
|
'PROPAL_VALIDATE',
|
||||||
'PROPAL_CLOSE_REFUSED',
|
'PROPAL_CLOSE_REFUSED',
|
||||||
'PROPAL_CLOSE_SIGNED',
|
'PROPAL_CLOSE_SIGNED',
|
||||||
'PROPAL_SENTBYMAIL',
|
|
||||||
'FICHINTER_VALIDATE',
|
'FICHINTER_VALIDATE',
|
||||||
'FICHINTER_ADD_CONTACT',
|
'FICHINTER_ADD_CONTACT',
|
||||||
'ORDER_SUPPLIER_VALIDATE',
|
'ORDER_SUPPLIER_VALIDATE',
|
||||||
@ -83,7 +82,6 @@ class Notify
|
|||||||
'HOLIDAY_VALIDATE',
|
'HOLIDAY_VALIDATE',
|
||||||
'HOLIDAY_APPROVE',
|
'HOLIDAY_APPROVE',
|
||||||
'ACTION_CREATE',
|
'ACTION_CREATE',
|
||||||
'FUNDING_SENTBYMAIL',
|
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -358,17 +356,26 @@ class Notify
|
|||||||
global $dolibarr_main_url_root;
|
global $dolibarr_main_url_root;
|
||||||
global $action;
|
global $action;
|
||||||
|
|
||||||
if (!in_array($notifcode, Notify::$arrayofnotifsupported)) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
|
||||||
if (!is_object($hookmanager)) {
|
if (!is_object($hookmanager)) {
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
|
||||||
$hookmanager = new HookManager($this->db);
|
$hookmanager = new HookManager($this->db);
|
||||||
}
|
}
|
||||||
$hookmanager->initHooks(array('notification'));
|
$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);
|
dol_syslog(get_class($this)."::send notifcode=".$notifcode.", object=".$object->id);
|
||||||
|
|
||||||
$langs->load("other");
|
$langs->load("other");
|
||||||
|
|||||||
@ -99,8 +99,7 @@ class InterfaceNotification extends DolibarrTriggers
|
|||||||
}
|
}
|
||||||
$hookmanager->initHooks(array('notification'));
|
$hookmanager->initHooks(array('notification'));
|
||||||
|
|
||||||
$parameters = array('arrayofnotifsupported'=>$arrayofnotifsupported);
|
$reshook = $hookmanager->executeHooks('notifsupported');
|
||||||
$reshook = $hookmanager->executeHooks('notifsupported', $parameters);
|
|
||||||
if (empty($reshook)) {
|
if (empty($reshook)) {
|
||||||
if (!empty($hookmanager->resArray['arrayofnotifsupported'])) {
|
if (!empty($hookmanager->resArray['arrayofnotifsupported'])) {
|
||||||
$this->listofmanagedevents = array_merge($this->listofmanagedevents, $hookmanager->resArray['arrayofnotifsupported']);
|
$this->listofmanagedevents = array_merge($this->listofmanagedevents, $hookmanager->resArray['arrayofnotifsupported']);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user