ilscipio/scipio-erp

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

Summary

Maintainability
Test Coverage
<?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.
-->

<screens xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-screen.xsd">
    <screen name="TrainingCalendar">
        <section>
            <actions>
                <set field="parameters.period" from-field="parameters.period" default-value="${initialView}"/>
                
                <set field="eventDetailWidgetName" from-field="eventDetailWidgetName" default-value="trainingCalendarDetail" />
                <set field="eventDetailWidgetLocation" from-field="eventDetailWidgetLocation" default-value="component://humanres/widget/PersonTrainingScreens.xml" />
            </actions>
            <widgets>
                <section>
                    <condition>
                        <if-compare field="parameters.period" operator="equals" value="day"/>
                    </condition>
                    <actions>
                        <set field="titleProperty" value="PageTitleCalendarDay"/>
                        <set field="activeSubMenuItem" value="day"/>
                    </actions>
                    <widgets>
                        <include-screen name="CalendarMenu" location="component://workeffort/widget/CalendarScreens.xml"/>
                        <include-screen name="dayCalendar" location="component://workeffort/widget/CalendarScreens.xml"/>
                    </widgets>
                </section>
                <section>
                    <condition>
                        <or>
                            <if-compare field="parameters.period" operator="equals" value="week"/>
                            <!-- SCIPIO: month view should be default
                            <if-empty field="parameters.period"/> -->
                        </or>
                    </condition>
                    <actions>
                        <set field="activeSubMenuItem" value="week"/>
                    </actions>
                    <widgets>
                        <include-screen name="CalendarMenu" location="component://workeffort/widget/CalendarScreens.xml"/>
                        <include-screen name="weekCalendar" location="component://workeffort/widget/CalendarScreens.xml"/>
                    </widgets>
                </section>
                <section>
                    <condition>
                        <or>
                            <if-compare field="parameters.period" operator="equals" value="month"/>
                            <!-- SCIPIO: month view should be default -->
                            <if-empty field="parameters.period"/>
                        </or>
                    </condition>
                    <actions>
                        <set field="activeSubMenuItem" value="month"/>
                    </actions>
                    <widgets>
                        <include-screen name="CalendarMenu" location="component://workeffort/widget/CalendarScreens.xml"/>
                        <include-screen name="monthCalendar" location="component://workeffort/widget/CalendarScreens.xml"/>
                    </widgets>
                </section>
                <section>
                    <condition>
                        <if-compare field="parameters.period" operator="equals" value="upcoming"/>
                    </condition>
                    <actions>
                        <set field="activeSubMenuItem" value="upcoming"/>
                    </actions>
                    <widgets>
                        <include-screen name="CalendarMenu" location="component://workeffort/widget/CalendarScreens.xml"/>
                        <include-screen name="upcomingCalendar" location="component://workeffort/widget/CalendarScreens.xml"/>
                    </widgets>
                </section>
            </widgets>
        </section>
    </screen>
    <screen name="TrainingCalendarWithDecorator">
        <section>
            <actions>
                <set field="activeSubMenuItem" value="TrainingCalendar"/>
                <set field="titleProperty" value="PageTitleFindTrainingCalendar"/>
            </actions>
            <widgets>
                <decorator-screen name="CommonTrainingDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <include-screen name="TrainingCalendar"/>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    <screen name="trainingCalendarDetail">
        <section>
            <actions>
                <entity-one entity-name="WorkEffort" value-field="workEffort"/>
                <script location="component://workeffort/script/isCalOwner.groovy"/>
                <set field="workEffortId" from-field="parameters.workEffortId"/>
                <set field="trainingClassTypeId" from-field="workEffort.workEffortName"/>
                <set field="workEffortTypeId" from-field="workEffort.workEffortTypeId"/>
                <set field="fromDate" from-field="workEffort.estimatedStartDate"/>
                <set field="thruDate" from-field="workEffort.estimatedCompletionDate"/>
                <set field="loginPartyId" from-field="parameters.userLogin.partyId"/>
                <set field="approvalStatus" from-field="workEffort.status"/>
            </actions>
            <widgets>
                <section>
                    <condition>
                        <and>
                            <or>
                                <and>
                                    <not><if-empty field="workEffort"/></not>
                                    <if-compare field="workEffort.currentStatusId" operator="not-equals" value="CAL_CANCELLED"/>
                                </and>
                                <if-empty field="workEffort"/>
                                <if-has-permission permission="WORKEFFORTMGR" action="_ADMIN"/>
                            </or>
                            <if-compare field="parameters.form" operator="equals" value="edit"/>
                        </and>
                    </condition>
                    <widgets>
                        <section>
                            <condition>
                                <or>
                                    <if-true field="isCalOwner" />
                                    <if-empty field="workEffort"/>
                                </or>
                            </condition>
                            <widgets><!-- edit section -->
                                <container style="${styles.grid_large}6">
                                    <label style="heading" text="${uiLabelMap.WorkEffortAddCalendarEvent}"/>
                                    <include-form name="editTrainingCalendar" location="component://humanres/widget/forms/PersonTrainingForms.xml"/>
                                </container>
                                <container style="${styles.grid_large}6">
                                    <label style="heading" text="${uiLabelMap.WorkEffortParticipants}"/>
                                    <include-form name="ListTrainingParticipants" location="component://humanres/widget/forms/PersonTrainingForms.xml"/>
                                    <section>
                                        <condition>
                                            <and>
                                                <not><if-empty field="workEffort"/></not>
                                                <if-compare field="workEffortTypeId" operator="not-equals" value="WES_PUBLIC"/>
                                            </and>
                                        </condition>
                                        <widgets>
                                            <container>
                                                <label/>
                                                <include-form name="AssignTraining" location="component://humanres/widget/forms/PersonTrainingForms.xml"/>
                                            </container>
                                        </widgets>
                                    </section>
                                </container>
                            </widgets>
                            <fail-widgets><!-- view section -->
                                <container style="${styles.grid_large}6">
                                    <label style="heading" text="${uiLabelMap.WorkEffortSummary}"/>
                                    <include-form name="showTrainingCalendar" location="component://humanres/widget/forms/PersonTrainingForms.xml"/>
                                </container>
                            </fail-widgets>
                        </section>
                    </widgets>
                </section>
            </widgets>
        </section>
    </screen>
    <screen name="FindTrainingApprovals">
        <section>
            <actions>
                <set field="activeSubMenuItem" value="FindTrainingApprovals"/>
                <set field="titleProperty" value="PageTitleFindTrainingApprovals"/>
                <service service-name="humanResManagerPermission" result-map="permResult">
                    <field-map field-name="mainAction" value="ADMIN"/>
                </service>
                <set field="hasAdminPermission" from-field="permResult.hasPermission"/>
                <set field="loginPartyId" from-field="parameters.userLogin.partyId"/>
            </actions>
            <widgets>
                <decorator-screen name="CommonTrainingDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <decorator-screen name="FindScreenDecorator" location="component://common/widget/CommonScreens.xml">
                            <decorator-section name="search-options">
                                <include-form name="FindTrainingApprovals" location="component://humanres/widget/forms/PersonTrainingForms.xml"/>
                            </decorator-section>
                            <decorator-section name="search-results">
                                <include-form name="ListTrainingApprovals" location="component://humanres/widget/forms/PersonTrainingForms.xml"/>
                            </decorator-section>
                        </decorator-screen>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    <screen name="EditTrainingApprovals">
       <section>
           <actions>
               <set field="activeSubMenuItem" value="FindTrainingApprovals"/>
               <set field="partyId" from-field="parameters.partyId"/>
               <set field="trainingClassTypeId" from-field="parameters.trainingClassTypeId"/>
               <set field="fromDate" from-field="parameters.fromDate"/>
               <entity-one entity-name="PersonTraining" value-field="personTraining"/>
           </actions>
               <widgets>
                   <decorator-screen name="CommonTrainingDecorator" location="${parameters.mainDecoratorLocation}">
                       <decorator-section name="body">
                           <screenlet id="EditTrainingApprovals" title="${uiLabelMap.CommonEdit} ${uiLabelMap.HumanResTrainingApproval}" collapsible="true">
                               <include-form name="EditTrainingApprovals" location="component://humanres/widget/forms/PersonTrainingForms.xml"/>
                           </screenlet>
                       </decorator-section>
                   </decorator-screen>
               </widgets>
       </section>
     </screen>
     <screen name="FindTrainingStatus">
         <section>
             <actions>
                 <set field="activeSubMenuItem" value="FindTrainingStatus"/>
                 <set field="titleProperty" value="PageTitleFindTrainingStatus"/>
                 <service service-name="humanResManagerPermission" result-map="permResult">
                     <field-map field-name="mainAction" value="ADMIN"/>
                 </service>
                 <set field="hasAdminPermission" from-field="permResult.hasPermission"/>
                 <set field="loginPartyId" from-field="parameters.userLogin.partyId"/>
             </actions>
                 <widgets>
                     <decorator-screen name="CommonTrainingDecorator" location="${parameters.mainDecoratorLocation}">
                         <decorator-section name="body">
                     <decorator-screen name="FindScreenDecorator" location="component://common/widget/CommonScreens.xml">
                         <decorator-section name="search-options">
                             <include-form name="FindTrainingStatus" location="component://humanres/widget/forms/PersonTrainingForms.xml"/>
                         </decorator-section>
                         <decorator-section name="search-results">
                             <include-form name="ListTrainingStatus" location="component://humanres/widget/forms/PersonTrainingForms.xml"/>
                         </decorator-section>
                     </decorator-screen>
                        </decorator-section>
                     </decorator-screen>
                 </widgets>
         </section>
     </screen>
     <screen name="ListTrainingStatus">
         <section>
             <actions>
                 <set field="activeSubMenuItem" value="EditPersonTrainings"/>
             </actions>
                 <widgets>
                     <decorator-screen name="CommonPartyDecorator" 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>
</screens>