2
0
forked from Wavyzz/dolibarr

NEW add hook in dolibarr_set_const admin.lib.php (#30605)

* add hook in dolibarr_set_const admin.lib.php

* Update admin.lib.php

* Update admin.lib.php
This commit is contained in:
Frédéric FRANCE
2024-08-13 12:11:19 +02:00
committed by GitHub
parent ed73dc6471
commit 09b6d1aa90

View File

@@ -656,7 +656,7 @@ function dolibarr_get_const($db, $name, $entity = 1)
*/
function dolibarr_set_const($db, $name, $value, $type = 'chaine', $visible = 0, $note = '', $entity = 1)
{
global $conf;
global $conf, $hookmanager;
// Clean parameters
$name = trim($name);
@@ -666,6 +666,24 @@ function dolibarr_set_const($db, $name, $value, $type = 'chaine', $visible = 0,
dol_print_error($db, "Error: Call to function dolibarr_set_const with wrong parameters");
exit;
}
if (! is_object($hookmanager)) {
require_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
$hookmanager = new HookManager($db);
}
$parameters = array(
'name' => $name,
'value' => $value,
'type' => $type,
'visible' => $visible,
'note' => $note,
'entity' => $entity,
);
$reshook = $hookmanager->executeHooks('dolibarrSetConst', $parameters); // Note that $action and $object may have been modified by some hooks
if ($reshook != 0) {
return $reshook;
}
//dol_syslog("dolibarr_set_const name=$name, value=$value type=$type, visible=$visible, note=$note entity=$entity");