add hook doactions on expensereport_rule
This commit is contained in:
parent
bbcfc4b9f9
commit
5fe9a4404a
@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/expensereport.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/expensereport.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport_rule.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport_rule.class.php';
|
||||||
|
//var_dump($conf);
|
||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
$langs->loadLangs(array("admin", "other", "trips", "errors", "dict"));
|
$langs->loadLangs(array("admin", "other", "trips", "errors", "dict"));
|
||||||
|
|
||||||
@ -38,6 +38,17 @@ if (!$user->admin) {
|
|||||||
accessforbidden();
|
accessforbidden();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||||
|
$hookmanager->initHooks(array('admin', 'dictionaryadmin','expensereport_rules'));
|
||||||
|
|
||||||
|
|
||||||
|
$parameters = array();
|
||||||
|
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
if ($reshook < 0) {
|
||||||
|
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (empty($reshook)) {
|
||||||
//Init error
|
//Init error
|
||||||
$error = false;
|
$error = false;
|
||||||
$message = false;
|
$message = false;
|
||||||
@ -62,7 +73,6 @@ if (!empty($id)) {
|
|||||||
dol_print_error('', $object->error, $object->errors);
|
dol_print_error('', $object->error, $object->errors);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO do action
|
// TODO do action
|
||||||
if ($action == 'save') {
|
if ($action == 'save') {
|
||||||
$error = 0;
|
$error = 0;
|
||||||
@ -151,7 +161,7 @@ $tab_rules_type = array(
|
|||||||
'EX_EXP' => $langs->trans('OnExpense')
|
'EX_EXP' => $langs->trans('OnExpense')
|
||||||
);
|
);
|
||||||
|
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
@ -349,6 +359,7 @@ echo '<script type="text/javascript"> $(function() {
|
|||||||
|
|
||||||
}); </script>';
|
}); </script>';
|
||||||
|
|
||||||
|
|
||||||
print dol_get_fiche_end();
|
print dol_get_fiche_end();
|
||||||
|
|
||||||
// End of page
|
// End of page
|
||||||
|
|||||||
@ -7909,7 +7909,6 @@ function dol_htmloutput_events($disabledoutputofmessages = 0)
|
|||||||
}
|
}
|
||||||
unset($_SESSION['dol_events']['mesgs']);
|
unset($_SESSION['dol_events']['mesgs']);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show errors
|
// Show errors
|
||||||
if (isset($_SESSION['dol_events']['errors'])) {
|
if (isset($_SESSION['dol_events']['errors'])) {
|
||||||
if (empty($disabledoutputofmessages)) {
|
if (empty($disabledoutputofmessages)) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user