From 2fe1b548ef9f4f923ddd2f78033c075a12e2b53a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 2 Oct 2021 19:45:58 +0200 Subject: [PATCH] Show label of permission as tooltip on list of modules/app --- htdocs/admin/system/modules.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/system/modules.php b/htdocs/admin/system/modules.php index 150ca10a359..a56ed8c1da3 100644 --- a/htdocs/admin/system/modules.php +++ b/htdocs/admin/system/modules.php @@ -91,6 +91,7 @@ $modules_files = array(); $modules_fullpath = array(); $modulesdir = dolGetModulesDirs(); $rights_ids = array(); +$arrayofpermissions = array(); foreach ($modulesdir as $dir) { $handle = @opendir(dol_osencode($dir)); @@ -155,7 +156,7 @@ foreach ($modules as $key => $module) { if (empty($rights[0])) { continue; } - + $arrayofpermissions[$rights[0]] = array('label'=> 'user->rights->'.$module->rights_class.'->'.$rights[4].(empty($rights[5]) ? '' : '->'.$rights[5])); $permission[] = $rights[0]; array_push($rights_ids, $rights[0]); @@ -336,8 +337,10 @@ foreach ($moduleList as $module) { $idperms = ''; foreach ($module->permission as $permission) { - $idperms .= ($idperms ? ", " : "").$permission; $translationKey = "Permission".$permission; + $labelpermission = $langs->trans($translationKey); + $labelpermission .= ' : '.$arrayofpermissions[$permission]['label']; + $idperms .= ($idperms ? ", " : "").''.$permission.''; if (!empty($conf->global->MAIN_SHOW_PERMISSION)) { if (empty($langs->tab_translate[$translationKey])) {