Merge pull request #21532 from ymollard/bugfix-perms

Fix labels for permission errors
This commit is contained in:
Laurent Destailleur 2022-07-21 16:51:00 +02:00 committed by GitHub
commit a0698bbdf5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 4 deletions

View File

@ -263,7 +263,7 @@ if (empty($reshook)) {
if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->expensereport->creer))
|| (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->expensereport->creer) && empty($user->rights->expensereport->writeall_advance))) {
$error++;
setEventMessages($langs->trans("NotEnoughPermission"), null, 'errors');
setEventMessages($langs->trans("NotEnoughPermissions"), null, 'errors');
}
if (!$error) {
if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || empty($user->rights->expensereport->writeall_advance)) {

View File

@ -482,7 +482,7 @@ if ($resql) {
if ($canedit) {
print '<a href="'.DOL_URL_ROOT.'/expensereport/card.php?action=create&fk_user_author='.$fuser->id.'" class="butAction">'.$langs->trans("AddTrip").'</a>';
} else {
print '<a href="#" class="butActionRefused" title="'.$langs->trans("NotEnoughPermission").'">'.$langs->trans("AddTrip").'</a>';
print '<a href="#" class="butActionRefused" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans("AddTrip").'</a>';
}
print '</div>';

View File

@ -344,7 +344,7 @@ KiloBytes=Kilobytes
MegaBytes=Megabytes
GigaBytes=Gigabytes
TeraBytes=Terabytes
UserAuthor=Ceated by
UserAuthor=Created by
UserModif=Updated by
b=b.
Kb=Kb
@ -709,6 +709,7 @@ FeatureDisabled=Feature disabled
MoveBox=Move widget
Offered=Offered
NotEnoughPermissions=You don't have permission for this action
UserNotInHierachy=This action is reserved to the supervisors of this user
SessionName=Session name
Method=Method
Receive=Receive

View File

@ -692,7 +692,7 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac
if ($permissiontoaddbankaccount) {
$morehtmlright = dolGetButtonTitle($langs->trans('Add'), '', 'fa fa-plus-circle', $_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=create');
} else {
$morehtmlright = dolGetButtonTitle($langs->trans('Add'), 'NotEnoughPermission', 'fa fa-plus-circle', '', '', -2);
$morehtmlright = dolGetButtonTitle($langs->trans('Add'), $langs->trans('NotEnoughPermissions'), 'fa fa-plus-circle', '', '', -2);
}
} else {
$morehtmlright = dolGetButtonTitle($langs->trans('Add'), 'AlreadyOneBankAccount', 'fa fa-plus-circle', '', '', -2);