From dedd0ef20d9b657da45273c0b6f2ea431e0efa89 Mon Sep 17 00:00:00 2001 From: atm-adrien Date: Tue, 30 Jan 2024 15:15:32 +0100 Subject: [PATCH 1/2] FIX : Adding hooks init --- htdocs/commande/contact.php | 3 +++ htdocs/commande/document.php | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/htdocs/commande/contact.php b/htdocs/commande/contact.php index a5fc715eb38..dd0fa8d35f6 100644 --- a/htdocs/commande/contact.php +++ b/htdocs/commande/contact.php @@ -45,6 +45,9 @@ $action = GETPOST('action', 'aZ09'); if ($user->socid) { $socid = $user->socid; } +// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +$hookmanager->initHooks(array('ordercontact')); + $result = restrictedArea($user, 'commande', $id, ''); $usercancreate = $user->hasRight("commande", "creer"); diff --git a/htdocs/commande/document.php b/htdocs/commande/document.php index f16ad2ad3d3..3d5449c6c83 100644 --- a/htdocs/commande/document.php +++ b/htdocs/commande/document.php @@ -80,6 +80,10 @@ $permissiontoadd = $usercancreate; if ($user->socid) { $socid = $user->socid; } + +// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +$hookmanager->initHooks(array('ordercarddocument')); + $result = restrictedArea($user, 'commande', $id, ''); From 570fcd9174ae8ebbc6b489e1a7783c93efab4df3 Mon Sep 17 00:00:00 2001 From: atm-adrien Date: Wed, 31 Jan 2024 10:33:25 +0100 Subject: [PATCH 2/2] FIX : Retours PR --- htdocs/commande/contact.php | 2 +- htdocs/commande/document.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/commande/contact.php b/htdocs/commande/contact.php index dd0fa8d35f6..ef8cfa95070 100644 --- a/htdocs/commande/contact.php +++ b/htdocs/commande/contact.php @@ -46,7 +46,7 @@ if ($user->socid) { $socid = $user->socid; } // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context -$hookmanager->initHooks(array('ordercontact')); +$hookmanager->initHooks(array('ordercontact', 'globalcard')); $result = restrictedArea($user, 'commande', $id, ''); diff --git a/htdocs/commande/document.php b/htdocs/commande/document.php index 3d5449c6c83..f8e54085583 100644 --- a/htdocs/commande/document.php +++ b/htdocs/commande/document.php @@ -82,7 +82,7 @@ if ($user->socid) { } // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context -$hookmanager->initHooks(array('ordercarddocument')); +$hookmanager->initHooks(array('orderdocument', 'globalcard')); $result = restrictedArea($user, 'commande', $id, '');