From 9a435a1f1bde3eb3e34c653ed813b54d8e9f09d3 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Thu, 10 Nov 2022 14:19:29 +0100 Subject: [PATCH] Update perms.php --- htdocs/user/perms.php | 88 +++++++++++++++++++++++++++++++------------ 1 file changed, 63 insertions(+), 25 deletions(-) diff --git a/htdocs/user/perms.php b/htdocs/user/perms.php index a35baab0059..8f7d152e73a 100644 --- a/htdocs/user/perms.php +++ b/htdocs/user/perms.php @@ -268,7 +268,7 @@ print '
'; print ''; // Login -print ''; +print ''; if (!empty($object->ldap_sid) && $object->statut == 0) { print '
'.$langs->trans("Login").'
'.$langs->trans("Login").''; print $langs->trans("LoginAccountDisableInDolibarr"); @@ -307,14 +307,6 @@ if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } - -print "\n"; -print '
'; -print ''.$langs->trans("ShowAllPerms").""; -print ' / '; -print ''.$langs->trans("HideAllPerms").""; -print '
'; - print "\n"; print '
'; print ''; @@ -328,13 +320,22 @@ if (($caneditperms && empty($objMod->rights_admin_allowed)) || empty($object->ad print ' / '; print ''.$langs->trans("None").""; print ''; + } else { + print ''; } print ''; +} else { + print ''; + print ''; } + print ''; -if ($user->admin) { - print ''; -} +print ''; + print ''."\n"; @@ -477,7 +478,7 @@ if ($result) { $picto = ($objMod->picto ? $objMod->picto : 'generic'); // Show break line - print ''; + print ''; print ''; + print ''; + } else { + print ''; } print ''; } else { if ($caneditperms) { - print ''; + print ''; + print ''; + } else { + print ''; } print ''; } print ''; - // Permission id - if ($user->admin) { - print ''; - } - print ''; + print ''; //Add picto + / - when open en closed print ''."\n"; } @@ -521,6 +533,8 @@ if ($result) { if (!empty($object->admin) && !empty($objMod->rights_admin_allowed)) { // Permission granted because admin if ($caneditperms) { print ''; + } else { + print ''; } print ''; + } else { + print ''; } print ''; + } else { + print ''; } print ''; + } else { + print ''; } print ''; } @@ -562,13 +582,19 @@ if ($result) { //print img_edit_add($langs->trans("Add")); print img_picto($langs->trans("Add"), 'switch_off'); print ''; + } else { + print ''; } print ''; } // Description of permission $permlabel = (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ($langs->trans("PermissionAdvanced".$obj->id) != ("PermissionAdvanced".$obj->id)) ? $langs->trans("PermissionAdvanced".$obj->id) : (($langs->trans("Permission".$obj->id) != ("Permission".$obj->id)) ? $langs->trans("Permission".$obj->id) : $langs->trans($obj->label))); - print '
    '.$langs->trans("Permissions").''; +print ''.img_picto('', 'folder-open', 'class="paddingright"').''.$langs->trans("ExpandAll").''; +print ' | '; +print ''.img_picto('', 'folder', 'class="paddingright"').''.$langs->trans("UndoExpandAll").''; +print '
'; print img_object('', $picto, 'class="pictoobjectwidth paddingright"').' '.$objMod->getName(); print ''; @@ -489,23 +490,34 @@ if ($result) { print ' / '; print 'module.'&confirm=yes&updatedmodulename='.$obj->module.'">'.$langs->trans("None").""; print 'module || $module == "allmodules" ? ' style="display:none"' : '').'>    module && $module != "allmodules" ? ' style="display:none"' : '').'>'; + print 'module.'&confirm=yes&updatedmodulename='.$obj->module.'">'.$langs->trans("All").""; + print ' / '; + print 'module.'&confirm=yes&updatedmodulename='.$obj->module.'">'.$langs->trans("None").""; + print 'module || $module == "allmodules" ? ' style="display:none"' : '').'>   module || $module == "allmodules" ? ' style="display:none"' : '').'>'; - print ' '; - print ''; + print '
'; + print img_picto('', 'folder', 'class="marginright"'); + print '
'; + print ''; + print '
'.img_picto($langs->trans("Administrator"), 'star').' '; print img_picto($langs->trans("Active"), 'tick'); @@ -531,6 +545,8 @@ if ($result) { //print img_edit_remove($langs->trans("Remove")); print img_picto($langs->trans("Remove"), 'switch_on'); print ' '; print img_picto($langs->trans("Active"), 'tick'); @@ -541,6 +557,8 @@ if ($result) { print ''; print $form->textwithtooltip($langs->trans("Inherited"), $langs->trans("PermissionInheritedFromAGroup")); print ' '; print img_picto($langs->trans("Active"), 'tick'); @@ -552,6 +570,8 @@ if ($result) { //print img_edit_add($langs->trans("Add")); print img_picto($langs->trans("Add"), 'switch_off'); print '    '; + if (!$user->admin) { + print ''; + } else { + print ''; + } print $permlabel; if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS)) { if (preg_match('/_advance$/', $obj->perms)) { @@ -598,15 +624,20 @@ print '
'; 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) {