Merge pull request #20358 from atm-greg/FIX_missing_hooks_for_dictionaryadmin
add more specific context and doAction hook
This commit is contained in:
commit
b0525c7a7f
@ -94,7 +94,7 @@ if (!GETPOSTISSET('search_country_id') && $search_country_id == '' && ($id == 2
|
|||||||
$search_code = GETPOST('search_code', 'alpha');
|
$search_code = GETPOST('search_code', 'alpha');
|
||||||
|
|
||||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||||
$hookmanager->initHooks(array('admin'));
|
$hookmanager->initHooks(array('admin', 'dictionaryadmin'));
|
||||||
|
|
||||||
// This page is a generic page to edit dictionaries
|
// This page is a generic page to edit dictionaries
|
||||||
// Put here declaration of dictionaries properties
|
// Put here declaration of dictionaries properties
|
||||||
@ -683,6 +683,31 @@ if ($id == 10) {
|
|||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
$parameters = array(
|
||||||
|
'id' =>$id,
|
||||||
|
'rowid' =>$rowid,
|
||||||
|
'code' =>$code,
|
||||||
|
'confirm' =>$confirm,
|
||||||
|
'entity' =>$entity,
|
||||||
|
'taborder' =>$taborder,
|
||||||
|
'tabname' =>$tabname,
|
||||||
|
'tablib' =>$tablib,
|
||||||
|
'tabsql' =>$tabsql,
|
||||||
|
'tabsqlsort' =>$tabsqlsort,
|
||||||
|
'tabfield' =>$tabfield,
|
||||||
|
'tabfieldvalue' =>$tabfieldvalue,
|
||||||
|
'tabfieldinsert'=>$tabfieldinsert,
|
||||||
|
'tabrowid' =>$tabrowid,
|
||||||
|
'tabcond' =>$tabcond,
|
||||||
|
'tabhelp' =>$tabhelp,
|
||||||
|
'tabcomplete' =>$tabcomplete
|
||||||
|
);
|
||||||
|
$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)) {
|
||||||
if (GETPOST('button_removefilter', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter_x', 'alpha')) {
|
if (GETPOST('button_removefilter', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter_x', 'alpha')) {
|
||||||
$search_country_id = '';
|
$search_country_id = '';
|
||||||
$search_code = '';
|
$search_code = '';
|
||||||
@ -1086,6 +1111,7 @@ if ($action == 'disable_favorite') {
|
|||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user