From 840437d312ce755f36ee727c093f018cb37463e2 Mon Sep 17 00:00:00 2001 From: Yoan Mollard Date: Tue, 19 Jul 2022 23:55:55 +0200 Subject: [PATCH 1/2] Fixed labels for permission errors --- htdocs/expensereport/card.php | 2 +- htdocs/expensereport/list.php | 2 +- htdocs/langs/en_US/main.lang | 3 ++- htdocs/user/bank.php | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 2e811445c90..8770c23ce42 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -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)) { diff --git a/htdocs/expensereport/list.php b/htdocs/expensereport/list.php index 760c25e4db8..ed03f603a18 100644 --- a/htdocs/expensereport/list.php +++ b/htdocs/expensereport/list.php @@ -482,7 +482,7 @@ if ($resql) { if ($canedit) { print ''.$langs->trans("AddTrip").''; } else { - print ''.$langs->trans("AddTrip").''; + print ''.$langs->trans("AddTrip").''; } print ''; diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 6cb069d53c3..b31a8335fb5 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -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 diff --git a/htdocs/user/bank.php b/htdocs/user/bank.php index 59f593f5b74..d2379388cb4 100644 --- a/htdocs/user/bank.php +++ b/htdocs/user/bank.php @@ -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.'&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); From 46075188b2461f0d9901e77afac2d59f199cf0dd Mon Sep 17 00:00:00 2001 From: atm-lena Date: Thu, 21 Jul 2022 15:59:46 +0200 Subject: [PATCH 2/2] Tasks List Search : several same lines --- htdocs/projet/tasks/list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index 697969c6060..4af49c7a3d5 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -322,7 +322,7 @@ $sql .= " t.rowid as id, t.ref, t.label, t.planned_workload, t.duration_effectiv $sql .= " t.description, t.fk_task_parent"; $sql .= " ,t.budget_amount"; // We'll need these fields in order to filter by categ -if ($search_categ) { +if ($search_categ > 0) { $sql .= ", cs.fk_categorie, cs.fk_project"; } // Add sum fields @@ -342,7 +342,7 @@ $sql .= $hookmanager->resPrint; $sql .= " FROM ".MAIN_DB_PREFIX."projet as p"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on p.fk_soc = s.rowid"; // We'll need this table joined to the select in order to filter by categ -if (!empty($search_categ)) { +if ($search_categ > 0) { $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_project as cs ON p.rowid = cs.fk_project"; // We'll need this table joined to the select in order to filter by categ } $sql .= ", ".MAIN_DB_PREFIX."projet_task as t";