This is an automated email from the ASF dual-hosted git repository. jleroux pushed a commit to branch trunk in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git
The following commit(s) were added to refs/heads/trunk by this push: new 2721a78b4d Improved: Have timesheetMenuLocation (OFBIZ-12973) (#768) 2721a78b4d is described below commit 2721a78b4d1544e6035098ef1f7d277eb0a7d7f1 Author: Pierre Smits <pierre.sm...@somonar.com> AuthorDate: Tue Apr 16 15:52:45 2024 +0200 Improved: Have timesheetMenuLocation (OFBIZ-12973) (#768) * Improved: Have timesheetMenuLocation (OFBIZ-12973) Timesheet screens are used in other components c.q. applications as PortalPagePortlets. Thus requiring a separate MenuLocation in web.xml modified: in WORKEFFORT - web.xml: added context-param timesheetMenuLocation - CommonScreens.xml: changed menu location from hard-coded to parameterized - WorkEffoortMenus.xml: added TimeSheetTabBar removed: TimesheetMenus.xml * correcting typo --- .../workeffort/webapp/workeffort/WEB-INF/web.xml | 5 +++ applications/workeffort/widget/CommonScreens.xml | 2 +- applications/workeffort/widget/TimesheetMenus.xml | 40 ---------------------- applications/workeffort/widget/WorkEffortMenus.xml | 19 +++++++++- 4 files changed, 24 insertions(+), 42 deletions(-) diff --git a/applications/workeffort/webapp/workeffort/WEB-INF/web.xml b/applications/workeffort/webapp/workeffort/WEB-INF/web.xml index 31bb189521..b861ea7df4 100644 --- a/applications/workeffort/webapp/workeffort/WEB-INF/web.xml +++ b/applications/workeffort/webapp/workeffort/WEB-INF/web.xml @@ -50,6 +50,11 @@ under the License. <param-name>calendarMenuLocation</param-name> <param-value>component://workeffort/widget/WorkEffortMenus.xml</param-value> </context-param> + <context-param> + <description>The location of the calendar menus file to be used in this webapp; referred to as a context variable in screen def XML files.</description> + <param-name>timesheetMenuLocation</param-name> + <param-value>component://workeffort/widget/WorkEffortMenus.xml</param-value> + </context-param> <filter> <display-name>ControlFilter</display-name> diff --git a/applications/workeffort/widget/CommonScreens.xml b/applications/workeffort/widget/CommonScreens.xml index dbcb67e480..13d1d58bce 100644 --- a/applications/workeffort/widget/CommonScreens.xml +++ b/applications/workeffort/widget/CommonScreens.xml @@ -142,7 +142,7 @@ under the License. <section> <condition><not><if-empty field="timesheetId"/></not></condition> <widgets> - <include-menu name="TimesheetTabBar" location="component://workeffort/widget/TimesheetMenus.xml"/> + <include-menu name="TimesheetTabBar" location="${parameters.timesheetMenuLocation}"/> <container style="button-bar"> <link text="${uiLabelMap.WorkEffortTimesheetCreate}" target="EditTimesheet" style="buttontext create"/> </container> diff --git a/applications/workeffort/widget/TimesheetMenus.xml b/applications/workeffort/widget/TimesheetMenus.xml deleted file mode 100644 index 24d3b69117..0000000000 --- a/applications/workeffort/widget/TimesheetMenus.xml +++ /dev/null @@ -1,40 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you under the Apache License, Version 2.0 (the -"License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, -software distributed under the License is distributed on an -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, either express or implied. See the License for the -specific language governing permissions and limitations -under the License. ---> -<menus xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://ofbiz.apache.org/Widget-Menu" xsi:schemaLocation="http://ofbiz.apache.org/Widget-Menu http://ofbiz.apache.org/dtds/widget-menu.xsd"> - - <menu name="TimesheetTabBar" extends="CommonTabBarMenu" extends-resource="component://common/widget/CommonMenus.xml" - default-menu-item-name="Timesheet"> - <menu-item name="Timesheet" title="${uiLabelMap.WorkEffortTimesheet}"> - <link target="EditTimesheet"> - <parameter param-name="timesheetId"/> - </link> - </menu-item> - <menu-item name="TimesheetRoles" title="${uiLabelMap.PartyParties}"> - <link target="EditTimesheetRoles"> - <parameter param-name="timesheetId"/> - </link> - </menu-item> - <menu-item name="TimesheetEntries" title="${uiLabelMap.CommonEntries}"> - <link target="EditTimesheetEntries"> - <parameter param-name="timesheetId"/> - </link> - </menu-item> - </menu> -</menus> diff --git a/applications/workeffort/widget/WorkEffortMenus.xml b/applications/workeffort/widget/WorkEffortMenus.xml index 7efb00a61c..3e591665c9 100644 --- a/applications/workeffort/widget/WorkEffortMenus.xml +++ b/applications/workeffort/widget/WorkEffortMenus.xml @@ -389,5 +389,22 @@ under the License. </link> </menu-item> </menu> - + <menu name="TimesheetTabBar" extends="CommonTabBarMenu" extends-resource="component://common/widget/CommonMenus.xml" + default-menu-item-name="Timesheet"> + <menu-item name="Timesheet" title="${uiLabelMap.WorkEffortTimesheet}"> + <link target="EditTimesheet"> + <parameter param-name="timesheetId"/> + </link> + </menu-item> + <menu-item name="TimesheetRoles" title="${uiLabelMap.PartyParties}"> + <link target="EditTimesheetRoles"> + <parameter param-name="timesheetId"/> + </link> + </menu-item> + <menu-item name="TimesheetEntries" title="${uiLabelMap.CommonEntries}"> + <link target="EditTimesheetEntries"> + <parameter param-name="timesheetId"/> + </link> + </menu-item> + </menu> </menus>