diff --git a/htdocs/langs/en_US/users.lang b/htdocs/langs/en_US/users.lang
index 3f2c7f5f53a..757e9f1dedf 100644
--- a/htdocs/langs/en_US/users.lang
+++ b/htdocs/langs/en_US/users.lang
@@ -127,3 +127,5 @@ DateLastLogin=Date last login
DatePreviousLogin=Date previous login
IPLastLogin=IP last login
IPPreviousLogin=IP previous login
+ShowAllPerms=Show all permission rows
+HideAllPerms=Hide all permission rows
diff --git a/htdocs/user/perms.php b/htdocs/user/perms.php
index 6dca3bdca83..a35baab0059 100644
--- a/htdocs/user/perms.php
+++ b/htdocs/user/perms.php
@@ -44,6 +44,7 @@ $action = GETPOST('action', 'aZ09');
$confirm = GETPOST('confirm', 'alpha');
$module = GETPOST('module', 'alpha');
$rights = GETPOST('rights', 'int');
+$updatedmodulename = GETPOST('updatedmodulename', 'alpha');
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'userperms'; // To manage different context of search
if (!isset($id) || empty($id)) {
@@ -307,6 +308,13 @@ if ($reshook < 0) {
}
+print "\n";
+print '
';
+
print "\n";
print '';
print '
';
@@ -469,17 +477,17 @@ if ($result) {
$picto = ($objMod->picto ? $objMod->picto : 'generic');
// Show break line
- print '';
+ print '
';
print '| ';
print img_object('', $picto, 'class="pictoobjectwidth paddingright"').' '.$objMod->getName();
print '';
print ' | ';
if (($caneditperms && empty($objMod->rights_admin_allowed)) || empty($object->admin)) {
if ($caneditperms) {
- print '';
- print 'id.'&action=addrights&token='.newToken().'&entity='.$entity.'&module='.$obj->module.'&confirm=yes">'.$langs->trans("All")."";
+ print ' | module && $module != "allmodules" ? ' style="display:none"' : '').'>';
+ 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">'.$langs->trans("None")."";
+ print 'id.'&action=delrights&token='.newToken().'&entity='.$entity.'&module='.$obj->module.'&confirm=yes&updatedmodulename='.$obj->module.'">'.$langs->trans("None")."";
print ' | ';
}
print ' | ';
@@ -495,12 +503,14 @@ if ($result) {
if ($user->admin) {
print ' | ';
}
-
+ print 'module || $module == "allmodules" ? ' style="display:none"' : '').'>';
+ print ' ';
+ print ' | ';
print '
'."\n";
}
print ''."\n";
- print '';
+ print '
module && $module != "allmodules" ? ' style="display:none"' : '').'>';
// Picto and label of module
print '| ';
@@ -517,7 +527,7 @@ if ($result) {
print ' | ';
} elseif (in_array($obj->id, $permsuser)) { // Permission granted by user
if ($caneditperms) {
- print 'id.'&action=delrights&token='.newToken().'&entity='.$entity.'&rights='.$obj->id.'&confirm=yes">';
+ print ' | id.'&action=delrights&token='.newToken().'&entity='.$entity.'&rights='.$obj->id.'&confirm=yes&updatedmodulename='.$obj->module.'">';
//print img_edit_remove($langs->trans("Remove"));
print img_picto($langs->trans("Remove"), 'switch_on');
print ' | ';
@@ -538,7 +548,7 @@ if ($result) {
} else {
// Do not own permission
if ($caneditperms) {
- print 'id.'&action=addrights&entity='.$entity.'&rights='.$obj->id.'&confirm=yes&token='.newToken().'">';
+ print ' | id.'&action=addrights&entity='.$entity.'&rights='.$obj->id.'&confirm=yes&token='.newToken().'&updatedmodulename='.$obj->module.'">';
//print img_edit_add($langs->trans("Add"));
print img_picto($langs->trans("Add"), 'switch_off');
print ' | ';
@@ -548,7 +558,7 @@ if ($result) {
} else {
// Do not own permission
if ($caneditperms) {
- print 'id.'&action=addrights&entity='.$entity.'&rights='.$obj->id.'&confirm=yes&token='.newToken().'">';
+ print ' | id.'&action=addrights&entity='.$entity.'&rights='.$obj->id.'&confirm=yes&token='.newToken().'&updatedmodulename='.$obj->module.'">';
//print img_edit_add($langs->trans("Add"));
print img_picto($langs->trans("Add"), 'switch_off');
print ' | ';
@@ -587,6 +597,41 @@ if ($result) {
print '
';
print '
';
+print '';
+
$parameters = array();
$reshook = $hookmanager->executeHooks('insertExtraFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) {