From b6e9e0e287050aaa57d4bad010424841ae7b41ad Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 30 Mar 2018 16:44:58 +0200 Subject: [PATCH] Fix missing hooks --- ChangeLog | 2 ++ htdocs/comm/card.php | 2 +- htdocs/modulebuilder/template/myobject_agenda.php | 2 +- htdocs/modulebuilder/template/myobject_card.php | 2 +- htdocs/modulebuilder/template/myobject_document.php | 3 +-- htdocs/modulebuilder/template/myobject_note.php | 3 ++- htdocs/societe/document.php | 4 ++++ htdocs/societe/note.php | 3 +++ htdocs/ticketsup/list.php | 5 ++++- 9 files changed, 19 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 10c0c98c625..610f34d669f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -18,6 +18,8 @@ Following changes may create regressions for some external modules, but were nec * Remove the old deprecated code of doActions and getInstanceDao in canvas. The doActions of standard hooks are already available and are better. * Removed method fetch_prods() and get_each_prod() not used, keep only get_arbo_each_prod() that is better. +* The hook contaxt commcard has been renamed thirdpartycomm +* The hook contaxt thirdpartycard has been renamed thirdpartycontact ***** ChangeLog for 7.0.1 compared to 7.0.0 ***** diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 7471c9da962..eee4d529751 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -82,7 +82,7 @@ $extrafields = new ExtraFields($db); $extralabels=$extrafields->fetch_name_optionals_label($object->table_element); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context -$hookmanager->initHooks(array('commcard','globalcard')); +$hookmanager->initHooks(array('thirdpartycomm','globalcard')); /* diff --git a/htdocs/modulebuilder/template/myobject_agenda.php b/htdocs/modulebuilder/template/myobject_agenda.php index 408d6fd88fd..3fafc181c5a 100644 --- a/htdocs/modulebuilder/template/myobject_agenda.php +++ b/htdocs/modulebuilder/template/myobject_agenda.php @@ -85,7 +85,7 @@ if (! $sortorder) $sortorder='DESC'; $object=new MyObject($db); $extrafields = new ExtraFields($db); $diroutputmassaction=$conf->mymodule->dir_output . '/temp/massgeneration/'.$user->id; -$hookmanager->initHooks(array('myobjectagenda')); // Note that conf->hooks_modules contains array +$hookmanager->initHooks(array('myobjectagenda','globalcard')); // Note that conf->hooks_modules contains array // Fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label('myobject'); diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php index 470825a6a61..a9873d4c4bf 100644 --- a/htdocs/modulebuilder/template/myobject_card.php +++ b/htdocs/modulebuilder/template/myobject_card.php @@ -73,7 +73,7 @@ $backtopage = GETPOST('backtopage', 'alpha'); $object=new MyObject($db); $extrafields = new ExtraFields($db); $diroutputmassaction=$conf->mymodule->dir_output . '/temp/massgeneration/'.$user->id; -$hookmanager->initHooks(array('myobjectcard')); // Note that conf->hooks_modules contains array +$hookmanager->initHooks(array('myobjectcard','globalcard')); // Note that conf->hooks_modules contains array // Fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label('myobject'); $search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_'); diff --git a/htdocs/modulebuilder/template/myobject_document.php b/htdocs/modulebuilder/template/myobject_document.php index 3d1580e1e3b..8ce85b8eee6 100644 --- a/htdocs/modulebuilder/template/myobject_document.php +++ b/htdocs/modulebuilder/template/myobject_document.php @@ -74,7 +74,7 @@ if (! $sortfield) $sortfield="name"; $object=new MyObject($db); $extrafields = new ExtraFields($db); $diroutputmassaction=$conf->mymodule->dir_output . '/temp/massgeneration/'.$user->id; -$hookmanager->initHooks(array('myobjectdocument')); // Note that conf->hooks_modules contains array +$hookmanager->initHooks(array('myobjectdocument','globalcard')); // Note that conf->hooks_modules contains array // Fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label('myobject'); @@ -85,7 +85,6 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be inclu if ($id > 0 || ! empty($ref)) $upload_dir = $conf->sellyoursaas->multidir_output[$object->entity] . "/packages/" . dol_sanitizeFileName($object->ref); - /* * Actions */ diff --git a/htdocs/modulebuilder/template/myobject_note.php b/htdocs/modulebuilder/template/myobject_note.php index 782be1c5bb9..3cb6a5791b3 100644 --- a/htdocs/modulebuilder/template/myobject_note.php +++ b/htdocs/modulebuilder/template/myobject_note.php @@ -54,7 +54,7 @@ $backtopage = GETPOST('backtopage', 'alpha'); $object=new MyObject($db); $extrafields = new ExtraFields($db); $diroutputmassaction=$conf->mymodule->dir_output . '/temp/massgeneration/'.$user->id; -$hookmanager->initHooks(array('myobjectnote')); // Note that conf->hooks_modules contains array +$hookmanager->initHooks(array('myobjectnote','globalcard')); // Note that conf->hooks_modules contains array // Fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label('myobject'); @@ -71,6 +71,7 @@ $permissionnote=1; //$permissionnote=$user->rights->mymodule->creer; // Used by the include of actions_setnotes.inc.php + /* * Actions */ diff --git a/htdocs/societe/document.php b/htdocs/societe/document.php index be549d6cac5..2cab1da971f 100644 --- a/htdocs/societe/document.php +++ b/htdocs/societe/document.php @@ -69,6 +69,10 @@ if ($id > 0 || ! empty($ref)) $courrier_dir = $conf->societe->multidir_output[$object->entity] . "/courrier/" . get_exdir($object->id,0,0,0,$object,'thirdparty'); } +// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +$hookmanager->initHooks(array('thirdpartydocument','globalcard')); + + /* * Actions diff --git a/htdocs/societe/note.php b/htdocs/societe/note.php index d0766bc24d8..e31a07e8e65 100644 --- a/htdocs/societe/note.php +++ b/htdocs/societe/note.php @@ -43,6 +43,9 @@ if ($id > 0) $object->fetch($id); $permissionnote=$user->rights->societe->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('thirdpartynote','globalcard')); + /* * Actions diff --git a/htdocs/ticketsup/list.php b/htdocs/ticketsup/list.php index 0e09333e7dd..8eda9bfc454 100644 --- a/htdocs/ticketsup/list.php +++ b/htdocs/ticketsup/list.php @@ -71,7 +71,10 @@ $pagenext = $page + 1; $object=new Ticketsup($db); $extrafields = new ExtraFields($db); $diroutputmassaction=$conf->ticketsup->dir_output . '/temp/massgeneration/'.$user->id; -$hookmanager->initHooks(array('ticketsuplist')); // Note that conf->hooks_modules contains array +if ($socid > 0) $hookmanager->initHooks(array('thirdpartyticket')); +elseif ($project > 0) $hookmanager->initHooks(array('projectticket')); +else $hookmanager->initHooks(array('ticketsuplist')); + // Fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label('ticketsup'); $search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_');