new: when initHook() and restrictedArea() exists always execute first initHook() (#30703)

This commit is contained in:
HENRY Florian 2024-08-20 23:32:43 +02:00 committed by GitHub
parent 4db05d65a5
commit d551f200f2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
77 changed files with 221 additions and 185 deletions

View File

@ -36,15 +36,15 @@ $langs->loadLangs(array("admin", "members", "ldap"));
$id = GETPOSTINT('rowid');
$action = GETPOST('action', 'aZ09');
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(array('membertypeldapcard', 'globalcard'));
// Security check
$result = restrictedArea($user, 'adherent', $id, 'adherent_type');
$object = new AdherentType($db);
$object->fetch($id);
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(array('membertypeldapcard', 'globalcard'));
/*
* Actions
*/

View File

@ -68,11 +68,11 @@ if (!isModEnabled('barcode')) {
if (!$user->hasRight('barcode', 'read')) {
accessforbidden();
}
restrictedArea($user, 'barcode');
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(array('printsheettools'));
restrictedArea($user, 'barcode');
$parameters = array();
// Note that $action and $object may have been modified by some

View File

@ -54,6 +54,9 @@ if ($id == "") {
exit();
}
// Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array('categorycard'));
// Security check
$result = restrictedArea($user, 'categorie', $id, '&category');
@ -72,9 +75,6 @@ if (is_numeric($type)) {
$extrafields = new ExtraFields($db);
$extrafields->fetch_name_optionals_label($object->table_element);
// Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array('categorycard'));
$error = 0;

View File

@ -48,6 +48,9 @@ if ($id == '' && $label == '') {
exit();
}
// Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array('categorycard'));
// Security check
$result = restrictedArea($user, 'categorie', $id, '&category');
@ -65,8 +68,6 @@ if (is_numeric($type)) {
$upload_dir = $conf->categorie->multidir_output[$object->entity];
$hookmanager->initHooks(array('categorycard'));
/*
* Actions
*/

View File

@ -73,6 +73,9 @@ if ($id == "" && $label == "") {
exit();
}
// Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array('categorycard', 'globalcard'));
// Security check
$result = restrictedArea($user, 'categorie', $id, '&category');
@ -91,9 +94,6 @@ if (is_numeric($type)) {
$extrafields = new ExtraFields($db);
$extrafields->fetch_name_optionals_label($object->table_element);
// Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array('categorycard', 'globalcard'));
/*
* Actions
*/

View File

@ -59,6 +59,8 @@ if ($user->socid) {
$action = '';
$socid = $user->socid;
}
$hookmanager->initHooks(array('contactlist'));
$result = restrictedArea($user, 'societe', $socid, '');

View File

@ -47,6 +47,7 @@ if ($user->socid > 0) {
$action = '';
$id = $user->socid;
}
$hookmanager->initHooks(array('thirdpartyprice', 'globalcard'));
$result = restrictedArea($user, 'societe', $id, '&societe', '', 'fk_soc', 'rowid', 0);

View File

@ -68,8 +68,8 @@ $socid = '';
if (!empty($user->socid)) {
$socid = $user->socid;
}
$result = restrictedArea($user, 'propal', $object->id);
$hookmanager->initHooks(array('proposalcontactcard', 'globalcard'));
$result = restrictedArea($user, 'propal', $object->id);
$usercancreate = $user->hasRight("propal", "creer");

View File

@ -177,13 +177,13 @@ if (!empty($socid)) {
$module = 'societe';
$dbtable = '&societe';
}
$hookmanager->initHooks(array('propallist'));
$result = restrictedArea($user, $module, $objectid, $dbtable);
$diroutputmassaction = $conf->propal->multidir_output[$conf->entity].'/temp/massgeneration/'.$user->id;
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$object = new Propal($db);
$hookmanager->initHooks(array('propallist'));
$extrafields = new ExtraFields($db);
// fetch optionals attributes and labels

View File

@ -49,7 +49,6 @@ if ($user->socid) {
$hookmanager->initHooks(array('ordercontact', 'globalcard'));
$result = restrictedArea($user, 'commande', $id, '');
$hookmanager->initHooks(array('ordercontactcard', 'globalcard'));
$usercancreate = $user->hasRight("commande", "creer");

View File

@ -74,12 +74,14 @@ if ($user->socid) {
$socid = $user->socid;
}
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(array('bankline'));
$result = restrictedArea($user, 'banque', $accountoldid, 'bank_account');
if (!$user->hasRight('banque', 'lire') && !$user->hasRight('banque', 'consolidate')) {
accessforbidden();
}
$hookmanager->initHooks(array('bankline'));
$object = new AccountLine($db);
$extrafields = new ExtraFields($db);
$extrafields->fetch_name_optionals_label($object->element);

View File

@ -49,15 +49,14 @@ $fieldid = GETPOSTISSET("ref") ? 'ref' : 'rowid';
if ($user->socid) {
$socid = $user->socid;
}
$result = restrictedArea($user, 'banque', $id, 'bank_account&bank_account', '', '', $fieldid);
$vline = GETPOST('vline');
$page = GETPOSTISSET("page") ? GETPOST("page") : 0;
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(array('banktreso', 'globalcard'));
$result = restrictedArea($user, 'banque', $id, 'bank_account&bank_account', '', '', $fieldid);
$vline = GETPOST('vline');
$page = GETPOSTISSET("page") ? GETPOST("page") : 0;
/*
* View

View File

@ -67,13 +67,14 @@ $socid = GETPOSTINT("socid");
if ($user->socid) {
$socid = $user->socid;
}
$result = restrictedArea($user, 'banque', '', '', '');
$object = new PaymentVarious($db);
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(array('variouscard', 'globalcard'));
$result = restrictedArea($user, 'banque', '', '', '');
$object = new PaymentVarious($db);
$permissiontoadd = $user->hasRight('banque', 'modifier');

View File

@ -43,6 +43,10 @@ $id = GETPOSTINT('id');
if ($user->socid) {
$socid = $user->socid;
}
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(array('tripsandexpensescard', 'globalcard'));
$result = restrictedArea($user, 'deplacement', $id, '');
$action = GETPOST('action', 'aZ09');
@ -50,9 +54,6 @@ $confirm = GETPOST('confirm', 'alpha');
$object = new Deplacement($db);
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(array('tripsandexpensescard', 'globalcard'));
$permissionnote = $user->hasRight('deplacement', 'creer'); // Used by the include of actions_setnotes.inc.php

View File

@ -56,9 +56,10 @@ $object = new Facture($db);
if ($id > 0 || !empty($ref)) {
$ret = $object->fetch($id, $ref, '', '', (getDolGlobalString('INVOICE_USE_SITUATION') ? $conf->global->INVOICE_USE_SITUATION : 0));
}
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(array('invoicecontactcard', 'globalcard'));
$result = restrictedArea($user, 'facture', $object->id);
$hookmanager->initHooks(array('invoicecontactcard', 'globalcard'));
$usercancreate = $user->hasRight("facture", "creer");

View File

@ -50,13 +50,16 @@ $date_endyear = GETPOST('date_endyear');
if ($user->socid > 0) {
$socid = $user->socid;
}
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(['purchasejournallist']);
if (isModEnabled('comptabilite')) {
$result = restrictedArea($user, 'compta', '', '', 'resultat');
}
if (isModEnabled('accounting')) {
$result = restrictedArea($user, 'accounting', '', '', 'comptarapport');
}
$hookmanager->initHooks(['purchasejournallist']);
/*
* Actions

View File

@ -52,13 +52,16 @@ $date_endyear = GETPOST('date_endyear');
if ($user->socid > 0) {
$socid = $user->socid;
}
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(['selljournallist']);
if (isModEnabled('comptabilite')) {
$result = restrictedArea($user, 'compta', '', '', 'resultat');
}
if (isModEnabled('accounting')) {
$result = restrictedArea($user, 'accounting', '', '', 'comptarapport');
}
$hookmanager->initHooks(['selljournallist']);
/*
* Actions

View File

@ -48,13 +48,12 @@ $socid = GETPOSTINT('socid');
if ($user->socid) {
$socid = $user->socid;
}
$result = restrictedArea($user, 'tax', '', '', 'charges');
$object = new Localtax($db);
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(array('localtaxvatcard', 'globalcard'));
$result = restrictedArea($user, 'tax', '', '', 'charges');
$object = new Localtax($db);
/**
* Actions

View File

@ -105,13 +105,16 @@ $socid = GETPOSTINT('socid');
if ($user->socid) {
$socid = $user->socid;
}
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(['customerlocaltaxlist']);
$result = restrictedArea($user, 'tax', '', '', 'charges');
if (empty($local)) {
accessforbidden('Parameter localTaxType is missing');
exit;
}
$hookmanager->initHooks(['customerlocaltaxlist']);
$calc = 0;
/*

View File

@ -56,6 +56,10 @@ $socid = GETPOSTINT('socid');
if ($user->socid) {
$socid = $user->socid;
}
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(array('withdrawalsreceiptsrejectedlist'));
if ($type == 'bank-transfer') {
$result = restrictedArea($user, 'paymentbybanktransfer', '', '', '');
} else {
@ -88,9 +92,6 @@ $line = new LignePrelevement($db);
$thirdpartystatic = new Societe($db);
$userstatic = new User($db);
$hookmanager->initHooks(array('withdrawalsreceiptsrejectedlist'));
// List of invoices
$sql = "SELECT pl.rowid, pr.motif, p.ref, pl.statut, p.rowid as bonId,";

View File

@ -42,6 +42,9 @@ if ($user->socid > 0) {
$id = $user->socid;
}
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(array('recapcomptacard', 'globalcard'));
$result = restrictedArea($user, 'societe', $id, '&societe');
$object = new Societe($db);
@ -49,8 +52,6 @@ if ($id > 0) {
$object->fetch($id);
}
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(array('recapcomptacard', 'globalcard'));
// Load variable for pagination
$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;

View File

@ -151,14 +151,16 @@ $socid = GETPOSTINT('socid');
if ($user->socid > 0) {
$socid = $user->socid;
}
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(['customersupplierreportlist']);
if (isModEnabled('comptabilite')) {
$result = restrictedArea($user, 'compta', '', '', 'resultat');
}
if (isModEnabled('accounting')) {
$result = restrictedArea($user, 'accounting', '', '', 'comptarapport');
}
$hookmanager->initHooks(['customersupplierreportlist']);
/*
* View

View File

@ -159,13 +159,13 @@ $socid = GETPOSTINT('socid');
if ($user->socid > 0) {
$socid = $user->socid;
}
$hookmanager->initHooks(['resultreportlist']);
if (isModEnabled('comptabilite')) {
$result = restrictedArea($user, 'compta', '', '', 'resultat');
}
if (isModEnabled('accounting')) {
$result = restrictedArea($user, 'accounting', '', '', 'comptarapport');
}
$hookmanager->initHooks(['resultreportlist']);
/*
* View

View File

@ -44,6 +44,10 @@ $socid = GETPOSTINT('socid');
if ($user->socid > 0) {
$socid = $user->socid;
}
// Hook
$hookmanager->initHooks(array('cabyprodservlist'));
if (isModEnabled('comptabilite')) {
$result = restrictedArea($user, 'compta', '', '', 'resultat');
}
@ -83,9 +87,6 @@ if ($selected_type == '') {
$selected_type = -1;
}
// Hook
$hookmanager->initHooks(array('cabyprodservlist'));
// Date range
$year = GETPOST("year");
$month = GETPOST("month");

View File

@ -40,13 +40,13 @@ $socid = GETPOSTINT('socid');
if ($user->socid > 0) {
$socid = $user->socid;
}
$hookmanager->initHooks(['cabyuserreportlist']);
if (isModEnabled('comptabilite')) {
$result = restrictedArea($user, 'compta', '', '', 'resultat');
}
if (isModEnabled('accounting')) {
$result = restrictedArea($user, 'accounting', '', '', 'comptarapport');
}
$hookmanager->initHooks(['cabyuserreportlist']);
// Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES')
$modecompta = getDolGlobalString('ACCOUNTING_MODE');
if (GETPOST("modecompta")) {

View File

@ -72,6 +72,10 @@ if (GETPOST('subcat', 'alpha') === 'yes') {
if ($user->socid > 0) {
$socid = $user->socid;
}
// Hook
$hookmanager->initHooks(array('casoclist'));
if (isModEnabled('comptabilite')) {
$result = restrictedArea($user, 'compta', '', '', 'resultat');
}
@ -79,9 +83,6 @@ if (isModEnabled('accounting')) {
$result = restrictedArea($user, 'accounting', '', '', 'comptarapport');
}
// Hook
$hookmanager->initHooks(array('casoclist'));
// Date range
$year = GETPOSTINT("year");
$month = GETPOSTINT("month");

View File

@ -90,6 +90,10 @@ $search_agenda_label = GETPOST('search_agenda_label');
if ($user->socid) {
$socid = $user->socid;
}
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(array('contactagenda', 'globalcard'));
$result = restrictedArea($user, 'contact', $id, 'socpeople&societe', '', '', 'rowid', 0); // If we create a contact with no company (shared contacts), no check on write permission
$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
@ -109,9 +113,6 @@ if (!$sortorder) {
$sortorder = 'DESC';
}
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(array('contactagenda', 'globalcard'));
/*
* Actions

View File

@ -65,10 +65,6 @@ if ($contextpage == 'poslist') {
$id = GETPOSTINT('id');
$contactid = GETPOSTINT('id');
$ref = ''; // There is no ref for contacts
if ($user->socid > 0) {
$socid = $user->socid;
}
$result = restrictedArea($user, 'contact', $contactid, '');
$search_all = trim((GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'));
$search_cti = preg_replace('/^0+/', '', preg_replace('/[^0-9]/', '', GETPOST('search_cti', 'alphanohtml'))); // Phone number without any special chars
@ -189,6 +185,11 @@ $object = new Contact($db);
$extrafields = new ExtraFields($db);
$hookmanager->initHooks(array($contextpage));
if ($user->socid > 0) {
$socid = $user->socid;
}
$result = restrictedArea($user, 'contact', $contactid, '');
// fetch optionals attributes and labels
$extrafields->fetch_name_optionals_label($object->table_element);

View File

@ -49,15 +49,13 @@ if ($user->socid > 0) {
accessforbidden();
}
}
$result = restrictedArea($user, 'contact', $id, 'socpeople&societe');
$permissionnote = $user->hasRight('societe', 'creer'); // Used by the include of actions_setnotes.inc.php
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
// $hookmanager->initHooks(array('contactcard')); -> Name conflict with product/card.php
$hookmanager->initHooks(array('contactnote'));
$result = restrictedArea($user, 'contact', $id, 'socpeople&societe');
$permissionnote = $user->hasRight('societe', 'creer'); // Used by the include of actions_setnotes.inc.php
/*
* Actions

View File

@ -30,11 +30,12 @@ $langs->loadLangs(array("contacts", "companies", "projects"));
// Security check
$id = GETPOSTINT('id');
$result = restrictedArea($user, 'contact', $id, 'socpeople&societe');
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(array('projectcontact'));
$result = restrictedArea($user, 'contact', $id, 'socpeople&societe');
/*
* Actions
*/

View File

@ -64,6 +64,10 @@ if ($user->socid) {
// Security check
$fieldvalue = (!empty($id) ? $id : (!empty($ref) ? $ref : ''));
$fieldtype = (!empty($id) ? 'rowid' : 'ref');
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(array('agendacontract', 'globalcard'));
$result = restrictedArea($user, 'contrat', $fieldvalue, '', '', '', $fieldtype);
$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
@ -89,9 +93,6 @@ if ($id > 0 || !empty($ref)) {
$result = $object->fetch($id, $ref);
}
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(array('agendacontract', 'globalcard'));
$permissiontoadd = $user->hasRight('contrat', 'creer'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
$result = restrictedArea($user, 'contrat', $object->id);

View File

@ -135,6 +135,9 @@ $id = GETPOSTINT('id');
if ($user->socid > 0) {
$socid = $user->socid;
}
$hookmanager->initHooks(array('contractlist'));
$result = restrictedArea($user, 'contrat', $id);
$diroutputmassaction = $conf->contrat->dir_output.'/temp/massgeneration/'.$user->id;
@ -148,7 +151,6 @@ if ($search_status == '') {
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$object = new Contrat($db);
$hookmanager->initHooks(array('contractlist'));
$extrafields = new ExtraFields($db);
// fetch optionals attributes and labels

View File

@ -65,6 +65,10 @@ $id = GETPOSTINT('id');
if ($user->socid) {
$socid = $user->socid;
}
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(array('deliverycard', 'globalcard'));
$result = restrictedArea($user, 'expedition', $id, 'delivery', 'delivery');
$object = new Delivery($db);
@ -79,9 +83,6 @@ $extrafields->fetch_name_optionals_label($object->table_element_line);
// Load object. Make an object->fetch
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(array('deliverycard', 'globalcard'));
$error = 0;

View File

@ -82,6 +82,9 @@ $error = 0;
if ($user->socid) {
$socid = $user->socid;
}
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(array('ecmindexcard', 'globalcard'));
$result = restrictedArea($user, 'ecm', 0);
$permissiontoread = $user->hasRight('ecm', 'read');
@ -90,9 +93,6 @@ $permissiontocreatedir = $user->hasRight('ecm', 'setup');
$permissiontodelete = $user->hasRight('ecm', 'upload');
$permissiontodeletedir = $user->hasRight('ecm', 'setup');
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(array('ecmindexcard', 'globalcard'));
/*
* Actions
*/

View File

@ -87,16 +87,16 @@ $error = 0;
if ($user->socid) {
$socid = $user->socid;
}
$result = restrictedArea($user, 'ecm', 0);
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(array('ecmautocard', 'globalcard'));
$result = restrictedArea($user, 'ecm', 0);
/*
* Actions
*/
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(array('ecmautocard', 'globalcard'));
// Purge search criteria
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers
$search_doc_ref = '';

View File

@ -92,6 +92,10 @@ $error = 0;
if ($user->socid) {
$socid = $user->socid;
}
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(array('ecmmediascard', 'globalcard'));
$result = restrictedArea($user, 'ecm', 0);
$permissiontouploadfile = ($user->hasRight('ecm', 'setup') || $user->hasRight('mailing', 'creer') || $user->hasRight('website', 'write'));
@ -104,9 +108,6 @@ $websitekey = '';
$permissiontoadd = $permissiontouploadfile; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(array('ecmmediascard', 'globalcard'));
/*
* Actions
*/

View File

@ -69,8 +69,8 @@ if ($id > 0 || !empty($ref)) {
if ($user->socid) {
$socid = $user->socid;
}
$result = restrictedArea($user, 'expedition', $object->id, '');
$hookmanager->initHooks(array('shipmentcontactcard', 'globalcard'));
$result = restrictedArea($user, 'expedition', $object->id, '');
/*
* Actions

View File

@ -55,12 +55,6 @@ $mode = GETPOST('mode', 'alpha');
$childids = $user->getAllChildIds(1);
// Security check
$socid = GETPOSTINT('socid');
if ($user->socid) {
$socid = $user->socid;
}
$result = restrictedArea($user, 'expensereport', '', '');
$id = GETPOSTINT('id');
// If we are on the view of a specific user
if ($id > 0) {
@ -137,9 +131,16 @@ if ($search_user == '') {
$search_user = -1;
}
// Security check
$socid = GETPOSTINT('socid');
if ($user->socid) {
$socid = $user->socid;
}
$hookmanager->initHooks(array('expensereportlist'));
$result = restrictedArea($user, 'expensereport', '', '');
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$object = new ExpenseReport($db);
$hookmanager->initHooks(array('expensereportlist'));
$extrafields = new ExtraFields($db);
// fetch optionals attributes and labels

View File

@ -66,6 +66,10 @@ $id = (GETPOSTINT('socid') ? GETPOSTINT('socid') : GETPOSTINT('id'));
if ($user->socid) {
$id = $user->socid;
}
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(array('thirdpartysupplier', 'globalcard'));
$result = restrictedArea($user, 'societe&fournisseur', $id, '&societe', '', 'rowid');
$object = new Fournisseur($db);
@ -74,8 +78,7 @@ $extrafields = new ExtraFields($db);
// fetch optionals attributes and labels
$extrafields->fetch_name_optionals_label($object->table_element);
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(array('thirdpartysupplier', 'globalcard'));
// Security check
$result = restrictedArea($user, 'societe', $id, '&societe', '', 'fk_soc', 'rowid', 0);

View File

@ -46,8 +46,8 @@ $action = GETPOST('action', 'aZ09');
if ($user->socid) {
$socid = $user->socid;
}
$result = restrictedArea($user, 'fournisseur', $id, 'commande_fournisseur', 'commande');
$hookmanager->initHooks(array('ordersuppliercardcontact', 'ordersuppliercontactcard', 'globalcard'));
$result = restrictedArea($user, 'fournisseur', $id, 'commande_fournisseur', 'commande');
$object = new CommandeFournisseur($db);

View File

@ -76,15 +76,15 @@ $socid = 0;
if ($user->socid) {
$socid = $user->socid;
}
// Init Hooks
$hookmanager->initHooks(array('ordersuppliercardinfo'));
$result = restrictedArea($user, 'fournisseur', $id, 'commande_fournisseur', 'commande');
if (!$user->hasRight("fournisseur", "commande", "lire")) {
accessforbidden();
}
// Init Hooks
$hookmanager->initHooks(array('ordersuppliercardinfo'));
$usercancreate = ($user->hasRight("fournisseur", "commande", "creer") || $user->hasRight("supplier_order", "creer"));
$permissiontoadd = $usercancreate; // Used by the include of actions_addupdatedelete.inc.php

View File

@ -47,8 +47,8 @@ $action = GETPOST('action', 'aZ09');
if ($user->socid) {
$socid = $user->socid;
}
$result = restrictedArea($user, 'fournisseur', $id, 'facture_fourn', 'facture');
$hookmanager->initHooks(array('invoicesuppliercardcontact','invoicesuppliercontactcard', 'globalcard'));
$result = restrictedArea($user, 'fournisseur', $id, 'facture_fourn', 'facture');
$object = new FactureFournisseur($db);

View File

@ -51,8 +51,8 @@ $ref = GETPOST('ref', 'alpha');
if ($user->socid) {
$socid = $user->socid;
}
$result = restrictedArea($user, 'fournisseur', $id, 'facture_fourn', 'facture');
$hookmanager->initHooks(array('invoicesuppliercarddocument'));
$result = restrictedArea($user, 'fournisseur', $id, 'facture_fourn', 'facture');
// Get parameters
$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;

View File

@ -44,8 +44,8 @@ $ref = GETPOST("ref", 'alpha');
if ($user->socid) {
$socid = $user->socid;
}
$result = restrictedArea($user, 'fournisseur', $id, 'facture_fourn', 'facture');
$hookmanager->initHooks(array('invoicesuppliercardinfo'));
$result = restrictedArea($user, 'fournisseur', $id, 'facture_fourn', 'facture');
$object = new FactureFournisseur($db);

View File

@ -38,6 +38,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/import.lib.php';
// Load translation files required by the page
$langs->loadLangs(array('exports', 'compta', 'errors', 'projects', 'admin'));
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(array('imports'));
// Security check
$result = restrictedArea($user, 'import');
@ -147,11 +150,6 @@ $enclosure = (GETPOST('enclosure', 'nohtml') ? GETPOST('enclosure', 'nohtml')
$charset = GETPOST('charset', 'aZ09');
$separator_used = str_replace('\t', "\t", $separator);
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(array('imports'));
$objimport = new Import($db);
$objimport->load_arrays($user, ($step == 1 ? '' : $datatoimport));

View File

@ -58,12 +58,11 @@ $socid = GETPOSTINT('socid');
if ($user->socid) {
$socid = $user->socid;
}
$hookmanager->initHooks(array('loancard', 'globalcard'));
$result = restrictedArea($user, 'loan', $id, '', '');
$object = new Loan($db);
$hookmanager->initHooks(array('loancard', 'globalcard'));
$error = 0;

View File

@ -78,12 +78,13 @@ if (!empty($enddatemonth)) {
$enddate = dol_mktime(23, 59, 59, $enddatemonth, $enddateday, $enddateyear);
}
$hookmanager->initHooks(array('marginagentlist'));
// Security check
$result = restrictedArea($user, 'margins');
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$object = new User($db);
$hookmanager->initHooks(array('marginagentlist'));
/*
* Actions

View File

@ -61,14 +61,14 @@ if (!$sortfield) {
$sortfield = "f.datef";
}
$hookmanager->initHooks(array('tabproductmarginlist'));
$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
if (!$user->hasRight('margins', 'liretous')) {
accessforbidden();
}
$hookmanager->initHooks(array('tabproductmarginlist'));
$search_invoice_date_start = '';
$search_invoice_date_end = '';
if (GETPOSTINT('search_invoice_date_start_month')) {

View File

@ -76,6 +76,9 @@ if (isset($user->socid) && $user->socid > 0) {
$socid = $user->socid;
}
// Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array
//$hookmanager->initHooks(array($object->element.'index'));
// Security check (enable the most restrictive one)
//if ($user->socid > 0) accessforbidden();
//if ($user->socid > 0) $socid = $user->socid;

View File

@ -187,6 +187,9 @@ if (!empty($canvas)) {
$fieldvalue = (!empty($id) ? $id : (!empty($ref) ? $ref : ''));
$fieldtype = (!empty($id) ? 'rowid' : 'ref');
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(array('productcard', 'globalcard'));
if ($object->id > 0) {
if ($object->type == $object::TYPE_PRODUCT) {
restrictedArea($user, 'produit', $object->id, 'product&product', '', '');
@ -198,9 +201,6 @@ if ($object->id > 0) {
restrictedArea($user, 'produit|service', 0, 'product&product', '', '', $fieldtype);
}
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(array('productcard', 'globalcard'));
// Permissions
$usercanread = (($object->type == Product::TYPE_PRODUCT && $user->hasRight('produit', 'read')) || ($object->type == Product::TYPE_SERVICE && $user->hasRight('service', 'lire')));
$usercancreate = (($object->type == Product::TYPE_PRODUCT && $user->hasRight('produit', 'creer')) || ($object->type == Product::TYPE_SERVICE && $user->hasRight('service', 'creer')));

View File

@ -42,6 +42,8 @@ $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'in
$backtopage = GETPOST('backtopage', 'alpha');
$include_sub_warehouse = !empty(GETPOST('include_sub_warehouse')) ? GETPOST('include_sub_warehouse') : 0;
$hookmanager->initHooks(array('inventorycard', 'globalcard')); // Note that conf->hooks_modules contains array
if (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS')) {
$result = restrictedArea($user, 'stock', $id);
} else {
@ -55,7 +57,6 @@ $extrafields = new ExtraFields($db);
$includedocgeneration = false;
$diroutputmassaction = null;
// $diroutputmassaction = $conf->stock->dir_output.'/temp/massgeneration/'.$user->id;
$hookmanager->initHooks(array('inventorycard', 'globalcard')); // Note that conf->hooks_modules contains array
// Fetch optionals attributes and labels
$extrafields->fetch_name_optionals_label($object->table_element);

View File

@ -59,6 +59,7 @@ $lineid = GETPOSTINT('lineid');
$batch = GETPOST('batch', 'alphanohtml');
$totalExpectedValuation = 0;
$totalRealValuation = 0;
$hookmanager->initHooks(array('inventorycard')); // Note that conf->hooks_modules contains array
if (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS')) {
$result = restrictedArea($user, 'stock', $id);
} else {
@ -69,7 +70,7 @@ if (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS')) {
$object = new Inventory($db);
$extrafields = new ExtraFields($db);
$diroutputmassaction = $conf->stock->dir_output.'/temp/massgeneration/'.$user->id;
$hookmanager->initHooks(array('inventorycard')); // Note that conf->hooks_modules contains array
// Fetch optionals attributes and labels
$extrafields->fetch_name_optionals_label($object->table_element);

View File

@ -52,6 +52,8 @@ if ($id > 0 || !empty($ref)) {
$permissionnote = ($user->hasRight('produit', 'creer') || $user->hasRight('service', 'creer')); // Used by the include of actions_setnotes.inc.php
$hookmanager->initHooks(array('productnote'));
if ($object->id > 0) {
if ($object->type == $object::TYPE_PRODUCT) {
restrictedArea($user, 'product', $object->id, 'product&product', '', '');
@ -63,10 +65,6 @@ if ($object->id > 0) {
restrictedArea($user, 'product|service', $fieldvalue, 'product&product', '', '', $fieldtype);
}
$hookmanager->initHooks(array('productnote'));
/*
* Actions
*/

View File

@ -42,14 +42,16 @@ $ref = GETPOST('ref', 'alpha');
$fieldvalue = (!empty($id) ? $id : (!empty($ref) ? $ref : ''));
$fieldtype = (!empty($ref) ? 'ref' : 'rowid');
$socid = '';
if (!empty($user->socid)) {
$socid = $user->socid;
}
$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(array('productstatspropal'));
$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
// Load variable for pagination
$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'aZ09comma');

View File

@ -72,13 +72,13 @@ if (!$sortorder) {
$sortorder = "DESC";
}
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(array('warehousecard', 'stocklist', 'globalcard'));
// Security check
//$result=restrictedArea($user,'stock', $id, 'entrepot&stock');
$result = restrictedArea($user, 'stock');
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(array('warehousecard', 'stocklist', 'globalcard'));
$object = new Entrepot($db);
$extrafields = new ExtraFields($db);

View File

@ -50,9 +50,6 @@ if (isModEnabled('productbatch')) {
$langs->load("productbatch");
}
// Security check
$result = restrictedArea($user, 'stock');
$id = GETPOSTINT('id');
$ref = GETPOST('ref', 'alpha');
$msid = GETPOSTINT('msid');
@ -92,9 +89,13 @@ if (!$sortorder) {
$pdluoid = GETPOSTINT('pdluoid');
$hookmanager->initHooks(array('movementlist'));
// Security check
$result = restrictedArea($user, 'stock');
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$object = new MouvementStock($db);
$hookmanager->initHooks(array('movementlist'));
$extrafields = new ExtraFields($db);
$formfile = new FormFile($db);

View File

@ -54,11 +54,12 @@ $fieldtype = 'rowid';
if ($user->socid) {
$socid = $user->socid;
}
$result = restrictedArea($user, 'produit|service');
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(array('productlotdocuments'));
$result = restrictedArea($user, 'produit|service');
// Get parameters
$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'aZ09comma');

View File

@ -45,11 +45,12 @@ $langs->loadLangs(array('products', 'stocks', 'orders'));
if ($user->socid) {
$socid = $user->socid;
}
$result = restrictedArea($user, 'produit|service');
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(array('stockreplenishlist'));
$result = restrictedArea($user, 'produit|service');
//checks if a product has been ordered
$action = GETPOST('action', 'aZ09');

View File

@ -53,6 +53,9 @@ if ($id > 0 || !empty($ref)) {
$object->fetch($id, $ref);
}
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(array('producttranslationcard', 'globalcard'));
if ($object->id > 0) {
if ($object->type == $object::TYPE_PRODUCT) {
restrictedArea($user, 'produit', $object->id, 'product&product', '', '');
@ -64,10 +67,6 @@ if ($object->id > 0) {
restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
}
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(array('producttranslationcard', 'globalcard'));
/*
* Actions
*/

View File

@ -61,11 +61,12 @@ if (getDolGlobalString('PROJECT_ALLOW_COMMENT_ON_PROJECT') && method_exists($obj
// Security check
$socid = 0;
//if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignment.
$result = restrictedArea($user, 'projet', $id, 'projet&project');
$hookmanager->initHooks(array('projectcontactcard', 'globalcard'));
//if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignment.
$result = restrictedArea($user, 'projet', $id, 'projet&project');
/*
* Actions

View File

@ -187,11 +187,12 @@ if (getDolGlobalString('PROJECT_ALLOW_COMMENT_ON_PROJECT') && method_exists($obj
// Security check
$socid = $object->socid;
//if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignment.
$result = restrictedArea($user, 'projet', $object->id, 'projet&project');
$hookmanager->initHooks(array('projectOverview'));
//if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignment.
$result = restrictedArea($user, 'projet', $object->id, 'projet&project');
/*
* View

View File

@ -139,14 +139,15 @@ if (!$sortorder) {
// Security check
$socid = 0;
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(array('projecttaskscard', 'globalcard'));
//if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignment.
$result = restrictedArea($user, 'projet', $id, 'projet&project');
$diroutputmassaction = $conf->project->dir_output.'/tasks/temp/massgeneration/'.$user->id;
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(array('projecttaskscard', 'globalcard'));
$progress = GETPOSTINT('progress');
$budget_amount = GETPOSTFLOAT('budget_amount');
$billable = (GETPOST('billable', 'aZ') == 'yes'? 1 : 0);

View File

@ -69,6 +69,7 @@ $extrafields->fetch_name_optionals_label($object->table_element);
// Load object
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'.
$hookmanager->initHooks(array('resource', 'resource_card', 'globalcard'));
$result = restrictedArea($user, 'resource', $object->id, 'resource');
@ -80,7 +81,6 @@ $permissiontodelete = $user->hasRight('resource', 'delete');
* Actions
*/
$hookmanager->initHooks(array('resource', '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) {

View File

@ -46,6 +46,10 @@ $socid = GETPOSTINT('socid');
if ($user->socid) {
$socid = $user->socid;
}
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(array('consumptionthirdparty', 'globalcard'));
$result = restrictedArea($user, 'societe', $socid, '&societe');
$object = new Societe($db);
if ($socid > 0) {
@ -90,11 +94,6 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
$thirdTypeSelect = GETPOST("third_select_id", 'aZ09');
$type_element = GETPOST('type_element') ? GETPOST('type_element') : '';
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(array('consumptionthirdparty', 'globalcard'));
/*
* Actions
*/

View File

@ -44,6 +44,10 @@ $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always ''
if ($user->socid) {
$socid = $user->socid;
}
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(array('thirdpartynotification', 'globalcard'));
$result = restrictedArea($user, 'societe', '', '');
$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
@ -67,11 +71,6 @@ $now = dol_now();
$object = new Societe($db);
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(array('thirdpartynotification', 'globalcard'));
/*
* Actions
*/

View File

@ -59,14 +59,15 @@ $socid = GETPOSTINT('socid') ? GETPOSTINT('socid') : GETPOSTINT('id');
if ($user->socid) {
$socid = $user->socid;
}
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(array('thirdpartycustomerprice', 'globalcard'));
$result = restrictedArea($user, 'societe', $socid, '&societe');
// Initialize objects
$object = new Societe($db);
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(array('thirdpartycustomerprice', 'globalcard'));
$error = 0;

View File

@ -53,11 +53,12 @@ $socid = GETPOSTINT('socid');
if ($user->socid) {
$socid = $user->socid;
}
$result = restrictedArea($user, 'societe', $socid, '&societe');
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(array('projectthirdparty'));
$result = restrictedArea($user, 'societe', $socid, '&societe');
$object = new Societe($db);
$permissiontodelete = $user->hasRight('societe', 'supprimer');

View File

@ -65,16 +65,16 @@ $pagenext = $page + 1;
if ($user->socid) {
$socid = $user->socid;
}
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(array('contactthirdparty', 'globalcard'));
$result = restrictedArea($user, 'societe', $id, '');
// Initialize objects
$object = new Societe($db);
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(array('contactthirdparty', 'globalcard'));
/*
* Actions
*/

View File

@ -47,14 +47,15 @@ $action = GETPOST('action', 'aZ09');
if ($user->socid) {
$socid = $user->socid;
}
$hookmanager->initHooks(array('supplier_proposalcontactcard', 'globalcard'));
$result = restrictedArea($user, 'supplier_proposal', $id, 'supplier_proposal', '');
$object = new SupplierProposal($db);
$permissiontoedit = $user->hasRight('supplier_proposal', 'creer');
$hookmanager->initHooks(array('supplier_proposalcontactcard', 'globalcard'));
/*
* Actions

View File

@ -68,6 +68,9 @@ if ($user->socid > 0) {
}
$feature2 = (($socid && $user->hasRight('user', 'self', 'creer')) ? '' : 'user');
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(array('usercard', 'useragenda', 'globalcard'));
$result = restrictedArea($user, 'user', $id, 'user&user', $feature2);
// If user is not user that read and no permission to read other users, we stop
@ -75,9 +78,6 @@ if (($object->id != $user->id) && (!$user->hasRight('user', 'user', 'lire'))) {
accessforbidden();
}
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(array('usercard', 'useragenda', 'globalcard'));
/*
* Actions
*/

View File

@ -39,11 +39,10 @@ if ($user->socid > 0) {
}
$feature2 = (($socid && $user->hasRight('user', 'self', 'creer')) ? '' : 'user');
$result = restrictedArea($user, 'user', $id, 'user&user', $feature2);
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(array('usercard', 'globalcard'));
$result = restrictedArea($user, 'user', $id, 'user&user', $feature2);
/*
* Actions

View File

@ -75,6 +75,9 @@ if ($user->socid > 0) {
}
$feature2 = 'user';
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(array('usercard', 'userdoc', 'globalcard'));
$result = restrictedArea($user, 'user', $id, 'user&user', $feature2);
if ($user->id != $id && !$canreaduser) {
@ -108,11 +111,6 @@ if ($id > 0 || !empty($ref)) {
$upload_dir = $conf->user->dir_output."/".$object->id;
}
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(array('usercard', 'userdoc', 'globalcard'));
/*
* Actions
*/

View File

@ -43,15 +43,15 @@ if ($user->socid > 0) {
}
$feature2 = (($socid && $user->hasRight('user', 'self', 'creer')) ? '' : 'user');
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(array('usercard', 'userldap', 'globalcard'));
$result = restrictedArea($user, 'user', $id, 'user&user', $feature2);
$object = new User($db);
$object->fetch($id, '', '', 1);
$object->loadRights();
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(array('usercard', 'userldap', 'globalcard'));
/*
* Actions

View File

@ -59,11 +59,11 @@ if ($user->socid > 0) {
}
$feature2 = (($socid && $user->hasRight("user", "self", "write")) ? '' : 'user');
$result = restrictedArea($user, 'user', $id, 'user&user', $feature2);
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(array('usercard', 'usernote', 'globalcard'));
$result = restrictedArea($user, 'user', $id, 'user&user', $feature2);
/*
* Actions

View File

@ -58,6 +58,9 @@ if ($user->socid > 0) {
}
$feature2 = (($socid && $user->hasRight("user", "self", "write")) ? '' : 'user');
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(array('usercard', 'userihm', 'globalcard'));
$result = restrictedArea($user, 'user', $id, 'user&user', $feature2);
if ($user->id != $id && !$canreaduser) {
accessforbidden();
@ -81,10 +84,6 @@ $searchformtitle=array($langs->trans("Companies"),$langs->trans("Contacts"),$lan
$form = new Form($db);
$formadmin = new FormAdmin($db);
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(array('usercard', 'userihm', 'globalcard'));
/*
* Actions
*/

View File

@ -74,6 +74,9 @@ if ($user->id == $id && (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && !$user
accessforbidden();
}
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(array('usercard', 'userperms', 'globalcard'));
$result = restrictedArea($user, 'user', $id, 'user&user', $feature2);
if ($user->id != $id && !$canreaduser) {
accessforbidden();
@ -85,10 +88,6 @@ $object->loadRights();
$entity = $conf->entity;
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(array('usercard', 'userperms', 'globalcard'));
/*
* Actions
*/

View File

@ -49,6 +49,10 @@ if (!isModEnabled('variants')) {
if ($user->socid > 0) { // Protection if external user
accessforbidden();
}
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(array('productattributecard', 'globalcard'));
$result = restrictedArea($user, 'variants');
$object = new ProductAttribute($db);
@ -56,9 +60,6 @@ $object = new ProductAttribute($db);
// Load object
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'
// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
$hookmanager->initHooks(array('productattributecard', 'globalcard'));
$permissiontoread = $user->hasRight('variants', 'read');
$permissiontoadd = $user->hasRight('variants', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
$permissiontoedit = $user->hasRight('variants', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php