mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-06 01:28:19 +01:00
FIX : Implementation of multi-company compatibility with inventory/warehouse management
This commit is contained in:
@@ -902,14 +902,14 @@ function checkUserAccessToObject($user, array $featuresarray, $object = 0, $tabl
|
|||||||
$checkonentitydone = 0;
|
$checkonentitydone = 0;
|
||||||
|
|
||||||
// Array to define rules of checks to do
|
// Array to define rules of checks to do
|
||||||
$check = array('adherent', 'banque', 'bom', 'don', 'mrp', 'user', 'usergroup', 'payment', 'payment_supplier', 'payment_sc', 'product', 'produit', 'service', 'produit|service', 'categorie', 'resource', 'expensereport', 'holiday', 'salaries', 'website', 'recruitment', 'chargesociales', 'knowledgemanagement'); // Test on entity only (Objects with no link to company)
|
$check = array('adherent', 'banque', 'bom', 'don', 'mrp', 'user', 'usergroup', 'payment', 'payment_supplier', 'payment_sc', 'product', 'produit', 'service', 'produit|service', 'categorie', 'resource', 'expensereport', 'holiday', 'salaries', 'website', 'recruitment', 'chargesociales', 'knowledgemanagement', 'stock'); // Test on entity only (Objects with no link to company)
|
||||||
$checksoc = array('societe'); // Test for object Societe
|
$checksoc = array('societe'); // Test for object Societe
|
||||||
$checkparentsoc = array('agenda', 'contact', 'contrat'); // Test on entity + link to third party on field $dbt_keyfield. Allowed if link is empty (Ex: contacts...).
|
$checkparentsoc = array('agenda', 'contact', 'contrat'); // Test on entity + link to third party on field $dbt_keyfield. Allowed if link is empty (Ex: contacts...).
|
||||||
$checkproject = array('projet', 'project'); // Test for project object
|
$checkproject = array('projet', 'project'); // Test for project object
|
||||||
$checktask = array('projet_task', 'project_task'); // Test for task object
|
$checktask = array('projet_task', 'project_task'); // Test for task object
|
||||||
$checkhierarchy = array('expensereport', 'holiday', 'hrm'); // check permission among the hierarchy of user
|
$checkhierarchy = array('expensereport', 'holiday', 'hrm'); // check permission among the hierarchy of user
|
||||||
$checkuser = array('bookmark'); // check permission among the fk_user (must be myself or null)
|
$checkuser = array('bookmark'); // check permission among the fk_user (must be myself or null)
|
||||||
$nocheck = array('barcode', 'stock'); // No test
|
$nocheck = array('barcode'); // No test
|
||||||
|
|
||||||
//$checkdefault = 'all other not already defined'; // Test on entity + link to third party on field $dbt_keyfield. Not allowed if link is empty (Ex: invoice, orders...).
|
//$checkdefault = 'all other not already defined'; // Test on entity + link to third party on field $dbt_keyfield. Not allowed if link is empty (Ex: invoice, orders...).
|
||||||
|
|
||||||
|
|||||||
@@ -42,9 +42,9 @@ $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'inv
|
|||||||
$backtopage = GETPOST('backtopage', 'alpha');
|
$backtopage = GETPOST('backtopage', 'alpha');
|
||||||
|
|
||||||
if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) {
|
if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) {
|
||||||
$result = restrictedArea($user, 'stock', $id);
|
$result = restrictedArea($user, 'stock', $id, 'inventory&stock');
|
||||||
} else {
|
} else {
|
||||||
$result = restrictedArea($user, 'stock', $id, '', 'inventory_advance');
|
$result = restrictedArea($user, 'stock', $id, 'inventory&stock', 'inventory_advance');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initialize technical objects
|
// Initialize technical objects
|
||||||
|
|||||||
@@ -59,9 +59,9 @@ $batch = GETPOST('batch', 'alphanohtml');
|
|||||||
$totalExpectedValuation = 0;
|
$totalExpectedValuation = 0;
|
||||||
$totalRealValuation = 0;
|
$totalRealValuation = 0;
|
||||||
if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) {
|
if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) {
|
||||||
$result = restrictedArea($user, 'stock', $id);
|
$result = restrictedArea($user, 'stock', $id, 'inventory&stock');
|
||||||
} else {
|
} else {
|
||||||
$result = restrictedArea($user, 'stock', $id, '', 'inventory_advance');
|
$result = restrictedArea($user, 'stock', $id, 'inventory&stock', 'inventory_advance');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initialize technical objects
|
// Initialize technical objects
|
||||||
|
|||||||
@@ -70,8 +70,7 @@ if (!$sortorder) {
|
|||||||
$backtopage = GETPOST('backtopage', 'alpha');
|
$backtopage = GETPOST('backtopage', 'alpha');
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
//$result=restrictedArea($user,'stock', $id, 'entrepot&stock');
|
$result=restrictedArea($user,'stock', $id, 'entrepot&stock');
|
||||||
$result = restrictedArea($user, 'stock');
|
|
||||||
|
|
||||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||||
$hookmanager->initHooks(array('warehousecard', 'globalcard'));
|
$hookmanager->initHooks(array('warehousecard', 'globalcard'));
|
||||||
|
|||||||
Reference in New Issue
Block a user