NEW add hook printFieldListWhere in "show_contacts" function

This commit is contained in:
Regis Houssin 2022-03-22 10:46:26 +01:00
parent 33398a3031
commit 4efe10a9a5

View File

@ -1102,6 +1102,10 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '')
// Add where from extra fields
$extrafieldsobjectkey = $contactstatic->table_element;
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
// Add where from hooks
$parameters = array('socid' => $object->id);
$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object); // Note that $action and $object may have been modified by hook
$sql .= $hookmanager->resPrint;
if ($sortfield == "t.name") {
$sql .= " ORDER BY t.lastname $sortorder, t.firstname $sortorder";
} else {