ilscipio/scipio-erp

View on GitHub
applications/shop/widget/CustRequestScreens.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="CommonRequestDecorator">
        <section>
            <widgets>
                <decorator-screen name="CommonShopAppDecorator" location="${parameters.mainDecoratorLocation}">
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    <screen name="ListRequests">
        <section>
            <actions>
                <set field="rightbarScreenName" value="rightbar"/>
                <set field="MainColumnStyle" value="rightonly"/>

                <set field="titleProperty" value="PageTitleListRequests"/>
                <!--<set field="activeMainMenuItem" value="Shopping List"/>-->
                <entity-condition entity-name="CustRequest" list="requestList">
                    <condition-list combine="and">
                        <condition-expr field-name="fromPartyId" from-field="userLogin.partyId"/>
                        <!--<condition-expr field-name="statusId" operator="not-equals" value="QUO_CREATED"/>-->
                    </condition-list>
                    <order-by field-name="-custRequestDate"/>
                </entity-condition>
            </actions>
            <widgets>
                <decorator-screen name="CommonShopAppDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <section>
                            <condition>
                                <if-true field="userHasAccount" />
                            </condition>
                            <widgets>
                                <platform-specific>
                                    <html><html-template location="component://shop/webapp/shop/request/RequestList.ftl"/></html>
                                </platform-specific>
                            </widgets>
                            <fail-widgets>
                                <label style="common-msg-error-perm" text="${uiLabelMap.ShopViewPermissionError}"/>
                            </fail-widgets>
                        </section>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>

    <screen name="NewRequest">
        <section>
            <actions>
                <set field="rightbarScreenName" value="rightbar"/>
                <set field="MainColumnStyle" value="rightonly"/>
                <set field="titleProperty" value="PageTitleNewRequest"/>
                <script lang="groovy" location="component://shop/webapp/shop/WEB-INF/actions/request/CustRequest.groovy"/>
            </actions>
            <widgets>
                <decorator-screen name="CommonRequestDecorator">
                    <decorator-section name="body">
                        <section>
                            <widgets>
                                <platform-specific>
                                    <html><html-template location="component://shop/webapp/shop/request/requestInfo.ftl"/></html>
                                </platform-specific>
                            </widgets>
                        </section>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    
    <screen name="ViewRequest">
        <section>
            <actions>
                <set field="rightbarScreenName" value="rightbar"/>
                <set field="MainColumnStyle" value="rightonly"/>

                <set field="titleProperty" value="PageTitleViewRequest"/>
                <!--<set field="activeMainMenuItem" value="Shopping List"/>-->
                <set field="custRequestId" from-field="parameters.custRequestId"/>
                <entity-one entity-name="CustRequest" value-field="custRequest"/>
                <get-related-one value-field="custRequest" relation-name="CustRequestType" to-value-field="custRequestType"/>
                <get-related-one value-field="custRequest" relation-name="StatusItem" to-value-field="statusItem"/>
                <get-related-one value-field="custRequest" relation-name="CurrencyUom" to-value-field="currency"/>
                <get-related-one value-field="custRequest" relation-name="ProductStore" to-value-field="store"/>

                <get-related value-field="custRequest" relation-name="CustRequestItem" list="requestItems"/>
                <get-related value-field="custRequest" relation-name="CustRequestParty" list="requestParties"/>
            </actions>
            <widgets>
                <decorator-screen name="CommonRequestDecorator">
                    <decorator-section name="body">
                        <section>
                            <condition>
                                <if-true field="userHasAccount" />
                            </condition>
                            <widgets>
                                <section>
                                    <condition>
                                        <if-compare-field field="custRequest.fromPartyId" operator="equals" to-field="userLogin.partyId"></if-compare-field>
                                    </condition>
                                    <widgets>
                                        <container style="${styles.grid_row}">
                                            <container style="${styles.grid_large}4 ${styles.grid_cell}">
                                                <platform-specific>
                                                    <html><html-template location="component://shop/webapp/shop/request/requestInfo.ftl"/></html>
                                                </platform-specific>
                                            </container>
                                            <container style="${styles.grid_large}4 ${styles.grid_cell}">
                                                <platform-specific>
                                                    <html><html-template location="component://order/webapp/ordermgr/request/requestDate.ftl"/></html>
                                                </platform-specific>
                                            </container>
                                            <container style="${styles.grid_large}4 ${styles.grid_cell}">
                                                <platform-specific>
                                                    <html><html-template location="component://order/webapp/ordermgr/request/requestContactMech.ftl"/></html>
                                                </platform-specific>
                                            </container>
                                        </container> 
                                        <container style="${styles.grid_large}12">
                                            <platform-specific>
                                                <html><html-template location="component://order/webapp/ordermgr/request/ViewRequestItemInfo.ftl"/></html>
                                            </platform-specific>
                                            <platform-specific>
                                                <html><html-template location="component://shop/webapp/shop/request/requestRoles.ftl"/></html>
                                            </platform-specific>
                                        </container>
                                    </widgets>
                                    <fail-widgets>
                                        <label>${uiLabelMap.OrderNoRequestFound}</label>
                                    </fail-widgets>
                                </section>
                            </widgets>
                            <fail-widgets>
                                <label style="common-msg-error-perm" text="${uiLabelMap.ShopViewPermissionError}"/>
                            </fail-widgets>
                        </section>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
</screens>