diff --git a/htdocs/admin/perms.php b/htdocs/admin/perms.php index 3aa2803ca4d..88c4adcfca7 100644 --- a/htdocs/admin/perms.php +++ b/htdocs/admin/perms.php @@ -110,7 +110,8 @@ if ($result) } print ''; - print ''.(($langs->trans("Permission".$obj->id)!=("Permission".$obj->id))?$langs->trans("Permission".$obj->id):$obj->libelle) . ''; + $perm_libelle=(($langs->trans("Permission".$obj->id)!=("Permission".$obj->id))?$langs->trans("Permission".$obj->id):$obj->libelle); + print ''.$perm_libelle. ''; print ''.$modules[$obj->module]->getName(). ''; if ($obj->bydefault == 1) { diff --git a/htdocs/user/group/perms.php b/htdocs/user/group/perms.php index f6322ce4008..b215de1509e 100644 --- a/htdocs/user/group/perms.php +++ b/htdocs/user/group/perms.php @@ -135,8 +135,8 @@ if ($_GET["id"]) include_once("../../includes/modules/$file"); $objMod = new $modName($db); if ($objMod->rights_class) { - $modules[$objMod->rights_class]=$modName; - //print "modules[".$objMod->rights_class."]=$modName;"; + $modules[$objMod->rights_class]=$objMod; + //print "modules[".$objMod->rights_class."]=$objMod;"; } } } @@ -146,7 +146,6 @@ if ($_GET["id"]) * Ecran ajout/suppression permission */ - print ''; print ''; if ($user->admin) print ''; @@ -172,12 +171,8 @@ if ($_GET["id"]) $var = !$var; print ''; - // Recupère objet module - $modName=$modules[$obj->module]; - $file = $modName.".class.php"; - include_once("../../includes/modules/$file"); - $objMod = new $modName($db); - + // Recupère objMod + $objMod = $modules[$obj->module]; $picto=($objMod->picto?$objMod->picto:'generic'); } else @@ -206,7 +201,8 @@ if ($_GET["id"]) print ''; } - print ''; + $perm_libelle=(($langs->trans("Permission".$obj->id)!=("Permission".$obj->id))?$langs->trans("Permission".$obj->id):$obj->libelle); + print ''; print ''; diff --git a/htdocs/user/perms.php b/htdocs/user/perms.php index b81f515f842..d89a483a056 100644 --- a/htdocs/user/perms.php +++ b/htdocs/user/perms.php @@ -171,8 +171,8 @@ if ($_GET["id"]) include_once("../includes/modules/$file"); $objMod = new $modName($db); if ($objMod->rights_class) { - $modules[$objMod->rights_class]=$modName; - //print "modules[".$objMod->rights_class."]=$modName;"; + $modules[$objMod->rights_class]=$objMod; + //print "modules[".$objMod->rights_class."]=$objMod;"; } } } @@ -207,12 +207,8 @@ if ($_GET["id"]) $var = !$var; print ''; - // Recupère objet module - $modName=$modules[$obj->module]; - $file = $modName.".class.php"; - include_once("../includes/modules/$file"); - $objMod = new $modName($db); - + // Récupère objMod + $objMod=$modules[$obj->module]; $picto=($objMod->picto?$objMod->picto:'generic'); } else @@ -251,7 +247,8 @@ if ($_GET["id"]) print ''; } - print ''; + $perm_libelle=(($langs->trans("Permission".$obj->id)!=("Permission".$obj->id))?$langs->trans("Permission".$obj->id):$obj->libelle); + print ''; print '';
 
 '.$obj->libelle . ''.$perm_libelle. ''.img_object('',$picto).' '.$objMod->getName(); print '
 '.$obj->libelle . ''.$perm_libelle. ''.img_object('',$picto).' '.$objMod->getName(); print '