forked from Wavyzz/dolibarr
NEW Add hook hookGetEntity.
Change name and param of hook
This commit is contained in:
@@ -189,7 +189,7 @@ class HookManager
|
|||||||
'formConfirm',
|
'formConfirm',
|
||||||
'getAccessForbiddenMessage',
|
'getAccessForbiddenMessage',
|
||||||
'getDirList',
|
'getDirList',
|
||||||
'functionGetEntity',
|
'hookGetEntity',
|
||||||
'getFormMail',
|
'getFormMail',
|
||||||
'getFormatedCustomerRef',
|
'getFormatedCustomerRef',
|
||||||
'getFormatedSupplierRef',
|
'getFormatedSupplierRef',
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ function getDoliDBInstance($type, $host, $user, $pass, $name, $port)
|
|||||||
*/
|
*/
|
||||||
function getEntity($element, $shared = 1, $currentobject = null)
|
function getEntity($element, $shared = 1, $currentobject = null)
|
||||||
{
|
{
|
||||||
global $conf, $mc, $hookmanager, $object;
|
global $conf, $mc, $hookmanager, $object, $action;
|
||||||
|
|
||||||
// fix different element names (France to English)
|
// fix different element names (France to English)
|
||||||
switch ($element) {
|
switch ($element) {
|
||||||
@@ -129,12 +129,13 @@ function getEntity($element, $shared = 1, $currentobject = null)
|
|||||||
|
|
||||||
// Manipulate entities to query on the fly
|
// Manipulate entities to query on the fly
|
||||||
$parameters = array(
|
$parameters = array(
|
||||||
'object' => $object,
|
|
||||||
'currentobject' => $currentobject,
|
|
||||||
'element' => $element,
|
'element' => $element,
|
||||||
'shared' => $shared,
|
'shared' => $shared,
|
||||||
|
'object' => $object,
|
||||||
|
'currentobject' => $currentobject,
|
||||||
|
'out' => $out
|
||||||
);
|
);
|
||||||
$reshook = $hookmanager->executeHooks('functionGetEntity', $parameters, $out, $element); // Note that $action and $object may have been modified by some hooks
|
$reshook = $hookmanager->executeHooks('hookGetEntity', $parameters, $currentobject, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
|
||||||
if (is_numeric($reshook)) {
|
if (is_numeric($reshook)) {
|
||||||
if ($reshook == 0 && !empty($hookmanager->resprints)) {
|
if ($reshook == 0 && !empty($hookmanager->resprints)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user