<?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="HumanResAppBar" title="${uiLabelMap.HumanResManager}" extends="CommonAppBarMenu" extends-resource="component://common/widget/CommonMenus.xml">
        <menu-item name="Employees" title="${uiLabelMap.HumanResEmployees}"><link target="findEmployees"/></menu-item>
        <menu-item name="Employment" title="${uiLabelMap.HumanResEmployment}"><link target="FindEmployments"/></menu-item>
        <menu-item name="EmplPosition" title="${uiLabelMap.HumanResEmployeePosition}"><link target="FindEmplPositions"/></menu-item>
        <menu-item name="PerfReview" title="${uiLabelMap.HumanResPerfReview}"><link target="FindPerfReviews"/></menu-item>
        <menu-item name="EmplSkills" title="${uiLabelMap.HumanResSkills}"><link target="FindPartySkills"/></menu-item>
        <menu-item name="PartyQual" title="${uiLabelMap.HumanResPartyQualification}"><link target="FindPartyQuals"/></menu-item>
        <menu-item name="Recruitment" title="${uiLabelMap.HumanResRecruitment}"><link target="FindJobRequisitions"/></menu-item>        
        <menu-item name="Training" title="${uiLabelMap.HumanResTraining}"><link target="TrainingCalendar"/></menu-item>
        <menu-item name="EmploymentApp" title="${uiLabelMap.HumanResEmploymentApp}"><link target="FindEmploymentApps"/></menu-item>
        <menu-item name="PartyResume" title="${uiLabelMap.HumanResPartyResume}"><link target="FindPartyResumes"/></menu-item>
        <menu-item name="Leave" title="${uiLabelMap.HumanResEmplLeave}"><link target="FindEmplLeaves"/></menu-item>
        <menu-item name="GlobalHRSettings" title="${uiLabelMap.HumanResGlobalHRSettings}" selected-style="selected"><link target="globalHRSettings"/></menu-item>
    </menu>
    <menu name="MainActionMenu" menu-container-style="button-bar button-style-2" default-selected-style="selected">
        <menu-item name="NewEmployee" title="${uiLabelMap.HumanResNewEmployee}">
            <condition>
                <or>
                    <if-has-permission permission="HUMANRES" action="_CREATE"/>
                </or>
            </condition>
            <link target="NewEmployee"/>
        </menu-item>
        <menu-item name="NewPosition" title="${uiLabelMap.HumanResNewEmplPosition}">
            <condition>
                <or>
                    <if-has-permission permission="HUMANRES" action="_CREATE"/>
                </or>
            </condition>
            <link target="EditEmplPosition"/>
        </menu-item>
        <menu-item name="NewFulfilmennt" title="${uiLabelMap.HumanResNewEmplPositionFulfillment}">
            <condition>
                <or>
                    <if-has-permission permission="HUMANRES" action="_CREATE"/>
                </or>
            </condition>
            <link target="EditEmplPositionFulfillments"/>
        </menu-item>
        <menu-item name="NewPerformanceReview" title="${uiLabelMap.HumanResNewPartyReview}">
            <condition>
                <or>
                    <if-has-permission permission="HUMANRES" action="_CREATE"/>
                </or>
            </condition>
            <link target="EditPerfReview"/>
        </menu-item>
        <menu-item name="NewLeave" title="${uiLabelMap.HumanResAddEmplLeave}">
            <condition>
                <or>
                    <if-has-permission permission="HUMANRES" action="_CREATE"/>
                </or>
            </condition>
            <link target="EditEmplLeave"/>
        </menu-item>
    </menu>
    <menu name="HumanResShortcutAppBar" title="${uiLabelMap.HumanResManager}">
        <menu-item name="Employees" title="${uiLabelMap.HumanResEmployees}"><link target="/humanres/control/findEmployees" url-mode="inter-app"/></menu-item>
        <menu-item name="Employment" title="${uiLabelMap.HumanResEmployment}"><link target="/humanres/control/FindEmployments" url-mode="inter-app"/></menu-item>
        <menu-item name="EmplPosition" title="${uiLabelMap.HumanResEmployeePosition}"><link target="/humanres/control/FindEmplPositions" url-mode="inter-app"/></menu-item>
        <menu-item name="PerfReview" title="${uiLabelMap.HumanResPerfReview}"><link target="/humanres/control/FindPerfReviews" url-mode="inter-app"/></menu-item>
        <menu-item name="EmplSkills" title="${uiLabelMap.HumanResSkills}"><link target="/humanres/control/FindPartySkills" url-mode="inter-app"/></menu-item>
        <menu-item name="PartyQual" title="${uiLabelMap.HumanResPartyQualification}"><link target="/humanres/control/FindPartyQuals" url-mode="inter-app"/></menu-item>
        <menu-item name="Recruitment" title="${uiLabelMap.HumanResRecruitment}"><link target="/humanres/control/FindJobRequisitions" url-mode="inter-app"/></menu-item>        
        <menu-item name="Training" title="${uiLabelMap.HumanResTraining}"><link target="/humanres/control/TrainingCalendar" url-mode="inter-app"/></menu-item>
        <menu-item name="EmploymentApp" title="${uiLabelMap.HumanResEmploymentApp}"><link target="/humanres/control/FindEmploymentApps" url-mode="inter-app"/></menu-item>
        <menu-item name="PartyResume" title="${uiLabelMap.HumanResPartyResume}"><link target="/humanres/control/FindPartyResumes" url-mode="inter-app"/></menu-item>
        <menu-item name="Leave" title="${uiLabelMap.HumanResEmplLeave}"><link target="/humanres/control/FindEmplLeaves" url-mode="inter-app"/></menu-item>
        <menu-item name="GlobalHRSettings" title="${uiLabelMap.HumanResGlobalHRSettings}" selected-style="selected"><link target="/humanres/control/globalHRSettings" url-mode="inter-app"/></menu-item>
    </menu>
    <menu name="EmploymentBar" default-menu-item-name="EditPartyBenefit" default-selected-style="selected"
        type="simple" menu-container-style="button-bar tab-bar" selected-menuitem-context-field-name="tabButtonItem">
        <actions>
            <set field="emplFromDate" from-field="parameters.emplFromDate" default-value="${parameters.fromDate}"/>
        </actions>
        <menu-item name="EditEmployment" title="${uiLabelMap.HumanResEmployment}">
            <link target="EditEmployment" >
                <parameter param-name="roleTypeIdFrom"/>
                <parameter param-name="roleTypeIdTo"/>
                <parameter param-name="partyIdFrom"/>
                <parameter param-name="partyIdTo"/>
                <parameter param-name="fromDate" from-field="emplFromDate"/>
            </link>
        </menu-item>
        <menu-item name="EditPartyBenefit" title="${uiLabelMap.HumanResEditPartyBenefit}">
            <link target="EditPartyBenefits" >
                <parameter param-name="roleTypeIdFrom"/>
                <parameter param-name="roleTypeIdTo"/>
                <parameter param-name="partyIdFrom"/>
                <parameter param-name="partyIdTo"/>
                <parameter param-name="fromDate" from-field="emplFromDate"/>
            </link>
        </menu-item>
        <menu-item name="EditPayrollPreference" title="${uiLabelMap.HumanResEditPayrollPreference}">
            <link target="EditPayrollPreferences" >
                <parameter param-name="roleTypeIdFrom"/>
                <parameter param-name="roleTypeIdTo"/>
                <parameter param-name="partyIdFrom"/>
                <parameter param-name="partyIdTo"/>
                <parameter param-name="fromDate" from-field="emplFromDate"/>
            </link>
        </menu-item>
        <menu-item name="EditPayHistory" title="${uiLabelMap.HumanResEditPayHistory}">
            <link target="ListPayHistories" >
                <parameter param-name="roleTypeIdFrom"/>
                <parameter param-name="roleTypeIdTo"/>
                <parameter param-name="partyIdFrom"/>
                <parameter param-name="partyIdTo"/>
                <parameter param-name="fromDate" from-field="emplFromDate"/>
            </link>
        </menu-item>
        <menu-item name="EditUnemploymentClaims" title="${uiLabelMap.HumanResEditUnemploymentClaim}">
            <link target="EditUnemploymentClaims" >
                <parameter param-name="roleTypeIdFrom"/>
                <parameter param-name="roleTypeIdTo"/>
                <parameter param-name="partyIdFrom"/>
                <parameter param-name="partyIdTo"/>
                <parameter param-name="fromDate" from-field="emplFromDate"/>
            </link>
        </menu-item>
        <menu-item name="EditAgreementEmploymentAppls" title="${uiLabelMap.HumanResAgreementEmploymentAppl}">
            <link target="EditAgreementEmploymentAppls">
                <parameter param-name="agreementId"/>
                <parameter param-name="agreementItemSeqId"/>
                <parameter param-name="roleTypeIdFrom"/>
                <parameter param-name="roleTypeIdTo"/>
                <parameter param-name="partyIdFrom"/>
                <parameter param-name="partyIdTo"/>
                <parameter param-name="fromDate"/>
            </link>
    </menu-item>
    </menu>
    <menu name="EmplPostionBar" default-menu-item-name="EmplPositionView" type="simple" menu-container-style="button-bar tab-bar" default-selected-style="selected" selected-menuitem-context-field-name="tabButtonItem">
        <menu-item name="EmplPositionView" title="${uiLabelMap.CommonSummary}">
            <link target="emplPositionView">
                <parameter param-name="emplPositionId"/>
            </link>
        </menu-item>
        <menu-item name="EditEmplPosition" title="${uiLabelMap.HumanResEmployeePosition}">
            <link target="EditEmplPosition">
                <parameter param-name="emplPositionId"/>
            </link>
        </menu-item>
        <menu-item name="EditEmplPositionFulfillments" title="${uiLabelMap.HumanResPositionFulfillments}">
            <link target="EditEmplPositionFulfillments">
                <parameter param-name="emplPositionId"/>
            </link>
        </menu-item>
        <menu-item name="EditEmplPositionResponsibilities" title="${uiLabelMap.HumanResEmplPositionResponsibilities}">
            <link target="EditEmplPositionResponsibilities">
                <parameter param-name="emplPositionId"/>
            </link>
        </menu-item>
        <menu-item name="EditEmplPositionReportingStructs" title="${uiLabelMap.HumanResEmplPositionReportingStruct}">
            <link target="EditEmplPositionReportingStructs">
                <parameter param-name="emplPositionId"/>
            </link>
        </menu-item>
    </menu>
    <menu name="PerfReviewBar" extends="CommonTabBarMenu" extends-resource="component://common/widget/CommonMenus.xml">
        <menu-item name="Find" title="${uiLabelMap.CommonFind}">
            <link target="FindPerfReviews"/>
        </menu-item>
        <menu-item name="EditPerfReview" title="${uiLabelMap.HumanResPerfReview}">
            <link target="EditPerfReview">
                <parameter param-name="employeePartyId"/>
                <parameter param-name="employeeRoleTypeId"/>
                <parameter param-name="perfReviewId"/>
            </link>
        </menu-item>
        <menu-item name="EditPerfReviewItems" title="${uiLabelMap.HumanResEditPerfReviewItems}">
            <link target="EditPerfReviewItems">
                <parameter param-name="employeePartyId"/>
                <parameter param-name="employeeRoleTypeId"/>
                <parameter param-name="perfReviewId"/>
            </link>
        </menu-item>
    </menu>
    <menu name="SalaryBar" default-menu-item-name="EditSalaryStep" default-selected-style="selected"
        type="simple" menu-container-style="button-bar tab-bar" selected-menuitem-context-field-name="subTabButtonItem">
        <menu-item name="EditPayGrade" title="${uiLabelMap.HumanResPayGrade}">
            <link target="EditPayGrade">
                <parameter param-name="payGradeId"/>
            </link>
        </menu-item>
        <menu-item name="EditSalaryStep" title="${uiLabelMap.HumanResEditSalaryStep}">
            <link target="EditSalarySteps">
                <parameter param-name="payGradeId"/>
            </link>
        </menu-item>
    </menu>
    <menu name="SkillType" type="simple" id="app-navigation" default-selected-style="selected" selected-menuitem-context-field-name="tabButtonItem"/>

    <menu name="GlobalHRSettingMenus" type="simple" default-menu-item-name="SkillType"
        menu-container-style="button-bar tab-bar" selected-menuitem-context-field-name="tabButtonItem" default-selected-style="selected">
        <menu-item name="SkillType" title="${uiLabelMap.HumanResSkillType}">
            <link target="EditSkillTypes"/>
        </menu-item>
        <menu-item name="ResponsibilityType" title="${uiLabelMap.HumanResResponsibilityType}">
            <link target="EditResponsibilityTypes"/>
        </menu-item>
        <menu-item name="TerminationReason" title="${uiLabelMap.HumanResTerminationReason}">
            <link target="EditTerminationReasons"/>
        </menu-item>
        <menu-item name="TerminationType" title="${uiLabelMap.HumanResTerminationTypes}">
            <link target="EditTerminationTypes"/>
        </menu-item>
        <menu-item name="EmplPositionTypes" title="${uiLabelMap.HumanResEmplPositionType}">
            <link target="FindEmplPositionTypes"/>
        </menu-item>
        <menu-item name="EmplLeaveType" title="${uiLabelMap.HumanResEmplLeaveType}">
            <link target="EditEmplLeaveTypes"/>
        </menu-item>
        <menu-item name="PayGrade" title="${uiLabelMap.HumanResPayGrade}">
            <link target="FindPayGrades"/>
        </menu-item>
        <menu-item name="JobInterviewType" title="${uiLabelMap.HumanResJobInterviewType}">
            <link target="EditJobInterviewType"/>
        </menu-item>
        <menu-item name="EditTrainingTypes" title="${uiLabelMap.HumanResTrainingClassType}">
            <link target="EditTrainingTypes"/>
        </menu-item>
        <menu-item name="publicHoliday" title="${uiLabelMap.PageTitlePublicHoliday}">
            <link target="PublicHoliday"/>
        </menu-item>
    </menu>

    <menu name="EmployeeProfileTabBar" extends="CommonTabBarMenu" extends-resource="component://common/widget/CommonMenus.xml"
          default-menu-item-name="EditEmployeeSkills">
        <menu-item name="EmployeeProfile" title="${uiLabelMap.PartyProfile}">
            <link target="EmployeeProfile">
                <parameter param-name="partyId"/>
            </link>
        </menu-item>
        <menu-item name="ListEmployment" title="${uiLabelMap.HumanResEmployment}">
            <link target="ListEmployments">
                <parameter param-name="partyId" from-field="parameters.partyId"/>
            </link>
        </menu-item>
        <menu-item name="ListEmplPositions" title="${uiLabelMap.HumanResEmployeePosition}">
            <link target="ListEmplPositions">
                <parameter param-name="partyId" from-field="parameters.partyId"/>
            </link>
        </menu-item>
        <menu-item name="EditEmployeeSkills" title="${uiLabelMap.HumanResSkills}">
            <link target="EditEmployeeSkills">
                <parameter param-name="partyId"/>
            </link>
        </menu-item>
        <menu-item name="EditEmployeeQuals" title="${uiLabelMap.HumanResPartyQualification}">
            <link target="EditEmployeeQuals">
                <parameter param-name="partyId"/>
            </link>
        </menu-item>
        <menu-item name="EditEmployeeTrainings" title="${uiLabelMap.HumanResTraining}">
            <link target="EditEmployeeTrainings">
                <parameter param-name="partyId"/>
            </link>
        </menu-item>
        <!-- I think these don't belong here, I'll get to these in short while.
        <menu-item name="EditEmployeeEmploymentApps" title="${uiLabelMap.HumanResEmploymentApp}">
            <link target="EditEmployeeEmploymentApps">
                <parameter param-name="partyId"/>
            </link>
        </menu-item>
        <menu-item name="EditEmployeeResumes" title="${uiLabelMap.HumanResPartyResume}">
            <link target="EditEmployeeResumes">
                <parameter param-name="partyId"/>
            </link>
        </menu-item>
        <menu-item name="EditEmployeePerformanceNotes" title="${uiLabelMap.HumanResPerfNote}">
            <link target="EditEmployeePerformanceNotes">
                <parameter param-name="partyId"/>
            </link>
        </menu-item> -->
        <menu-item name="EditEmployeeLeaves" title="${uiLabelMap.HumanResEmplLeave}">
            <link target="EditEmployeeLeaves">
                <parameter param-name="partyId"/>
            </link>
        </menu-item>
        <menu-item name="PayrollHistory" title="${uiLabelMap.HumanResPayRollHistory}">
            <link target="PayrollHistory">
                <parameter param-name="partyId"/>
            </link>
        </menu-item>
    </menu>

    <menu name="EmplPositionTypeTabBar" extends="CommonTabBarMenu" extends-resource="component://common/widget/CommonMenus.xml"
          default-menu-item-name="EditEmplPositionType" selected-menuitem-context-field-name="tabButtonItem2">
        <menu-item name="EditEmplPositionType" title="${uiLabelMap.HumanResEmplPositionType}">
            <link target="EditEmplPositionTypes">
                <parameter param-name="emplPositionTypeId"/>
            </link>
        </menu-item>
        <menu-item name="EditValidResponsibilities" title="${uiLabelMap.HumanResEmplPositionResponsibilities}">
            <link target="findValidResponsibilities">
                <parameter param-name="emplPositionTypeId"/>
            </link>
        </menu-item>
        <menu-item name="EditEmplPositionTypeRate" title="${uiLabelMap.HumanResEmplPositionTypeRate}">
            <link target="EditEmplPositionTypeRates">
                <parameter param-name="emplPositionTypeId"/>
            </link>
        </menu-item>
    </menu>
    
    <menu name="RecruitmentTypeMenu" type="simple" extends="CommonTabBarMenu" extends-resource="component://common/widget/CommonMenus.xml"
        default-menu-item-name="JobRequisition">
        <menu-item name="JobRequisition" title="${uiLabelMap.HumanResJobRequisition}">
            <condition><if-has-permission permission="HUMANRES" action="_VIEW"/></condition>
            <link target="FindJobRequisitions"/>
        </menu-item>
        <menu-item name="InternalJobPosting" title="${uiLabelMap.HumanResInternalJobPosting}">
            <condition><if-has-permission permission="HUMANRES" action="_VIEW"/></condition>
            <link target="FindInternalJobPosting"/>
        </menu-item>
    </menu>
    
    <menu name="InternalJobPostingTabBar" extends="CommonTabBarMenu" extends-resource="component://common/widget/CommonMenus.xml"
        default-menu-item-name="InternalJobPosting" type="simple" menu-container-style="button-bar tab-bar" 
        default-selected-style="selected" selected-menuitem-context-field-name="tabButtonItem">
        <menu-item name="InternalJobPosting" title="${uiLabelMap.HumanResInternalJobPosting} ${uiLabelMap.CommonApplications}">
            <link target="FindInternalJobPosting"/>
        </menu-item>
        <menu-item name="JobInterview" title="${uiLabelMap.HumanResJobInterview}">
            <condition><if-has-permission permission="HUMANRES" action="_ADMIN"/></condition>
            <link target="FindJobInterview"/>
        </menu-item>
        <menu-item name="Approval" title="${uiLabelMap.HumanResApproval}">
            <condition><if-has-permission permission="HUMANRES" action="_APPROVE"/></condition>
            <link target="FindApprovals"/>
        </menu-item>
        <menu-item name="Relocation" title="${uiLabelMap.HumanResRelocation}">
            <condition><if-has-permission permission="HUMANRES" action="_ADMIN"/></condition>
            <link target="FindRelocation"/>
        </menu-item>
    </menu>
    
    <menu name="TrainingTypeMenu" type="simple" extends="CommonTabBarMenu" extends-resource="component://common/widget/CommonMenus.xml" default-menu-item-name="FindTrainings">
        <menu-item name="TrainingCalendar" title="${uiLabelMap.HumanResTraining} ${uiLabelMap.WorkEffortCalendar}">
            <link target="TrainingCalendar"/>
        </menu-item>
        <menu-item name="FindTrainingStatus" title="${uiLabelMap.HumanResTrainingStatus}">
            <condition><if-has-permission permission="EMPLOYEE" action="_VIEW"/></condition>
            <link target="FindTrainingStatus"/>
        </menu-item>
        <menu-item name="FindTrainingApprovals" title="${uiLabelMap.HumanResTrainingApprovals}">
            <condition><if-has-permission permission="HUMANRES" action="_ADMIN"/></condition>
            <link target="FindTrainingApprovals"/>
        </menu-item>
    </menu>
    
    <menu name="EmplLeaveReasonTypeTabBar" extends="CommonTabBarMenu" extends-resource="component://common/widget/CommonMenus.xml"
        default-menu-item-name="Employee Leave Reason Type" type="simple" menu-container-style="button-bar tab-bar" 
        default-selected-style="selected" selected-menuitem-context-field-name="tabButtonItem">
        <menu-item name="EmplLeaveType" title="${uiLabelMap.HumanResEmployeeLeaveType}">
            <link target="EditEmplLeaveTypes"/>
        </menu-item>
        <menu-item name="EmplLeaveReasonType" title="${uiLabelMap.HumanResEmployeeType}">
            <link target="EditEmplLeaveReasonTypes"/>
        </menu-item>
    </menu>
    
    <menu name="EmplLeaveTabBar" extends="CommonTabBarMenu" extends-resource="component://common/widget/CommonMenus.xml"
        default-menu-item-name="Employee Leave" type="simple" menu-container-style="button-bar tab-bar" 
        default-selected-style="selected" selected-menuitem-context-field-name="tabButtonItem">
        <menu-item name="EmployeeLeave" title="${uiLabelMap.HumanResEmployeeLeave}">
            <link target="FindEmplLeaves"/>
        </menu-item>
        <menu-item name="Approval" title="${uiLabelMap.HumanResLeaveApproval}">
            <condition><if-has-permission permission="HUMANRES" action="_APPROVE"/></condition>
            <link target="FindLeaveApprovals"/>
        </menu-item>
    </menu>

</menus>
