mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-24 10:21:32 +01:00
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:
committed by
GitHub
parent
f6f9f1214d
commit
c616e27274
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user