Show label of permission as tooltip on list of modules/app
This commit is contained in:
parent
7863642daa
commit
2fe1b548ef
@ -91,6 +91,7 @@ $modules_files = array();
|
|||||||
$modules_fullpath = array();
|
$modules_fullpath = array();
|
||||||
$modulesdir = dolGetModulesDirs();
|
$modulesdir = dolGetModulesDirs();
|
||||||
$rights_ids = array();
|
$rights_ids = array();
|
||||||
|
$arrayofpermissions = array();
|
||||||
|
|
||||||
foreach ($modulesdir as $dir) {
|
foreach ($modulesdir as $dir) {
|
||||||
$handle = @opendir(dol_osencode($dir));
|
$handle = @opendir(dol_osencode($dir));
|
||||||
@ -155,7 +156,7 @@ foreach ($modules as $key => $module) {
|
|||||||
if (empty($rights[0])) {
|
if (empty($rights[0])) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
$arrayofpermissions[$rights[0]] = array('label'=> 'user->rights->'.$module->rights_class.'->'.$rights[4].(empty($rights[5]) ? '' : '->'.$rights[5]));
|
||||||
$permission[] = $rights[0];
|
$permission[] = $rights[0];
|
||||||
|
|
||||||
array_push($rights_ids, $rights[0]);
|
array_push($rights_ids, $rights[0]);
|
||||||
@ -336,8 +337,10 @@ foreach ($moduleList as $module) {
|
|||||||
$idperms = '';
|
$idperms = '';
|
||||||
|
|
||||||
foreach ($module->permission as $permission) {
|
foreach ($module->permission as $permission) {
|
||||||
$idperms .= ($idperms ? ", " : "").$permission;
|
|
||||||
$translationKey = "Permission".$permission;
|
$translationKey = "Permission".$permission;
|
||||||
|
$labelpermission = $langs->trans($translationKey);
|
||||||
|
$labelpermission .= ' : '.$arrayofpermissions[$permission]['label'];
|
||||||
|
$idperms .= ($idperms ? ", " : "").'<span title="'.$labelpermission.'">'.$permission.'</a>';
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_SHOW_PERMISSION)) {
|
if (!empty($conf->global->MAIN_SHOW_PERMISSION)) {
|
||||||
if (empty($langs->tab_translate[$translationKey])) {
|
if (empty($langs->tab_translate[$translationKey])) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user