From 0d0c4c8fbd23fa950673cadb64e5abaee9b06ae1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lorenzo=20Tilve=20=C3=81lvaro?= Date: Mon, 9 Jul 2012 19:02:48 +0200 Subject: [PATCH] Moved Timesheet Lines List page from 'Reports' menu section to 'Cost' Permissions for default profiles were also updated accordingly. FEA: ItEr76S04BugFixing --- .../business/users/bootstrap/PredefinedProfiles.java | 5 ++--- .../libreplan/business/users/entities/UserRole.java | 2 +- .../org/libreplan/web/common/CustomMenuController.java | 10 +++++----- .../libreplan-webapp-spring-security-config.xml | 2 +- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/libreplan-business/src/main/java/org/libreplan/business/users/bootstrap/PredefinedProfiles.java b/libreplan-business/src/main/java/org/libreplan/business/users/bootstrap/PredefinedProfiles.java index c3a7211b5..a4ff28c61 100644 --- a/libreplan-business/src/main/java/org/libreplan/business/users/bootstrap/PredefinedProfiles.java +++ b/libreplan-business/src/main/java/org/libreplan/business/users/bootstrap/PredefinedProfiles.java @@ -49,7 +49,7 @@ import static org.libreplan.business.users.entities.UserRole.ROLE_TASK_SCHEDULIN import static org.libreplan.business.users.entities.UserRole.ROLE_TEMPLATES; import static org.libreplan.business.users.entities.UserRole.ROLE_TIMESHEETS; import static org.libreplan.business.users.entities.UserRole.ROLE_TIMESHEETS_TEMPLATES; -import static org.libreplan.business.users.entities.UserRole.ROLE_TIMESHEET_LINES_LIST_REPORT; +import static org.libreplan.business.users.entities.UserRole.ROLE_TIMESHEET_LINES_LIST; import static org.libreplan.business.users.entities.UserRole.ROLE_TOTAL_WORKED_HOURS_BY_RESOURCE_IN_A_MONTH_REPORT; import static org.libreplan.business.users.entities.UserRole.ROLE_USER_ACCOUNTS; import static org.libreplan.business.users.entities.UserRole.ROLE_VIRTUAL_WORKERS; @@ -96,7 +96,7 @@ public enum PredefinedProfiles { TIME_TRACKING_AND_EXPENSES_RESPONSIBLE( "Time Tracking & Expenses Responsible", ROLE_TIMESHEETS, ROLE_TIMESHEETS_TEMPLATES, ROLE_EXPENSES, ROLE_HOURS_TYPES, - ROLE_TIMESHEET_LINES_LIST_REPORT, + ROLE_TIMESHEET_LINES_LIST, ROLE_HOURS_WORKED_PER_RESOURCE_REPORT, ROLE_TOTAL_WORKED_HOURS_BY_RESOURCE_IN_A_MONTH_REPORT), @@ -105,7 +105,6 @@ public enum PredefinedProfiles { ROLE_SEND_TO_CUSTOMERS, ROLE_RECEIVED_FROM_CUSTOMERS), REPORTS_RESPONSIBLE("Reports Responsible", ROLE_READ_ALL_PROJECTS, - ROLE_TIMESHEET_LINES_LIST_REPORT, ROLE_HOURS_WORKED_PER_RESOURCE_REPORT, ROLE_TOTAL_WORKED_HOURS_BY_RESOURCE_IN_A_MONTH_REPORT, ROLE_WORK_AND_PROGRESS_PER_PROJECT_REPORT, diff --git a/libreplan-business/src/main/java/org/libreplan/business/users/entities/UserRole.java b/libreplan-business/src/main/java/org/libreplan/business/users/entities/UserRole.java index bbbbcfccc..6f3d2c394 100644 --- a/libreplan-business/src/main/java/org/libreplan/business/users/entities/UserRole.java +++ b/libreplan-business/src/main/java/org/libreplan/business/users/entities/UserRole.java @@ -70,7 +70,7 @@ public enum UserRole { ROLE_RECEIVED_FROM_SUBCONTRACTORS(_("Received From Subcontractors")), ROLE_SEND_TO_CUSTOMERS(_("Send To Customers")), ROLE_RECEIVED_FROM_CUSTOMERS(_("Received From Customers")), - ROLE_TIMESHEET_LINES_LIST_REPORT(_("Timesheet Lines List Report")), + ROLE_TIMESHEET_LINES_LIST(_("Timesheet Lines List")), ROLE_HOURS_WORKED_PER_RESOURCE_REPORT(_("Hours Worked Per Resource Report")), ROLE_TOTAL_WORKED_HOURS_BY_RESOURCE_IN_A_MONTH_REPORT(_("Total Worked Hours By Resource In A Month Report")), ROLE_WORK_AND_PROGRESS_PER_PROJECT_REPORT(_("Work And Progress Per Project Report")), diff --git a/libreplan-webapp/src/main/java/org/libreplan/web/common/CustomMenuController.java b/libreplan-webapp/src/main/java/org/libreplan/web/common/CustomMenuController.java index c28b199a2..18bfd0956 100644 --- a/libreplan-webapp/src/main/java/org/libreplan/web/common/CustomMenuController.java +++ b/libreplan-webapp/src/main/java/org/libreplan/web/common/CustomMenuController.java @@ -366,6 +366,11 @@ public class CustomMenuController extends Div implements IMenuItemsRegister { costItems.add(subItem(_("Timesheets Templates"), "/workreports/workReportTypes.zul", "09-partes.html#id2")); } + if (SecurityUtils + .isSuperuserOrUserInRoles(UserRole.ROLE_TIMESHEET_LINES_LIST)) { + costItems.add(subItem(_("Timesheet Lines List"), + "/workreports/workReportQuery.zul", "09-partes.html#id4")); + } if (SecurityUtils.isSuperuserOrUserInRoles(UserRole.ROLE_EXPENSES)) { costItems.add(subItem(_("Expenses"), "/expensesheet/expenseSheet.zul", "")); @@ -439,11 +444,6 @@ public class CustomMenuController extends Div implements IMenuItemsRegister { } List reportsItems = new ArrayList(); - if (SecurityUtils - .isSuperuserOrUserInRoles(UserRole.ROLE_TIMESHEET_LINES_LIST_REPORT)) { - reportsItems.add(subItem(_("Timesheet Lines List"), - "/workreports/workReportQuery.zul", "09-partes.html#id4")); - } if (SecurityUtils .isSuperuserOrUserInRoles(UserRole.ROLE_HOURS_WORKED_PER_RESOURCE_REPORT)) { reportsItems.add(subItem(_("Hours Worked Per Resource"), diff --git a/libreplan-webapp/src/main/resources/libreplan-webapp-spring-security-config.xml b/libreplan-webapp/src/main/resources/libreplan-webapp-spring-security-config.xml index 2af18777b..0349da62f 100644 --- a/libreplan-webapp/src/main/resources/libreplan-webapp-spring-security-config.xml +++ b/libreplan-webapp/src/main/resources/libreplan-webapp-spring-security-config.xml @@ -96,7 +96,7 @@ + access="ROLE_SUPERUSER,ROLE_TIMESHEET_LINES_LIST" />