From 1dffc1c0fa981a294dd1a6805e67eafbe4beab87 Mon Sep 17 00:00:00 2001 From: atm-greg Date: Mon, 29 Nov 2021 16:54:26 +0100 Subject: [PATCH] add hook to uniformize printFieldListFrom hook --- htdocs/comm/propal/list.php | 6 ++++++ htdocs/commande/list.php | 6 ++++++ htdocs/expedition/list.php | 6 ++++++ 3 files changed, 18 insertions(+) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 692468b8485..47735db393a 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -553,6 +553,12 @@ if ($search_user > 0) { $sql .= ", ".MAIN_DB_PREFIX."element_contact as c"; $sql .= ", ".MAIN_DB_PREFIX."c_type_contact as tc"; } + +// Add table from hooks +$parameters = array(); +$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 = s.rowid'; $sql .= ' AND p.entity IN ('.getEntity('propal').')'; if (!$user->rights->societe->client->voir && !$socid) { //restriction diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index e2ea9b2222c..50078a60ff4 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -470,6 +470,12 @@ if ($search_user > 0) { $sql .= ", ".MAIN_DB_PREFIX."element_contact as ec"; $sql .= ", ".MAIN_DB_PREFIX."c_type_contact as tc"; } + +// Add table from hooks +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook +$sql .= $hookmanager->resPrint; + $sql .= ' WHERE c.fk_soc = s.rowid'; $sql .= ' AND c.entity IN ('.getEntity('commande').')'; if ($search_product_category > 0) { diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index 3660b8a5cbe..7cf48a6bf7e 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -280,6 +280,12 @@ if ($search_user > 0) { $sql .= ", ".MAIN_DB_PREFIX."element_contact as ec"; $sql .= ", ".MAIN_DB_PREFIX."c_type_contact as tc"; } + +// Add table from hooks +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook +$sql .= $hookmanager->resPrint; + $sql .= " WHERE e.entity IN (".getEntity('expedition').")"; if ($search_product_category > 0) { $sql .= " AND cp.fk_categorie = ".((int) $search_product_category);