diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index ebf941962d1..176a8b3efb3 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -450,7 +450,7 @@ class Adherent extends CommonObject // Actions on extra fields (by external module) include_once(DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'); $hookmanager=new HookManager($this->db); - $hookmanager->callHooks(array('memberdao')); + $hookmanager->initHooks(array('memberdao')); $parameters=array('id'=>$this->id); $action=''; $reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks diff --git a/htdocs/adherents/fiche.php b/htdocs/adherents/fiche.php index 27acbae6c54..56e51914e7d 100644 --- a/htdocs/adherents/fiche.php +++ b/htdocs/adherents/fiche.php @@ -89,7 +89,7 @@ if ($rowid) // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array include_once(DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'); $hookmanager=new HookManager($db); -$hookmanager->callHooks(array('membercard')); +$hookmanager->initHooks(array('membercard')); /* diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 1328c3b712d..6b640f8920f 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -63,7 +63,7 @@ $pagenext = $page + 1; // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array include_once(DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'); $hookmanager=new HookManager($db); -$hookmanager->callHooks(array('admin')); +$hookmanager->initHooks(array('admin')); // Thi page is a generic page to edit dictionnaries // Put here delacaration of dictionnaries properties diff --git a/htdocs/comm/addpropal.php b/htdocs/comm/addpropal.php index 882262d6b58..965e8344fa8 100644 --- a/htdocs/comm/addpropal.php +++ b/htdocs/comm/addpropal.php @@ -47,7 +47,7 @@ $mesg=GETPOST('mesg'); // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array include_once(DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'); $hookmanager=new HookManager($db); -$hookmanager->callHooks(array('propalcard')); +$hookmanager->initHooks(array('propalcard')); /* * Actions diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 4310a9de860..a5293e711dd 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -88,7 +88,7 @@ $result = restrictedArea($user, $module, $objectid, $dbtable); // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array include_once(DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'); $hookmanager=new HookManager($db); -$hookmanager->callHooks(array('propalcard')); +$hookmanager->initHooks(array('propalcard')); diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 380afb8c28e..c44f3bfa4ff 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -925,7 +925,7 @@ class Commande extends CommonObject // Actions hooked (by external module) include_once(DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'); $hookmanager=new HookManager($this->db); - $hookmanager->callHooks(array('orderdao')); + $hookmanager->initHooks(array('orderdao')); $parameters=array('objFrom'=>$object); $action=''; diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index a8383c52d55..86a33feb3f6 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -68,7 +68,7 @@ $result=restrictedArea($user,'commande',$id,''); // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array include_once(DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'); $hookmanager=new HookManager($db); -$hookmanager->callHooks(array('ordercard')); +$hookmanager->initHooks(array('ordercard')); /******************************************************************************/ diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index e608d07d1a9..1de845e0041 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -80,7 +80,7 @@ $object=new Facture($db); // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array include_once(DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'); $hookmanager=new HookManager($db); -$hookmanager->callHooks(array('invoicecard')); +$hookmanager->initHooks(array('invoicecard')); /* diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 8a1cb98c4b7..b2e2db358bb 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -653,7 +653,7 @@ class Facture extends CommonObject // Actions hooked (by external module) include_once(DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'); $hookmanager=new HookManager($this->db); - $hookmanager->callHooks(array('invoicedao')); + $hookmanager->initHooks(array('invoicedao')); $parameters=array('objFrom'=>$object); $action=''; diff --git a/htdocs/contact/fiche.php b/htdocs/contact/fiche.php index d50dd537181..0fb3a29af78 100644 --- a/htdocs/contact/fiche.php +++ b/htdocs/contact/fiche.php @@ -64,7 +64,7 @@ $result = restrictedArea($user, 'contact', $id, 'socpeople&societe', '', '', '', // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array include_once(DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'); $hookmanager=new HookManager($db); -$hookmanager->callHooks(array('contactcard')); +$hookmanager->initHooks(array('contactcard')); /* diff --git a/htdocs/core/class/hookmanager.class.php b/htdocs/core/class/hookmanager.class.php index 96eb2558bc0..fe9ad22e071 100755 --- a/htdocs/core/class/hookmanager.class.php +++ b/htdocs/core/class/hookmanager.class.php @@ -58,14 +58,14 @@ class HookManager * First, a hook is declared by a module by adding a constant MAIN_MODULE_MYMODULENAME_HOOKS * with value 'nameofcontext1:nameofcontext2:...' into $this->const of module descriptor file. * This make conf->hooks_modules loaded with an entry ('modulename'=>array(nameofcontext1,nameofcontext2,...)) - * When callHooks function is called, with callHooks(list_of_contexts), an array this->hooks is defined with instance of controler + * When initHooks function is called, with initHooks(list_of_contexts), an array this->hooks is defined with instance of controler * class found into file /mymodule/class/actions_mymodule.class.php (if module has declared the context as a managed context). * Then when a hook is executeHook('aMethod'...) is called, the method aMethod found into class will be executed. * * @param array $arraycontext Array list of searched hooks tab/features. For example: 'thirdpartycard' (for hook methods into page card thirdparty), 'thirdpartydao' (for hook methods into Societe), ... * @return int Always 1 */ - function callHooks($arraycontext) + function initHooks($arraycontext) { global $conf; diff --git a/htdocs/core/modules/commande/doc/pdf_edison.modules.php b/htdocs/core/modules/commande/doc/pdf_edison.modules.php index d1f8ad9f22e..52da86dab1d 100644 --- a/htdocs/core/modules/commande/doc/pdf_edison.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_edison.modules.php @@ -303,7 +303,7 @@ class pdf_edison extends ModelePDFCommandes include_once(DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'); $hookmanager=new HookManager($this->db); } - $hookmanager->callHooks(array('pdfgeneration')); + $hookmanager->initHooks(array('pdfgeneration')); $parameters=array('file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs); global $action; $reshook=$hookmanager->executeHooks('afterPDFCreation',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index 156455dc0e8..adfb04c8b26 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -412,7 +412,7 @@ class pdf_einstein extends ModelePDFCommandes include_once(DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'); $hookmanager=new HookManager($this->db); } - $hookmanager->callHooks(array('pdfgeneration')); + $hookmanager->initHooks(array('pdfgeneration')); $parameters=array('file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs); global $action; $reshook=$hookmanager->executeHooks('afterPDFCreation',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 8d5b9944f22..dbb41c1d80a 100755 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -417,7 +417,7 @@ class pdf_crabe extends ModelePDFFactures include_once(DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'); $hookmanager=new HookManager($this->db); } - $hookmanager->callHooks(array('pdfgeneration')); + $hookmanager->initHooks(array('pdfgeneration')); $parameters=array('file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs); global $action; $reshook=$hookmanager->executeHooks('afterPDFCreation',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks diff --git a/htdocs/core/modules/facture/doc/pdf_oursin.modules.php b/htdocs/core/modules/facture/doc/pdf_oursin.modules.php index aaa65b27e59..bacc6ed2dc4 100755 --- a/htdocs/core/modules/facture/doc/pdf_oursin.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_oursin.modules.php @@ -305,7 +305,7 @@ class pdf_oursin extends ModelePDFFactures include_once(DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'); $hookmanager=new HookManager($this->db); } - $hookmanager->callHooks(array('pdfgeneration')); + $hookmanager->initHooks(array('pdfgeneration')); $parameters=array('file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs); global $action; $reshook=$hookmanager->executeHooks('afterPDFCreation',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index d75f28fbabc..fb039064dfa 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -398,7 +398,7 @@ class pdf_azur extends ModelePDFPropales include_once(DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'); $hookmanager=new HookManager($this->db); } - $hookmanager->callHooks(array('pdfgeneration')); + $hookmanager->initHooks(array('pdfgeneration')); $parameters=array('file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs); global $action; $reshook=$hookmanager->executeHooks('afterPDFCreation',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks diff --git a/htdocs/core/modules/propale/doc/pdf_jaune.modules.php b/htdocs/core/modules/propale/doc/pdf_jaune.modules.php index 062453b9696..74df21eb178 100644 --- a/htdocs/core/modules/propale/doc/pdf_jaune.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_jaune.modules.php @@ -398,7 +398,7 @@ class pdf_jaune extends ModelePDFPropales include_once(DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'); $hookmanager=new HookManager($this->db); } - $hookmanager->callHooks(array('pdfgeneration')); + $hookmanager->initHooks(array('pdfgeneration')); $parameters=array('file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs); global $action; $reshook=$hookmanager->executeHooks('afterPDFCreation',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks diff --git a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php index 4761a6b38b0..ee9599cfeaf 100755 --- a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php @@ -403,7 +403,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices include_once(DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'); $hookmanager=new HookManager($this->db); } - $hookmanager->callHooks(array('pdfgeneration')); + $hookmanager->initHooks(array('pdfgeneration')); $parameters=array('file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs); global $action; $reshook=$hookmanager->executeHooks('afterPDFCreation',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php index 1ef9a8c75f0..5cd9ae7ad70 100644 --- a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php @@ -411,7 +411,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders include_once(DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'); $hookmanager=new HookManager($this->db); } - $hookmanager->callHooks(array('pdfgeneration')); + $hookmanager->initHooks(array('pdfgeneration')); $parameters=array('file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs); global $action; $reshook=$hookmanager->executeHooks('afterPDFCreation',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php index d3a1a850faa..a0b102da196 100644 --- a/htdocs/fourn/commande/fiche.php +++ b/htdocs/fourn/commande/fiche.php @@ -62,7 +62,7 @@ $result = restrictedArea($user, 'commande_fournisseur', $id,''); // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array include_once(DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'); $hookmanager=new HookManager($db); -$hookmanager->callHooks(array('ordersuppliercard')); +$hookmanager->initHooks(array('ordersuppliercard')); $mesg=''; diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index 3f9bdf62c3c..8f2a0b21037 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -53,7 +53,7 @@ $result = restrictedArea($user, 'fournisseur', $id, 'facture_fourn', 'facture'); // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array include_once(DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'); $hookmanager=new HookManager($db); -$hookmanager->callHooks(array('invoicesuppliercard')); +$hookmanager->initHooks(array('invoicesuppliercard')); $object=new FactureFournisseur($db); diff --git a/htdocs/index.php b/htdocs/index.php index 1dc2a2b06f4..040ca9f3e2d 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -35,7 +35,7 @@ if (! isset($_GET["mainmenu"])) $_GET["mainmenu"]="home"; include_once(DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'); $hookmanager=new HookManager($db); -$hookmanager->callHooks(array('index')); +$hookmanager->initHooks(array('index')); /* diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 1dc14515aba..3e61a9dd074 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -586,7 +586,7 @@ if (! defined('NOLOGIN')) $action=''; include_once(DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'); $hookmanager=new HookManager($db); - $hookmanager->callHooks(array('login')); + $hookmanager->initHooks(array('login')); $parameters=array('dol_authmode'=>$dol_authmode); $reshook=$hookmanager->executeHooks('afterLogin',$parameters,$user,$action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) $error++; @@ -1054,7 +1054,7 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a include_once(DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'); $hookmanager=new HookManager($db); } - $hookmanager->callHooks(array('toprightmenu')); + $hookmanager->initHooks(array('toprightmenu')); $toprightmenu=''; @@ -1310,7 +1310,7 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me include_once(DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'); $hookmanager=new HookManager($db); } - $hookmanager->callHooks(array('searchform','leftblock','toprightmenu')); + $hookmanager->initHooks(array('searchform','leftblock','toprightmenu')); if ($conf->use_javascript_ajax && $conf->global->MAIN_MENU_USE_JQUERY_LAYOUT) print "\n".'
'."\n"; else print ''; diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index cca064e54a6..54158d9e672 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -562,7 +562,7 @@ class Product extends CommonObject // Actions on extra fields (by external module or standard code) include_once(DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'); $hookmanager=new HookManager($this->db); - $hookmanager->callHooks(array('productdao')); + $hookmanager->initHooks(array('productdao')); $parameters=array(); $action='delete'; $reshook=$hookmanager->executeHooks('deleteProduct',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks if (! empty($hookmanager->error)) diff --git a/htdocs/product/fiche.php b/htdocs/product/fiche.php index 60139ab2c37..7d0adf0926f 100644 --- a/htdocs/product/fiche.php +++ b/htdocs/product/fiche.php @@ -73,7 +73,7 @@ $result=restrictedArea($user,'produit|service',$fieldvalue,'product&product','', // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array include_once(DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'); $hookmanager=new HookManager($db); -$hookmanager->callHooks(array('productcard')); +$hookmanager->initHooks(array('productcard')); diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index 4eb853d5754..d6c18647c05 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -57,7 +57,7 @@ $result=restrictedArea($user,'produit|service&fournisseur',$fieldvalue,'product& // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array include_once(DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'); $hookmanager=new HookManager($db); -$hookmanager->callHooks(array('pricesuppliercard')); +$hookmanager->initHooks(array('pricesuppliercard')); $sortfield = GETPOST("sortfield",'alpha'); diff --git a/htdocs/public/demo/index.php b/htdocs/public/demo/index.php index e5619c3db1e..6d0e732fede 100644 --- a/htdocs/public/demo/index.php +++ b/htdocs/public/demo/index.php @@ -40,7 +40,7 @@ if (empty($dolibarr_main_demo)) accessforbidden('Parameter dolibarr_main_demo mu // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array include_once(DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'); $hookmanager=new HookManager($db); -$hookmanager->callHooks(array('demo')); +$hookmanager->initHooks(array('demo')); $demoprofiles=array( array('default'=>'-1', 'key'=>'profdemofun','label'=>'DemoFundation', diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index db26e573b8c..8b00188877d 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -542,7 +542,7 @@ class Societe extends CommonObject // Actions on extra fields (by external module or standard code) include_once(DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'); $hookmanager=new HookManager($this->db); - $hookmanager->callHooks(array('thirdpartydao')); + $hookmanager->initHooks(array('thirdpartydao')); $parameters=array('socid'=>$this->id); $reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks if (empty($reshook)) @@ -893,7 +893,7 @@ class Societe extends CommonObject // Additionnal action by hooks include_once(DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'); $hookmanager=new HookManager($this->db); - $hookmanager->callHooks(array('thirdpartydao')); + $hookmanager->initHooks(array('thirdpartydao')); $parameters=array(); $action='delete'; $reshook=$hookmanager->executeHooks('deleteThirdparty',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks if (! empty($hookmanager->error)) diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index e38f4e04f1e..44879bbb723 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -71,7 +71,7 @@ $result = restrictedArea($user, 'societe', $socid, '&societe', '', '', '', $objc // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array include_once(DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'); $hookmanager=new HookManager($db); -$hookmanager->callHooks(array('thirdpartycard')); +$hookmanager->initHooks(array('thirdpartycard')); /*