Browse Source

New: add context "globalcard" for declaring only once all cards

Regis Houssin 10 years ago
parent
commit
a2446e51db

+ 1 - 1
htdocs/adherents/card.php

@@ -108,7 +108,7 @@ if ($rowid)
 }
 
 // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
-$hookmanager->initHooks(array('membercard'));
+$hookmanager->initHooks(array('membercard','globalcard'));
 
 
 /*

+ 1 - 1
htdocs/adherents/type.php

@@ -70,7 +70,7 @@ if (GETPOST('button_removefilter'))
 
 
 // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
-$hookmanager->initHooks(array('membertypecard'));
+$hookmanager->initHooks(array('membertypecard','globalcard'));
 
 /*
  *	Actions

+ 1 - 1
htdocs/categories/categorie.php

@@ -93,7 +93,7 @@ if ($user->societe_id) $socid=$user->societe_id;
 $result = restrictedArea($user,$objecttype,$objectid,$dbtablename,'','',$fieldid);
 
 // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
-$hookmanager->initHooks(array('categorycard'));
+$hookmanager->initHooks(array('categorycard','globalcard'));
 
 
 /*

+ 1 - 1
htdocs/comm/action/card.php

@@ -81,7 +81,7 @@ $extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
 //var_dump($_POST);
 
 // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
-$hookmanager->initHooks(array('actioncard'));
+$hookmanager->initHooks(array('actioncard','globalcard'));
 
 
 /*

+ 1 - 1
htdocs/comm/card.php

@@ -68,7 +68,7 @@ if (! $sortorder) $sortorder="ASC";
 if (! $sortfield) $sortfield="nom";
 
 // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
-$hookmanager->initHooks(array('commcard'));
+$hookmanager->initHooks(array('commcard','globalcard'));
 
 $object = new Societe($db);
 

+ 1 - 1
htdocs/comm/mailing/card.php

@@ -52,7 +52,7 @@ $extrafields = new ExtraFields($db);
 $extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
 
 // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
-$hookmanager->initHooks(array('mailingcard'));
+$hookmanager->initHooks(array('mailingcard','globalcard'));
 
 // Array of possible substitutions (See also file mailing-send.php that should manage same substitutions)
 $object->substitutionarray=array(

+ 1 - 1
htdocs/comm/propal.php

@@ -96,7 +96,7 @@ if ($id > 0 || ! empty($ref)) {
 }
 
 // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
-$hookmanager->initHooks(array('propalcard'));
+$hookmanager->initHooks(array('propalcard','globalcard'));
 
 $permissionnote = $user->rights->propale->creer; // Used by the include of actions_setnotes.inc.php
 

+ 1 - 1
htdocs/commande/card.php

@@ -90,7 +90,7 @@ if ($id > 0 || ! empty($ref)) {
 }
 
 // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
-$hookmanager->initHooks(array('ordercard'));
+$hookmanager->initHooks(array('ordercard','globalcard'));
 
 $permissionnote = $user->rights->commande->creer; // Used by the include of actions_setnotes.inc.php
 

+ 1 - 1
htdocs/compta/deplacement/card.php

@@ -47,7 +47,7 @@ $confirm = GETPOST('confirm','alpha');
 $object = new Deplacement($db);
 
 // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
-$hookmanager->initHooks(array('tripsandexpensescard'));
+$hookmanager->initHooks(array('tripsandexpensescard','globalcard'));
 
 $permissionnote=$user->rights->deplacement->creer;	// Used by the include of actions_setnotes.inc.php
 

+ 1 - 1
htdocs/compta/dons/card.php

@@ -50,7 +50,7 @@ $donation_date=dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOS
 $result = restrictedArea($user, 'don', $id);
 
 // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
-$hookmanager->initHooks(array('doncard'));
+$hookmanager->initHooks(array('doncard','globalcard'));
 
 
 /*

+ 1 - 1
htdocs/compta/facture.php

@@ -101,7 +101,7 @@ if ($id > 0 || ! empty($ref)) {
 }
 
 // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
-$hookmanager->initHooks(array('invoicecard'));
+$hookmanager->initHooks(array('invoicecard','globalcard'));
 
 $permissionnote = $user->rights->facture->creer; // Used by the include of actions_setnotes.inc.php
 

+ 1 - 1
htdocs/compta/paiement.php

@@ -67,7 +67,7 @@ if ($facid > 0)
 }
 
 // Initialize technical object to manage hooks of paiements. Note that conf->hooks_modules contains array array
-$hookmanager->initHooks(array('paiementcard'));
+$hookmanager->initHooks(array('paiementcard','globalcard'));
 
 $parameters=array('socid'=>$socid);
 $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action);    // Note that $action and $object may have been modified by some hooks

+ 1 - 1
htdocs/compta/salaries/card.php

@@ -44,7 +44,7 @@ $result = restrictedArea($user, 'salaries', '', '', '');
 $sal = new PaymentSalary($db);
 
 // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
-$hookmanager->initHooks(array('salarycard'));
+$hookmanager->initHooks(array('salarycard','globalcard'));
 
 
 

+ 1 - 1
htdocs/compta/tva/card.php

@@ -42,7 +42,7 @@ $result = restrictedArea($user, 'tax', '', '', 'charges');
 $tva = new Tva($db);
 
 // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
-$hookmanager->initHooks(array('taxvatcard'));
+$hookmanager->initHooks(array('taxvatcard','globalcard'));
 
 
 

+ 1 - 1
htdocs/contact/card.php

@@ -74,7 +74,7 @@ if (! empty($canvas))
 $result = restrictedArea($user, 'contact', $id, 'socpeople&societe', '', '', 'rowid', $objcanvas); // If we create a contact with no company (shared contacts), no check on write permission
 
 // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
-$hookmanager->initHooks(array('contactcard'));
+$hookmanager->initHooks(array('contactcard','globalcard'));
 
 
 /*

+ 1 - 1
htdocs/contrat/card.php

@@ -66,7 +66,7 @@ $result=restrictedArea($user,'contrat',$id);
 $usehm=(! empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE)?$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE:0);
 
 // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
-$hookmanager->initHooks(array('contractcard'));
+$hookmanager->initHooks(array('contractcard','globalcard'));
 
 $object = new Contrat($db);
 $extrafields = new ExtraFields($db);

+ 1 - 1
htdocs/expedition/card.php

@@ -82,7 +82,7 @@ if ($id > 0 || ! empty($ref))
 }
 
 // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
-$hookmanager->initHooks(array('expeditioncard'));
+$hookmanager->initHooks(array('expeditioncard','globalcard'));
 
 /*
  * Actions

+ 1 - 1
htdocs/fichinter/card.php

@@ -77,7 +77,7 @@ if ($user->societe_id) $socid=$user->societe_id;
 $result = restrictedArea($user, 'ficheinter', $id, 'fichinter');
 
 // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
-$hookmanager->initHooks(array('interventioncard'));
+$hookmanager->initHooks(array('interventioncard','globalcard'));
 
 $object = new Fichinter($db);
 $extrafields = new ExtraFields($db);

+ 1 - 1
htdocs/fourn/card.php

@@ -50,7 +50,7 @@ $result = restrictedArea($user, 'societe&fournisseur', $id, '&societe');
 $object = new Fournisseur($db);
 
 // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
-$hookmanager->initHooks(array('suppliercard'));
+$hookmanager->initHooks(array('suppliercard','globalcard'));
 
 /*
  * Action

+ 1 - 1
htdocs/fourn/commande/card.php

@@ -72,7 +72,7 @@ if ($user->societe_id) $socid=$user->societe_id;
 $result = restrictedArea($user, 'fournisseur', $id, '', 'commande');
 
 // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
-$hookmanager->initHooks(array('ordersuppliercard'));
+$hookmanager->initHooks(array('ordersuppliercard','globalcard'));
 
 $object = new CommandeFournisseur($db);
 $extrafields = new ExtraFields($db);

+ 1 - 1
htdocs/fourn/facture/card.php

@@ -69,7 +69,7 @@ if (! empty($user->societe_id)) $socid=$user->societe_id;
 $result = restrictedArea($user, 'fournisseur', $id, 'facture_fourn', 'facture');
 
 // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
-$hookmanager->initHooks(array('invoicesuppliercard'));
+$hookmanager->initHooks(array('invoicesuppliercard','globalcard'));
 
 $object=new FactureFournisseur($db);
 

+ 1 - 1
htdocs/livraison/card.php

@@ -65,7 +65,7 @@ if ($id > 0 || ! empty($ref)) {
 }
 
 // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
-$hookmanager->initHooks(array('deliverycard'));
+$hookmanager->initHooks(array('deliverycard','globalcard'));
 
 /*
  * Actions

+ 1 - 1
htdocs/product/card.php

@@ -88,7 +88,7 @@ $fieldtype = (! empty($ref) ? 'ref' : 'rowid');
 $result=restrictedArea($user,'produit|service',$fieldvalue,'product&product','','',$fieldtype,$objcanvas);
 
 // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
-$hookmanager->initHooks(array('productcard'));
+$hookmanager->initHooks(array('productcard','globalcard'));
 
 
 

+ 1 - 1
htdocs/product/fournisseurs.php

@@ -60,7 +60,7 @@ if ($user->societe_id) $socid=$user->societe_id;
 $result=restrictedArea($user,'produit|service&fournisseur',$fieldvalue,'product&product','','',$fieldtype);
 
 // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
-$hookmanager->initHooks(array('pricesuppliercard'));
+$hookmanager->initHooks(array('pricesuppliercard','globalcard'));
 $product = new ProductFournisseur($db);
 $product->fetch($id,$ref);
 

+ 1 - 1
htdocs/product/stock/card.php

@@ -49,7 +49,7 @@ if (! $sortorder) $sortorder="DESC";
 $result=restrictedArea($user,'stock');
 
 // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
-$hookmanager->initHooks(array('warehousecard'));
+$hookmanager->initHooks(array('warehousecard','globalcard'));
 
 
 /*

+ 1 - 1
htdocs/projet/card.php

@@ -45,7 +45,7 @@ $mine = GETPOST('mode')=='mine' ? 1 : 0;
 //if (! $user->rights->projet->all->lire) $mine=1;	// Special for projects
 
 // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
-$hookmanager->initHooks(array('projectcard'));
+$hookmanager->initHooks(array('projectcard','globalcard'));
 
 $object = new Project($db);
 $extrafields = new ExtraFields($db);

+ 1 - 1
htdocs/projet/tasks.php

@@ -64,7 +64,7 @@ if ($user->societe_id > 0) $socid = $user->societe_id;
 $result = restrictedArea($user, 'projet', $id);
 
 // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
-$hookmanager->initHooks(array('projecttaskcard'));
+$hookmanager->initHooks(array('projecttaskcard','globalcard'));
 
 $progress=GETPOST('progress', 'int');
 $label=GETPOST('label', 'alpha');

+ 1 - 1
htdocs/projet/tasks/task.php

@@ -50,7 +50,7 @@ if ($user->societe_id > 0) $socid = $user->societe_id;
 if (! $user->rights->projet->lire) accessforbidden();
 
 // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
-$hookmanager->initHooks(array('projecttaskcard'));
+$hookmanager->initHooks(array('projecttaskcard','globalcard'));
 
 $object = new Task($db);
 $extrafields = new ExtraFields($db);

+ 1 - 1
htdocs/resource/card.php

@@ -57,7 +57,7 @@ if( ! $user->rights->resource->read)
 
 $object = new Resource($db);
 
-$hookmanager->initHooks(array('resource_card'));
+$hookmanager->initHooks(array('resource_card','globalcard'));
 $parameters=array('resource_id'=>$id);
 $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action);    // Note that $action and $object may have been modified by some hooks
 if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');

+ 1 - 1
htdocs/societe/commerciaux.php

@@ -37,7 +37,7 @@ $socid = isset($_GET["socid"])?$_GET["socid"]:'';
 if ($user->societe_id) $socid=$user->societe_id;
 $result = restrictedArea($user, 'societe','','');
 
-$hookmanager->initHooks(array('salesrepresentativescard'));
+$hookmanager->initHooks(array('salesrepresentativescard','globalcard'));
 
 /*
  *	Actions

+ 1 - 1
htdocs/societe/soc.php

@@ -77,7 +77,7 @@ if (! empty($canvas))
 $result = restrictedArea($user, 'societe', $socid, '&societe', '', 'fk_soc', 'rowid', $objcanvas);
 
 // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
-$hookmanager->initHooks(array('thirdpartycard'));
+$hookmanager->initHooks(array('thirdpartycard','globalcard'));
 
 
 /*

+ 1 - 1
htdocs/user/card.php

@@ -89,7 +89,7 @@ $extrafields = new ExtraFields($db);
 $extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
 
 // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
-$hookmanager->initHooks(array('usercard'));
+$hookmanager->initHooks(array('usercard','globalcard'));