Fix menu accountancy not visible with module "comptabilite"
This commit is contained in:
parent
c1c21846ab
commit
e2efeeef9a
@ -710,6 +710,7 @@ class User extends CommonObject
|
|||||||
global $conf;
|
global $conf;
|
||||||
// For compatibility with bad naming permissions on module
|
// For compatibility with bad naming permissions on module
|
||||||
$moduletomoduletouse = array(
|
$moduletomoduletouse = array(
|
||||||
|
'compta' => 'comptabilite',
|
||||||
'contract' => 'contrat',
|
'contract' => 'contrat',
|
||||||
'member' => 'adherent',
|
'member' => 'adherent',
|
||||||
'mo' => 'mrp',
|
'mo' => 'mrp',
|
||||||
@ -738,7 +739,8 @@ class User extends CommonObject
|
|||||||
|
|
||||||
$moduleRightsMapping = array(
|
$moduleRightsMapping = array(
|
||||||
'product' => 'produit', // We must check $user->rights->produit...
|
'product' => 'produit', // We must check $user->rights->produit...
|
||||||
'margin' => 'margins'
|
'margin' => 'margins',
|
||||||
|
'comptabilite' => 'compta'
|
||||||
);
|
);
|
||||||
|
|
||||||
$rightsPath = $module;
|
$rightsPath = $module;
|
||||||
@ -760,8 +762,10 @@ class User extends CommonObject
|
|||||||
// In $conf->modules, we have 'accounting', 'product', 'facture', ...
|
// In $conf->modules, we have 'accounting', 'product', 'facture', ...
|
||||||
// In $user->rights, we have 'accounting', 'produit', 'facture', ...
|
// In $user->rights, we have 'accounting', 'produit', 'facture', ...
|
||||||
//var_dump($module);
|
//var_dump($module);
|
||||||
|
//var_dump($rightsPath);
|
||||||
//var_dump($this->rights->$rightsPath);
|
//var_dump($this->rights->$rightsPath);
|
||||||
//var_dump($conf->modules);
|
//var_dump($conf->modules);
|
||||||
|
//var_dump($module.' '.isModEnabled($module).' '.$rightsPath.' '.$permlevel1.' '.$permlevel2);
|
||||||
if (!isModEnabled($module)) {
|
if (!isModEnabled($module)) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -778,6 +782,7 @@ class User extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
//var_dump($this->rights);
|
//var_dump($this->rights);
|
||||||
|
//var_dump($rightsPath.' '.$permlevel1.' '.$permlevel2);
|
||||||
if (empty($rightsPath) || empty($this->rights) || empty($this->rights->$rightsPath) || empty($permlevel1)) {
|
if (empty($rightsPath) || empty($this->rights) || empty($this->rights->$rightsPath) || empty($permlevel1)) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user