diff --git a/htdocs/user/perms.php b/htdocs/user/perms.php
index 8f7d152e73a..1ededd091b3 100644
--- a/htdocs/user/perms.php
+++ b/htdocs/user/perms.php
@@ -331,9 +331,9 @@ if (($caneditperms && empty($objMod->rights_admin_allowed)) || empty($object->ad
print '
'.$langs->trans("Permissions").' | ';
print '';
-print ''.img_picto('', 'folder-open', 'class="paddingright"').''.$langs->trans("ExpandAll").'';
+print ''.img_picto('', 'folder-open', 'class="paddingright"').''.$langs->trans("ExpandAll").'';
print ' | ';
-print ''.img_picto('', 'folder', 'class="paddingright"').''.$langs->trans("UndoExpandAll").'';
+print ''.img_picto('', 'folder', 'class="paddingright"').''.$langs->trans("UndoExpandAll").'';
print ' | ';
print ''."\n";
@@ -469,6 +469,11 @@ if ($result) {
}
*/
+ $isexpanded = ($updatedmodulename == $obj->module || $module == "allmodules");
+ if (!$action) {
+ $isexpanded = 1; // By default (no action done) we have lines expanded
+ }
+
// Break found, it's a new module to catch
if (isset($obj->module) && ($oldmod <> $obj->module)) {
$oldmod = $obj->module;
@@ -485,24 +490,24 @@ if ($result) {
print '';
if (($caneditperms && empty($objMod->rights_admin_allowed)) || empty($object->admin)) {
if ($caneditperms) {
- print 'module && $module != "allmodules" ? ' style="display:none"' : '').'>';
+ print ' | ';
print 'id.'&action=addrights&token='.newToken().'&entity='.$entity.'&module='.$obj->module.'&confirm=yes&updatedmodulename='.$obj->module.'">'.$langs->trans("All")."";
print ' / ';
print 'id.'&action=delrights&token='.newToken().'&entity='.$entity.'&module='.$obj->module.'&confirm=yes&updatedmodulename='.$obj->module.'">'.$langs->trans("None")."";
print ' | ';
- print 'module || $module == "allmodules" ? ' style="display:none"' : '').'> | ';
+ print ' | ';
} else {
print ' | ';
}
print ' | ';
} else {
if ($caneditperms) {
- print 'module && $module != "allmodules" ? ' style="display:none"' : '').'>';
+ print ' | ';
print 'id.'&action=addrights&token='.newToken().'&entity='.$entity.'&module='.$obj->module.'&confirm=yes&updatedmodulename='.$obj->module.'">'.$langs->trans("All")."";
print ' / ';
print 'id.'&action=delrights&token='.newToken().'&entity='.$entity.'&module='.$obj->module.'&confirm=yes&updatedmodulename='.$obj->module.'">'.$langs->trans("None")."";
print ' | ';
- print 'module || $module == "allmodules" ? ' style="display:none"' : '').'> | ';
+ print ' | ';
} else {
print ' | ';
}
@@ -510,11 +515,11 @@ if ($result) {
}
print ' | ';
- print '';
- print '';
+ print ' ';
+ print ' ';
print img_picto('', 'folder', 'class="marginright"');
print ' ';
- print '';
+ print ' ';
print img_picto('', 'folder-open', 'class="marginright"');
print ' ';
print ' | '; //Add picto + / - when open en closed
@@ -522,7 +527,7 @@ if ($result) {
}
print ''."\n";
- print ' module && $module != "allmodules" ? ' style="display:none"' : '').'>';
+ print ' ';
// Picto and label of module
print '| ';
@@ -625,6 +630,7 @@ print '';
print ' | |