ilscipio/scipio-erp

View on GitHub
applications/humanres/widget/EmployeeScreens.xml

Summary

Maintainability
Test Coverage
<?xml version="1.0" encoding="UTF-8"?>
<!--
This file is subject to the terms and conditions defined in the
files 'LICENSE' and 'NOTICE', which are part of this source
code package.
-->

<screens xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-screen.xsd">
    <screen name="FindEmployee">
        <section>
            <actions>
                <property-map resource="HumanResUiLabels" map-name="uiLabelMap" global="true"/>
                <property-map resource="CommonUiLabels" map-name="uiLabelMap" global="true"/>
                <set field="title" value="${uiLabelMap.CommonFind} ${uiLabelMap.HumanResEmployeeApplicant}"/>
                <set field="activeSubMenuItem" value="Employees"/>
            </actions>
            <widgets>
                <decorator-screen name="CommonHumanResAppDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <section>
                            <actions>
                                <service service-name="findParty" auto-field-map="true"/>
                                <set field="activeSubMenuItem" value="Employee"/>
                                <!-- SCIPIO: without this we display too much all the time -->
                                <set field="findEmplQueryRan" type="Boolean" value="${groovy: (parameters.doFindQuery == 'Y' || (parameters.doFindQuery != 'N' &amp;&amp; context.requestMethod == 'POST'))}"/>
                            </actions>
                            <widgets>
                                <platform-specific>
                                    <html><html-template location="component://humanres/webapp/humanres/humanres/findEmployee.ftl"/></html>
                                </platform-specific>
                            </widgets>
                        </section>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    <screen name="NewEmployee">
        <section>
            <actions>
                <set field="titleProperty" value="HumanResNewEmployeeApplicant"/><!-- PartyCreateNewEmployee -->
                <set field="activeSubMenuItem" value="Employees"/>
                <property-to-field field="defaultCountryGeoId" resource="general" property="country.geo.id.default" default="USA"/>
            </actions>
            <widgets>
                <decorator-screen name="CommonHumanResAppDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <screenlet><!-- SCIPIO: title="${uiLabelMap.HumanResNewEmployee}" -->
                            <section>
                                <actions><!-- SCIPIO -->
                                    <!-- fields for setDependentDropdownValuesJs.ftl -->
                                    <set field="dependentForm" value="NewEmployee"/>
                                    <set field="paramKey" value="countryGeoId"/>
                                    <set field="mainId" value="countryGeoId"/>
                                    <set field="dependentId" value="stateProvinceGeoId"/>
                                    <set field="requestName" value="getAssociatedStateList"/>
                                    <set field="responseName" value="stateList"/>
                                    <set field="dependentKeyName" value="geoId"/>
                                    <set field="descName" value="geoName"/>
                                    <set field="selectedDependentOption" value="_none_"/>
                                    <!--<set field="focusFieldName" value="NewEmployee_USER_PARTY_ID"/>-->
                                </actions>
                                <widgets>
                                    <platform-specific><html><html-template location="component://common/webcommon/includes/setDependentDropdownValuesJs.ftl"/></html></platform-specific>
                                    <include-form name="NewEmployee" location="component://humanres/widget/forms/EmployeeForms.xml"/>
                                </widgets>
                            </section>
                        </screenlet>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    <screen name="EmployeeProfile">
        <section>
            <actions>
                <set field="activeSubMenuItem" value="EmployeeProfile"/>
                <set field="labelTitleProperty" value="PartyTaxAuthInfos"/>
                <set field="partyId" from-field="parameters.partyId"/>
                <set field="layoutSettings.javaScripts[]" value="/partymgr/static/PartyProfileContent.js" global="true"/>
                <script location="component://party/webapp/partymgr/WEB-INF/actions/party/ViewProfile.groovy"/>
                <script location="component://party/webapp/partymgr/WEB-INF/actions/party/GetUserLoginPrimaryEmail.groovy"/>
                <set field="titleProperty" value="HumanResEmployeeApplicantProfile"/><!-- PageTitleViewPartyProfile -->
            </actions>
            <widgets>
                <decorator-screen name="EmployeeDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <section>
                            <condition>
                                <not><if-empty field="party"/></not>
                            </condition>
                            <widgets>
                                <include-menu name="EmployeeProfileSubTarBar" location="component://humanres/widget/HumanresMenus.xml"/><!-- SCIPIO -->
                                <container style="profile-left">
                                    <include-screen name="Party" location="component://party/widget/partymgr/ProfileScreens.xml"/>
                                    <include-screen name="Contact" location="component://party/widget/partymgr/ProfileScreens.xml"/>
                                    <include-screen name="contactsAndAccounts" location="component://party/widget/partymgr/ProfileScreens.xml"/>
                                    <include-screen name="trainingsList"/>
                                </container>
                                <container style="profile-right">
                                    <include-screen name="CurrentEmploymentData" location="component://humanres/widget/EmployeeScreens.xml"/>
                                    <include-screen name="UserLogin" location="component://party/widget/partymgr/ProfileScreens.xml"/>
                                    <include-screen name="EmployeeContent"/>
                                    <include-screen name="Notes" location="component://party/widget/partymgr/ProfileScreens.xml"/>
                                    <include-screen name="Attributes" location="component://party/widget/partymgr/ProfileScreens.xml"/>
                                </container>
                            </widgets>
                            <fail-widgets>
                                <container>
                                    <label style="common-msg-error">${uiLabelMap.PartyNoPartyFoundWithPartyId}: ${parameters.partyId}</label>
                                </container>
                            </fail-widgets>
                        </section>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    <screen name="EditEmployeeSkills">
        <section>
            <actions>
                <set field="titleProperty" value="PageTitleViewPartySkill"/>
                <set field="activeSubMenuItem" value="EditEmployeeSkills"/>
                <set field="partyId" from-field="parameters.partyId"/>
                <set field="skillTypeId" from-field="parameters.skillTypeId"/>
                <set field="partySkillsCtx.partyId" from-field="parameters.partyId"/>
                <set field="parameters.insideEmployee" value="true"/>
            </actions>
            <widgets>
                <decorator-screen name="EmployeeDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <include-form name="ListEmployeeSkills" location="component://humanres/widget/forms/EmployeeForms.xml"/>
                        <screenlet id="AddPartySkillPanel" title="${uiLabelMap.HumanResAddPartySkill}" collapsible="true">
                            <include-form name="AddEmployeeSkills" location="component://humanres/widget/forms/EmployeeForms.xml"/>
                        </screenlet>
                     </decorator-section>
                 </decorator-screen>
            </widgets>
        </section>
    </screen>
    <screen name="EditEmployeeQuals">
        <section>
            <actions>
                <set field="titleProperty" value="HumanResEditPartyQual"/>
                <set field="activeSubMenuItem" value="EditEmployeeQuals"/>
                <set field="partyId" from-field="parameters.partyId"/>
                <set field="partyQualCtx.partyId" from-field="parameters.partyId"/>
                <set field="parameters.insideEmployee" value="true"/>
            </actions>
            <widgets>
                <decorator-screen name="EmployeeDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <include-form name="ListEmployeeQualification" location="component://humanres/widget/forms/EmployeeForms.xml"/>
                        <screenlet id="AddPartyQualPanel" title="${uiLabelMap.HumanResAddPartyQual}" collapsible="true">
                            <include-form name="AddEmployeeQualification" location="component://humanres/widget/forms/EmployeeForms.xml"/>
                        </screenlet>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    <screen name="EditEmployeeTrainings">
        <section>
            <actions>
                <set field="titleProperty" value="HumanResTraining"/>
                <set field="activeSubMenuItem" value="EditEmployeeTrainings"/>
            </actions>
            <widgets>
                <decorator-screen name="EmployeeDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <screenlet id="TrainingStatus" title="${uiLabelMap.HumanResTrainingStatus}"><!-- collapsible="true" -->
                            <include-form name="ListTrainingStatus" location="component://humanres/widget/forms/PersonTrainingForms.xml"/>
                        </screenlet>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    <screen name="EditEmployeeEmploymentApps">
        <section>
            <actions>
                <set field="titleProperty" value="PageTitleViewEmploymentApp"/>
                <set field="activeSubMenuItem" value="EditEmployeeEmploymentApps"/>
                <set field="referredByPartyId" from-field="parameters.partyId"/>
                <set field="employmentAppCtx.applicationId" from-field="parameters.applicationId"/>
                <set field="parameters.insideEmployee" value="true"/>
            </actions>
            <widgets>
                <decorator-screen name="EmployeeDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <include-form name="ListEmploymentApps" location="component://humanres/widget/forms/EmploymentAppForms.xml"/>
                        <screenlet id="AddEmploymentAppPanel" title="${uiLabelMap.CommonAdd} ${uiLabelMap.HumanResEmploymentApp}" collapsible="true">
                            <include-form name="AddEmploymentApp" location="component://humanres/widget/forms/EmploymentAppForms.xml"/>
                        </screenlet>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    <screen name="EditEmployeeResumes">
        <section>
            <actions>
                <set field="activeSubMenuItem" value="EditEmployeeResumes"/>
                <set field="resumeId" from-field="parameters.resumeId"/>
                <set field="partyId" from-field="parameters.partyId"/>
                <entity-one entity-name="PartyResume" value-field="partyResume"/>
            </actions>
            <widgets>
                <decorator-screen name="EmployeeDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <include-form name="ListPartyResumes" location="component://humanres/widget/forms/PartyResumeForms.xml"/>
                        <screenlet id="AddEmploymentAppPanel" title="${uiLabelMap.CommonAdd} ${uiLabelMap.HumanResEditPartyResume}" collapsible="true">
                            <include-form name="EditPartyResume" location="component://humanres/widget/forms/PartyResumeForms.xml"/>
                        </screenlet>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    <screen name="EditEmployeePerformanceNotes">
        <section>
            <actions>
                <set field="titleProperty" value="HumanResPerfNote"/>
                <set field="activeSubMenuItem" value="EditEmployeePerformanceNotes"/>
                <set field="partyId" from-field="parameters.partyId"/>
            </actions>
            <widgets>
                <decorator-screen name="EmployeeDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <include-form name="ListPerformanceNotes" location="component://humanres/widget/forms/EmploymentForms.xml"/>
                        <screenlet id="AddPerformanceNotePanel" title="${uiLabelMap.HumanResAddPerfNote}" collapsible="true">
                            <include-form name="AddPerformanceNote" location="component://humanres/widget/forms/EmploymentForms.xml"/>
                        </screenlet>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    <screen name="EditEmployeeLeaves">
        <section>
            <actions>
                <set field="titleProperty" value="HumanResEditEmplLeave"/>
                <set field="activeSubMenuItem" value="EditEmployeeLeaves"/>
                <set field="partyId" from-field="parameters.partyId"/>
                <entity-one entity-name="EmplLeave" value-field="leaveApp"/>
            </actions>
            <widgets>
                <decorator-screen name="EmployeeDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <include-form name="ListEmplLeaves" location="component://humanres/widget/forms/EmployeeForms.xml"/>
                        <screenlet id="AddEmplLeavePanel" title="${uiLabelMap.HumanResAddEmplLeave}" collapsible="true">
                            <include-form name="AddEmplLeave" location="component://humanres/widget/forms/EmployeeForms.xml"/>
                        </screenlet>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    <screen name="CurrentEmploymentData">
        <section>
            <actions>
                <service service-name="getCurrentPartyEmploymentData" auto-field-map="true" result-map="employmentData"/>
            </actions>
            <widgets>
                <screenlet title="${uiLabelMap.HumanResCurrentEmploymentData}">
                    <include-form name="CurrentEmploymentData" location="component://humanres/widget/forms/EmployeeForms.xml"/>
                </screenlet>
            </widgets>
        </section>
    </screen>
    
    <screen name="trainingsList">
        <section>
            <widgets>
                <screenlet title="${uiLabelMap.HumanResTrainings}">
                    <include-form name="simpleListTrainingStatus" location="component://humanres/widget/forms/PersonTrainingForms.xml"/>
                </screenlet>
            </widgets>
        </section>
    </screen>

    <screen name="PayrollHistory">
        <section>
            <actions>
                <set field="titleProperty" value="HumanResPayRollHistory"/>
                <set field="activeSubMenuItem" value="PayrollHistory"/>
                <set field="partyId" from-field="parameters.partyId"/>
                <set field="parameters.sortField" from-field="parameters.sortField" default-value="invoiceDate DESC"/>
                <entity-condition entity-name="InvoiceAndType" list="payroll">
                    <condition-list combine="and">
                        <condition-expr field-name="partyIdFrom" operator="equals" from-field="partyId"/>
                        <condition-expr field-name="invoiceTypeId" operator="equals" value="PAYROL_INVOICE"/>
                    </condition-list>
                    <order-by field-name="${parameters.sortField}"/>
                </entity-condition>
            </actions>
            <widgets>
                <decorator-screen name="EmployeeDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <include-form name="PayrollHistoryList" location="component://humanres/widget/forms/EmployeeForms.xml"/>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>

    <screen name="MyLeaveList">
        <section>
            <actions>
                <set field="partyId" from-field="userLogin.partyId"/>
            </actions>
            <widgets>
                <screenlet title="${uiLabelMap.HumanResMyLeaves}" navigation-form-name="ListEmplLeaves">
                    <include-form name="ListEmplLeaves" location="component://humanres/widget/forms/EmployeeForms.xml"/>
                </screenlet>
            </widgets>
        </section>
    </screen>
    <screen name="MyTrainings">
        <section>
            <actions>
                <set field="partyId" from-field="userLogin.partyId"/>
            </actions>
            <widgets>
                <screenlet title="${uiLabelMap.HumanResMyTrainings}">
                    <include-form name="ListEmplTrainings" location="component://humanres/widget/forms/PersonTrainingForms.xml"/>
                </screenlet>
            </widgets>
        </section>
    </screen>
    
    <!-- SCIPIO: 2018: takes place of the formal PartyResume entity handling screens above and sets menu.
        TODO: REVIEW: this is not 100% correct in meaning, should not really override EditPartyContents to this in controller... -->
    <screen name="EditPartyContents">
        <section>
            <actions>
                <set field="titleProperty" value="HumanResPartyContentAndResumes"/>
                <set field="activeSubMenu" value="EmployeeProfile"/>
                <set field="activeSubMenuItem" value="EditEmployeeContent"/>   
            </actions>
            <widgets>
                <include-screen name="EditPartyContents" location="component://party/widget/partymgr/PartyScreens.xml"/>
            </widgets>
        </section>
    </screen>
    
    <!-- SCIPIO: 2018: Override for party Content widget from viewprofile -->
    <screen name="EmployeeContent">
        <section>
            <actions>
                <set field="pcntTitle" from-field="pcntTitle" default-value="${uiLabelMap.HumanResPartyContentAndResumes}"/>
                <set field="pcntCntListLoc" from-field="pcntCntListLoc" default-value="component://humanres/widget/EmployeeScreens.xml#EmployeeContentList"/><!-- see below -->
                <set field="pcntUploadUri" value="uploadEmployeeContent"/><!-- this loads EmployeeContentList below -->
            </actions>
            <widgets>
                <include-screen name="Content" location="component://party/widget/partymgr/ProfileScreens.xml"/>
            </widgets>
        </section>
    </screen>
    <!-- SCIPIO: 2018: Override for party Content List widget from viewprofile -->
    <screen name="EmployeeContentList">
        <section>
            <actions>
                <set field="pcntListRemoveDonePage" from-field="pcntListRemoveDonePage" default-value="EmployeeProfile"/>
            </actions>
            <widgets>
                <include-screen name="ContentList" location="component://party/widget/partymgr/ProfileScreens.xml"/>
            </widgets>
        </section>
    </screen>
    
</screens>