NEW add hooks contact tab badge and hooks parameter for avoid conflicts

This commit is contained in:
Regis Houssin 2022-03-26 12:57:30 +01:00
parent c2a088c5ff
commit 97a1774bf3
2 changed files with 10 additions and 1 deletions

View File

@ -8864,7 +8864,7 @@ class Form
// Add where from hooks
if (is_object($hookmanager)) {
$parameters = array();
$parameters = array('showrefnav' => true);
$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object); // Note that $action and $object may have been modified by hook
$object->next_prev_filter .= $hookmanager->resPrint;
}

View File

@ -65,6 +65,15 @@ function societe_prepare_head(Societe $object)
$sql = "SELECT COUNT(p.rowid) as nb";
$sql .= " FROM ".MAIN_DB_PREFIX."socpeople as p";
$sql .= " WHERE p.fk_soc = ".((int) $object->id);
// Add table from hooks
$parameters = array('contacttab' => true);
$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook
$sql .= $hookmanager->resPrint;
$sql .= " WHERE p.fk_soc = ".$object->id;
// Add where from hooks
$parameters = array('contacttab' => true);
$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object); // Note that $action and $object may have been modified by hook
$sql .= $hookmanager->resPrint;
$resql = $db->query($sql);
if ($resql) {
$obj = $db->fetch_object($resql);