add more specific context and doAction hook

This commit is contained in:
atm-greg 2022-03-15 11:18:11 +01:00
parent 4a80f35aaa
commit f70ceb9398

View File

@ -694,11 +694,37 @@ 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 (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 = '';
} }
if (empty($reshook))
{
// Actions add or modify an entry into a dictionary // Actions add or modify an entry into a dictionary
if (GETPOST('actionadd') || GETPOST('actionmodify')) { if (GETPOST('actionadd') || GETPOST('actionmodify')) {
$listfield = explode(',', str_replace(' ', '', $tabfield[$id])); $listfield = explode(',', str_replace(' ', '', $tabfield[$id]));
@ -1132,7 +1158,7 @@ if ($action == 'disable_eec') {
dol_print_error($db); dol_print_error($db);
} }
} }
}
/* /*
* View * View
*/ */