New Hooks propals/orders (#35989)

* Add hook manager support for appending custom filter clauses across various SQL queries.

* Add hook manager support for custom SQL filters across multiple modules.

* Remove obsolete test code from api_proposals.class.php

* Remove unnecessary blank lines in card.php

* Remove unnecessary blank lines in card.php

* Remove unused object initialization and 'boxcode' parameter in product class

* Update api_proposals.class.php

* Initialize hooks for order API access

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
This commit is contained in:
VIAL-GOUTEYRON Quentin
2025-10-30 01:51:29 +01:00
committed by GitHub
parent f6f9f1214d
commit c616e27274
24 changed files with 230 additions and 59 deletions

View File

@@ -229,7 +229,7 @@ function order_admin_prepare_head()
*/
function getCustomerOrderPieChart($socid = 0)
{
global $conf, $db, $langs, $user;
global $conf, $db, $langs, $user, $hookmanager;
$result = '';
@@ -257,6 +257,10 @@ function getCustomerOrderPieChart($socid = 0)
if (empty($user->socid) && !$user->hasRight('societe', 'client', 'voir')) {
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
}
// Add where from hooks
$parameters = array('socid' => $user->socid);
$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $commandestatic); // Note that $action and $object may have been modified by hook
$sql .= $hookmanager->resPrint;
$sql .= " GROUP BY c.fk_statut";
$resql = $db->query($sql);