Merge pull request #22869 from Easya-Solutions/new-contact-list-hook-print-field-list-from

NEW hook printFieldListFrom in contact list
This commit is contained in:
Laurent Destailleur 2023-01-08 14:23:01 +01:00 committed by GitHub
commit d195c832d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -410,6 +410,10 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_stcommcontact as st ON st.id = p.fk_stco
if (empty($user->rights->societe->client->voir) && !$socid) {
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc";
}
// Add fields from hooks
$parameters = array();
$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
$sql .= $hookmanager->resPrint;
$sql .= ' WHERE p.entity IN ('.getEntity('contact').')';
if (empty($user->rights->societe->client->voir) && !$socid) { //restriction
$sql .= " AND (sc.fk_user = ".((int) $user->id)." OR p.fk_soc IS NULL)";