From 63eecb46a96d750b681c04dba2433d7e156ebb54 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 2 Mar 2018 17:32:54 +0100 Subject: [PATCH] Fix missing hook init --- htdocs/contrat/contact.php | 7 ++++++- htdocs/contrat/document.php | 4 ++++ htdocs/contrat/info.php | 11 +++++++++++ htdocs/contrat/note.php | 4 ++++ 4 files changed, 25 insertions(+), 1 deletion(-) diff --git a/htdocs/contrat/contact.php b/htdocs/contrat/contact.php index 64050c3512d..1b81d9d13f6 100644 --- a/htdocs/contrat/contact.php +++ b/htdocs/contrat/contact.php @@ -49,8 +49,13 @@ $result=restrictedArea($user,'contrat',$id); $object = new Contrat($db); +// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +$hookmanager->initHooks(array('contractcard','globalcard')); -// Add new contact + +/* + * Actions + */ if ($action == 'addcontact' && $user->rights->contrat->creer) { diff --git a/htdocs/contrat/document.php b/htdocs/contrat/document.php index 32fcd5a64bd..4bc2747a829 100644 --- a/htdocs/contrat/document.php +++ b/htdocs/contrat/document.php @@ -77,10 +77,14 @@ if ($object->id > 0) $upload_dir = $conf->contrat->dir_output.'/'.dol_sanitizeFileName($object->ref); $modulepart='contract'; +// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +$hookmanager->initHooks(array('contractcard','globalcard')); + /* * Actions */ + include_once DOL_DOCUMENT_ROOT . '/core/actions_linkedfiles.inc.php'; diff --git a/htdocs/contrat/info.php b/htdocs/contrat/info.php index 10f31ac1612..b6c92eac27e 100644 --- a/htdocs/contrat/info.php +++ b/htdocs/contrat/info.php @@ -41,6 +41,17 @@ $ref = GETPOST('ref','alpha'); if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'contrat', $id, ''); +// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +$hookmanager->initHooks(array('contractcard','globalcard')); + + +/* + * Actions + */ + +// None + + /* * View diff --git a/htdocs/contrat/note.php b/htdocs/contrat/note.php index 9a6d28dd4c9..ab76d9aaec3 100644 --- a/htdocs/contrat/note.php +++ b/htdocs/contrat/note.php @@ -49,6 +49,10 @@ $object->fetch($id,$ref); $permissionnote=$user->rights->contrat->creer; // Used by the include of actions_setnotes.inc.php +// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +$hookmanager->initHooks(array('contractcard','globalcard')); + + /* * Actions