ilscipio/scipio-erp

View on GitHub
applications/party/widget/partymgr/ProfileScreens.xml

Summary

Maintainability
Test Coverage
<!--
  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="Party">
        <section>
            <actions>
                <property-map resource="PartyUiLabels" map-name="uiLabelMap" global="true"/>
                <set field="parameters.partyId" from-field="parameters.partyId" default-value="${userLogin.partyId}"/>
                <entity-one entity-name="Party" value-field="party">
                    <field-map field-name="partyId" from-field="parameters.partyId"/>
                </entity-one>
                <entity-and entity-name="PartyNameHistory" list="partyNameHistoryList">
                    <field-map field-name="partyId" from-field="parameters.partyId"/>
                    <order-by field-name="-changeDate"/>
                </entity-and>
                <entity-one entity-name="PartyAndGroup" value-field="lookupGroup">
                    <field-map field-name="partyId" from-field="parameters.partyId"/>
                </entity-one>
                <entity-one entity-name="PartyAndPerson" value-field="lookupPerson">
                    <field-map field-name="partyId" from-field="parameters.partyId"/>
                </entity-one>
                <entity-and entity-name="PartyContent" list="partyContentList" filter-by-date="true">
                    <field-map field-name="partyId" from-field="parameters.partyId"/>
                    <order-by field-name="-fromDate"/>
                </entity-and>
            </actions>
            <widgets>
                <section>
                    <condition>
                        <not><if-empty field="lookupPerson"/></not>
                    </condition>
                    <actions>
                        <set field="lookupParty" from-field="lookupPerson" />
                    </actions>
                    <widgets>
                        <include-screen name="ScipioPartyInfo"/>
                    </widgets>
                </section>
                <section>
                    <condition>
                        <not><if-empty field="lookupGroup"/></not>
                    </condition>
                    <actions>
                        <set field="lookupParty" from-field="lookupGroup" />
                    </actions>
                    <widgets>
                        <section>
                            <condition>
                                <if-has-permission permission="PARTYMGR" action="_GRP_UPDATE"/>
                               </condition>
                            <widgets>
                                <include-screen name="ScipioPartyInfo"/>
                            </widgets>
                        </section>
                    </widgets>
                </section>
            </widgets>
        </section>
    </screen>

    <screen name="Contact">
        <section>
            <actions>
                <property-map resource="PartyUiLabels" map-name="uiLabelMap" global="true"/>
                <set field="partyId" from-field="parameters.partyId" default-value="${userLogin.partyId}"/>
                <script location="component://party/webapp/partymgr/WEB-INF/actions/party/GetContactMechs.groovy"/>
                <script location="component://party/webapp/partymgr/WEB-INF/actions/party/GetUserLoginPrimaryEmail.groovy"/>
            </actions>
            <widgets>
                <section>
                    <condition>
                        <not>
                            <if-empty field="contactMeches"/>
                        </not>
                    </condition>
                    <widgets>
                        <platform-specific>
                            <html>
                                <html-template location="component://party/webapp/partymgr/party/profileblocks/Contact.ftl"/>
                            </html>
                        </platform-specific>
                    </widgets>
                </section>
                
            </widgets>
        </section>
    </screen>
    
    <screen name="PartyIdentifications">
        <section>
            <actions>
                <property-map resource="PartyUiLabels" map-name="uiLabelMap" global="true"/>
                <set field="partyId" from-field="parameters.partyId"/>
                <entity-and entity-name="PartyIdentificationAndParty" list="listIt">
                    <field-map field-name="partyId" from-field="partyId"/>
                </entity-and>

            </actions>
            <widgets>
                <section>
                    <condition>
                        <not>
                            <if-empty field="listIt"/>
                        </not>
                    </condition>
                    <widgets>
                        <screenlet title="${uiLabelMap.PartyPartyIdentifications}">
                            <include-form name="listPartyIdentification" location="component://party/widget/partymgr/PartyForms.xml"/>
                        </screenlet>
                    </widgets>
                </section>
            </widgets>
        </section>
    </screen>

    <screen name="PaymentMethods">
        <section>
            <actions>
                <property-map resource="PartyUiLabels" map-name="uiLabelMap" global="true"/>
                <property-map resource="AccountingUiLabels" map-name="uiLabelMap" global="true"/>
                <script location="component://party/webapp/partymgr/WEB-INF/actions/party/GetPaymentMethods.groovy"/>
            </actions>
            <widgets>
                <section>
                    <condition>
                        <not>
                            <if-empty field="paymentMethodValueMaps"/>
                        </not>
                    </condition>
                    <widgets>
                        <platform-specific>
                            <html>
                                <html-template location="component://party/webapp/partymgr/party/profileblocks/PaymentMethods.ftl"/>
                            </html>
                        </platform-specific>
                    </widgets>
                </section>
                
            </widgets>
        </section>
    </screen>

    <screen name="Attributes">
        <section>
            <actions>
                <property-map resource="PartyUiLabels" map-name="uiLabelMap" global="true"/>
                <set field="partyId" from-field="parameters.partyId" default-value="${userLogin.partyId}"/>
                <entity-one entity-name="Party" value-field="party"/>
                <entity-and entity-name="PartyAttribute" list="attributes">
                    <field-map field-name="partyId" from-field="partyId"/>
                </entity-and>
            </actions>
            <widgets>
                <platform-specific>
                    <html>
                        <html-template location="component://party/webapp/partymgr/party/profileblocks/Attributes.ftl"/>
                    </html>
                </platform-specific>
            </widgets>
        </section>
    </screen>

    <screen name="Cart">
        <section>
            <actions>
                <script location="component://party/webapp/partymgr/WEB-INF/actions/party/GetCurrentCart.groovy"/>
            </actions>
            <widgets>
                <platform-specific>
                    <html>
                        <html-template location="component://party/webapp/partymgr/party/profileblocks/Cart.ftl"/>
                    </html>
                </platform-specific>
            </widgets>
        </section>
    </screen>

    <screen name="LoyaltyPoints">
        <section>
            <actions>
                <property-map resource="PartyUiLabels" map-name="uiLabelMap" global="true"/>
                <script location="component://party/webapp/partymgr/WEB-INF/actions/party/GetLoyaltyPoints.groovy"/>
            </actions>
            <widgets>
                <section>
                    <condition>
                        <not>
                            <if-compare field="totalSubRemainingAmount" operator="equals" value="0"/>
                        </not>
                    </condition>
                    <widgets>
                        <platform-specific>
                            <html>
                                <html-template location="component://party/webapp/partymgr/party/profileblocks/LoyaltyPoints.ftl"/>
                            </html>
                        </platform-specific>    
                    </widgets>
                </section>
            </widgets>
        </section>
    </screen>

    <screen name="UserLogin">
        <section>
            <actions>
                <property-map resource="PartyUiLabels" map-name="uiLabelMap" global="true"/>
                <set field="partyId" from-field="parameters.partyId" default-value="${userLogin.partyId}"/>
                <entity-one entity-name="Party" value-field="party"/>
                <entity-and entity-name="UserLogin" list="userLogins">
                    <field-map field-name="partyId" from-field="partyId"/>
                </entity-and>
            </actions>
            <widgets>
                <section>
                    <condition>
                        <not>
                            <if-empty field="userLogins"/>
                        </not>
                    </condition>
                    <widgets>
                        <platform-specific>
                            <html>
                                <html-template location="component://party/webapp/partymgr/party/profileblocks/UserLogin.ftl"/>
                            </html>
                        </platform-specific>
                    </widgets>
                </section>
            </widgets>
        </section>
    </screen>

    <screen name="Visits">
        <section>
            <actions>
                <property-map resource="PartyUiLabels" map-name="uiLabelMap" global="true"/>
                <set field="partyId" from-field="parameters.partyId" default-value="${userLogin.partyId}"/>
                <entity-and entity-name="Visit" list="visits">
                    <field-map field-name="partyId" from-field="partyId"/>
                    <order-by field-name="-fromDate"/>
                    <limit-range start="0" size="5"/>
                </entity-and>
            </actions>
            <widgets>
                <section>
                    <condition>
                        <not>
                            <if-empty field="visits"/>
                        </not>
                    </condition>
                    <widgets>
                        <platform-specific>
                            <html>
                                <html-template location="component://party/webapp/partymgr/party/profileblocks/Visits.ftl"/>
                            </html>
                        </platform-specific>
                    </widgets>
                </section>
            </widgets>
        </section>
    </screen>

    <screen name="FinAccounts">
        <section>
            <actions>
                <property-to-field field="defaultCurrencyUomId" resource="general" property="currency.uom.id.default" default="USD"/>
                <entity-condition entity-name="FinAccount" list="ownedFinAccountList" filter-by-date="true">
                    <condition-expr field-name="ownerPartyId" operator="equals" from-field="parameters.partyId"/>
                    <order-by field-name="-fromDate"/>
                </entity-condition>
            </actions>
            <widgets>
                <section>
                    <condition>
                        <and>
                            <not><if-empty field="ownedFinAccountList"/></not>
                            <if-service-permission service-name="acctgBasePermissionCheck" main-action="VIEW"/>
                        </and>
                    </condition>
                    <widgets>
                        <screenlet id="fin-account-summary" title="${uiLabelMap.PageTitleFinancialAccountSummary}">
                            <iterate-section entry="ownedFinAccount" paginate-target="viewprofile" view-size="3" list="ownedFinAccountList">
                                <section>
                                    <actions>
                                        <entity-condition entity-name="FinAccountTrans" list="ownedFinAccountTransList">
                                            <condition-expr field-name="finAccountId" from-field="ownedFinAccount.finAccountId"/>
                                            <order-by field-name="-transactionDate"/>
                                            <limit-range start="0" size="5"/>
                                        </entity-condition>
                                        <entity-condition entity-name="FinAccountAuth" list="ownedFinAccountAuthList" filter-by-date="true">
                                            <condition-expr field-name="finAccountId" from-field="ownedFinAccount.finAccountId"/>
                                            <order-by field-name="-authorizationDate"/>
                                            <limit-range start="0" size="5"/>
                                        </entity-condition>
                                        <entity-one entity-name="Uom" value-field="accountCurrencyUom" auto-field-map="false" use-cache="true">
                                            <field-map field-name="uomId" from-field="ownedFinAccount.currencyUomId"/>
                                        </entity-one>
                                        <entity-one entity-name="StatusItem" value-field="finAccountStatusItem">
                                            <field-map field-name="statusId" from-field="ownedFinAccount.statusId"/>
                                        </entity-one>
                                        <entity-one entity-name="FinAccountType" value-field="ownedFinAccountType" auto-field-map="false" use-cache="true">
                                            <field-map field-name="finAccountTypeId" from-field="ownedFinAccount.finAccountTypeId"/>
                                        </entity-one>
                                    </actions>
                                    <widgets>
                                        <platform-specific>
                                            <html>
                                                <html-template location="component://party/webapp/partymgr/party/profileblocks/FinAccounts.ftl"/>
                                            </html>
                                        </platform-specific>
                                    </widgets>
                                </section>
                            </iterate-section>
                            <container id="apply-service-credit">
                                <label style="heading" text="${uiLabelMap.AccountingApplyServiceCredit}"/>
                                <include-form name="ApplyServiceCredit" location="component://party/widget/partymgr/PartyForms.xml"/>
                            </container>
                        </screenlet>
                    </widgets>
                </section>
            </widgets>
        </section>
    </screen>

    <screen name="SerializedInventory">
        <section>
            <actions>
                <property-map resource="ProductUiLabels" map-name="uiLabelMap" global="true"/>
                <property-map resource="CommonUiLabels" map-name="uiLabelMap" global="true"/>

                <entity-condition entity-name="InventoryItem" list="inventoryItemList">
                    <condition-list>
                        <condition-expr field-name="inventoryItemTypeId" operator="equals" value="SERIALIZED_INV_ITEM"/>
                        <condition-expr field-name="ownerPartyId" operator="equals" from-field="parameters.partyId"/>
                    </condition-list>
                    <order-by field-name="-createdStamp"/>
                </entity-condition>
            </actions>
            <widgets>
                <section>
                    <condition>
                        <not>
                            <if-empty field="inventoryItemList"/>
                        </not>
                    </condition>
                    <widgets>
                        <platform-specific>
                            <html>
                                <html-template location="component://party/webapp/partymgr/party/profileblocks/SerializedInventory.ftl"/>
                            </html>
                        </platform-specific>
                    </widgets>
                </section>
            </widgets>
        </section>
    </screen>

    <screen name="Subscriptions">
        <section>
            <actions>
                <property-map resource="ProductUiLabels" map-name="uiLabelMap" global="true"/>
                <property-map resource="CommonUiLabels" map-name="uiLabelMap" global="true"/>
                <entity-condition entity-name="Subscription" list="subscriptionList" filter-by-date="true">
                    <condition-list>
                        <condition-expr field-name="partyId" operator="equals" from-field="parameters.partyId"/>
                    </condition-list>
                    <order-by field-name="-fromDate"/>
                </entity-condition>
            </actions>
            <widgets>
                <section>
                    <condition>
                        <not>
                            <if-empty field="subscriptionList"/>
                        </not>
                    </condition>
                    <widgets>
                        <screenlet id="subscription-summary" title="${uiLabelMap.ProductSubscriptions}" collapsible="true">
                            <include-form name="ListSubscriptions" location="component://party/widget/partymgr/PartyForms.xml"/>
                        </screenlet>
                    </widgets>
                </section>
            </widgets>
        </section>
    </screen>

    <screen name="Content">
        <section>
            <actions>
                <property-map resource="PartyUiLabels" map-name="uiLabelMap" global="true"/>
                <entity-condition entity-name="PartyContentType" list="partyContentTypes">
                    <order-by field-name="description"/>
                </entity-condition>
                <entity-condition entity-name="MimeType" list="mimeTypes">
                    <order-by field-name="description"/>
                    <order-by field-name="mimeTypeId"/>
                </entity-condition>
                <entity-condition entity-name="RoleType" list="roles">
                    <order-by field-name="description"/>
                    <order-by field-name="roleTypeId"/>
                </entity-condition>
            </actions>
            <widgets>
                <platform-specific>
                    <html>
                        <html-template location="component://party/webapp/partymgr/party/profileblocks/Content.ftl"/>
                    </html>
                </platform-specific>
            </widgets>
        </section>
    </screen>

    <screen name="ContentList">
        <section>
            <actions>
                <set field="partyId" from-field="parameters.partyId" default-value="${userLogin.partyId}"/>
                <property-map resource="CommonUiLabels" map-name="uiLabelMap" global="true"/>
                <property-map resource="ContentUiLabels" map-name="uiLabelMap" global="true"/>
                <property-map resource="PartyUiLabels" map-name="uiLabelMap" global="true"/><!-- SCIPIO: for PartyNoContent -->
                <entity-and entity-name="PartyContent" list="partyContent">
                    <field-map field-name="partyId" from-field="partyId"/>
                </entity-and>
            </actions>
            <widgets>
                <!-- SCIPIO: this widget is invoked through controller for ajax, so perm check needed -->
                <section>
                    <condition>
                        <if-service-permission service-name="partyIdPermissionCheck" main-action="VIEW"/>
                    </condition>
                    <widgets>
                        <platform-specific>
                            <html>
                                <html-template location="component://party/webapp/partymgr/party/profileblocks/ContentList.ftl"/>
                            </html>
                        </platform-specific>
                    </widgets>
                    <fail-widgets>
                        <label style="common-msg-error-perm">${uiLabelMap.CommonPermissionError}</label>
                    </fail-widgets>
                </section>
            </widgets>
        </section>
    </screen>

    <screen name="Notes">
        <section>
            <actions>
                <property-map resource="PartyUiLabels" map-name="uiLabelMap" global="true"/>
                <set field="partyId" from-field="parameters.partyId" default-value="${userLogin.partyId}"/>
                <entity-and entity-name="PartyNoteView" list="notes">
                    <field-map field-name="targetPartyId" from-field="partyId"/>
                    <order-by field-name="-noteDateTime"/>
                </entity-and>
            </actions>
            <widgets>
                <platform-specific>
                    <html>
                        <html-template location="component://party/webapp/partymgr/party/profileblocks/Notes.ftl"/>
                    </html>
                </platform-specific>
            </widgets>
        </section>
    </screen>

    <screen name="ShipperAccount">
        <section>
            <actions>
                <set field="partyId" from-field="parameters.partyId"/>
            </actions>
            <widgets>
                <screenlet title="${uiLabelMap.PartyShipperAccount}" navigation-menu-name="addShipper">
                    <include-menu name="addShipper" location="component://party/widget/partymgr/PartyMenus.xml"/>
                    <include-form name="ListCarrierAccounts" location="component://party/widget/partymgr/PartyForms.xml"/>
                </screenlet>
            </widgets>
        </section>
    </screen>

    <screen name="contactsAndAccounts">
        <section>
            <widgets>
                <include-screen name="partyRelContacts"/>
                <include-screen name="partyRelAccounts"/>
            </widgets>
        </section>
    </screen>

    <screen name="partyRelContacts">
        <section>
            <actions>
                <property-map resource="PartyUiLabels" map-name="uiLabelMap" global="true"/>
                <entity-one entity-name="Party" value-field="party"></entity-one>
                <entity-and entity-name="PartyRelationship" list="contacts" filter-by-date="true">
                    <field-map field-name="partyIdFrom" from-field="parameters.partyId"/>
                    <field-map field-name="roleTypeIdFrom" value="ACCOUNT"/>
                    <field-map field-name="roleTypeIdTo" value="CONTACT"/>
                    <order-by field-name="partyIdTo"/>
                </entity-and>
            </actions>
            <widgets>
                <section>
                    <condition>
                        <if-compare field="party.partyTypeId" operator="equals" value="PARTY_GROUP"/>
                    </condition>
                    <widgets>
                        <screenlet title="${uiLabelMap.PartyListRelatedContacts}" navigation-menu-name="addRelContactAccounts">
                            <include-menu name="RelContactAccountsSubTabBar" location="component://party/widget/partymgr/PartyMenus.xml"/>
                            <section>
                                <condition>
                                    <not><if-empty field="parameters.editPartyRel"/></not>
                                </condition>
                                <widgets>
                                    <include-form name="AddContact" location="component://party/widget/partymgr/PartyForms.xml"/>
                                </widgets>
                            </section>
                            <include-form name="ListRelatedContacts" location="component://party/widget/partymgr/PartyForms.xml"/>
                        </screenlet>
                    </widgets>
                </section>
            </widgets>
        </section>
    </screen>
    
    <screen name="partyRelAccounts">
        <section>
            <actions>
                <property-map resource="PartyUiLabels" map-name="uiLabelMap" global="true"/>
                <entity-and entity-name="PartyRelationship" list="accounts" filter-by-date="true">
                    <field-map field-name="partyIdTo" from-field="parameters.partyId"/>
                    <field-map field-name="roleTypeIdFrom" value="ACCOUNT"/>
                    <field-map field-name="roleTypeIdTo" value="CONTACT"/>
                    <order-by field-name="partyIdFrom"/>
                </entity-and>
            </actions>
            <widgets>
                <section>
                    <condition>
                        <if-compare field="party.partyTypeId" operator="equals" value="PERSON"/>
                    </condition>
                    <widgets>                        
                        <screenlet title="${uiLabelMap.PartyListRelatedAccounts}" navigation-menu-name="addRelContactAccounts">  
                            <include-menu name="RelContactAccountsSubTabBar" location="component://party/widget/partymgr/PartyMenus.xml"/>
                            <section>
                                <condition>
                                    <not><if-empty field="parameters.editPartyRel"/></not>
                                </condition>
                                <widgets>
                                    <include-form name="AddAccount" location="component://party/widget/partymgr/PartyForms.xml"/>
                                </widgets>
                            </section>
                            <include-form name="ListRelatedAccounts" location="component://party/widget/partymgr/PartyForms.xml"/>                                                 
                        </screenlet>
                    </widgets>
                </section>
            </widgets>
        </section>
    </screen>
    
    <screen name="mytasks">
        <section>
            <condition>
                <if-compare-field field="parameters.partyId" operator="equals" to-field="userLogin.partyId"/>
            </condition>
            <actions>
                <property-map resource="WorkEffortUiLabels" map-name="uiLabelMap" global="true"/>
                <service service-name="getWorkEffortAssignedActivities"/>
                <service service-name="getWorkEffortAssignedActivitiesByRole"/>
                <service service-name="getWorkEffortAssignedActivitiesByGroup"/>
                <service service-name="getWorkEffortAssignedTasks"/>
            </actions>
            <widgets><!-- can always view your own tasks -->
                <platform-specific><html><html-template location="component://party/webapp/partymgr/party/profileblocks/mytasks.ftl"/></html></platform-specific>
            </widgets>
        </section>
    </screen>

    <screen name="PartySalesOpportunities">
        <section>
            <actions>
                <set field="partyId" from-field="parameters.partyId"/>
                <entity-and entity-name="SalesOpportunityAndRole" list="salesOpportunities">
                    <field-map field-name="partyId" from-field="partyId"/>
                    <order-by field-name="salesOpportunityId"/>
                </entity-and>
            </actions>
            <widgets>
                <screenlet title="${uiLabelMap.OrderOpportunities}" >
                    <include-menu name="SalesOpportunitiesSubTabBar" location="component://party/widget/partymgr/PartyMenus.xml"/>
                    <include-form name="PartySalesOpportunities" location="component://party/widget/partymgr/PartyForms.xml"/>
                </screenlet>
            </widgets>
        </section>
    </screen>

    <screen name="ProductStores">
        <section>
            <actions>
                <property-map resource="PartyUiLabels" map-name="uiLabelMap" global="true"/>
                <property-map resource="ProductUiLabels" map-name="uiLabelMap" global="true"/>
                <set field="partyId" from-field="parameters.partyId" default-value="${userLogin.partyId}"/>
                <entity-and entity-name="ProductStoreRole" list="productStoreRoles" filter-by-date="true">
                    <field-map field-name="partyId" from-field="partyId"/>
                    <order-by field-name="-fromDate"/>
                </entity-and>
            </actions>
            <widgets>
                <platform-specific>
                    <html>
                        <html-template location="component://party/webapp/partymgr/party/profileblocks/ProductStores.ftl"/>
                    </html>
                </platform-specific>
            </widgets>
        </section>
    </screen>
    
    <!-- SCIPIO: Form migration -->
    <!-- SCIPIO: Form widget replacement: component://party/widget/partymgr/PartyForms.xml#ViewPartyPerson 
                                        component://party/widget/partymgr/PartyForms.xml#ViewPartyGroup
                                        component://party/widget/partymgr/PartyForms.xml#ViewPartyPersonHistory
                                        component://party/widget/partymgr/PartyForms.xml#ViewPartyGroupHistory
         
               Replaces: component://party/widget/partymgr/ProfileScreens.xml#AvsSettings
    -->    
    <screen name="ScipioPartyInfo">
        <section>
            <actions>
                <entity-one entity-name="PartyIcsAvsOverride" value-field="avsOverride">
                    <field-map field-name="partyId"/>
                </entity-one>
            </actions>
            <widgets>
                <section>
                    <condition>
                        <not>
                            <if-empty field="partyId"/>
                        </not>
                    </condition>
                    <widgets>
                        <platform-specific>
                            <html><html-template location="component://party/webapp/partymgr/party/profileblocks/ScipioPartyInfo.ftl"/></html>
                        </platform-specific>
                    </widgets>
                </section>
            </widgets>
        </section>
    </screen>
    <!--Scipio: new UserCommunications widget -->
    <screen name="ScipioListUserCommunications">
        <section>
            <widgets>
                <screenlet title="${uiLabelMap.PartyCommunications}">
                    <include-menu name="CommunicationSubTabBar" location="component://party/widget/partymgr/PartyMenus.xml"/>
                    <include-form location="component://party/widget/partymgr/CommunicationEventForms.xml" name="ListPartyCommEvents"/>
                </screenlet>
            </widgets>
        </section>
    </screen>
</screens>