Files
ofbiz-framework/specialpurpose/mypage/widget/CommonScreens.xml
T

516 lines
25 KiB
XML

<?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="main-decorator">
<section>
<actions>
<!-- base/top/specific map first, then more common map added for shared labels -->
<property-map resource="MyPageUiLabels" map-name="uiLabelMap" global="true"/>
<property-map resource="PartyUiLabels" map-name="uiLabelMap" global="true"/>
<property-map resource="AccountingUiLabels" map-name="uiLabelMap" global="true"/>
<property-map resource="WorkEffortUiLabels" map-name="uiLabelMap" global="true"/>
<property-map resource="ContentUiLabels" map-name="uiLabelMap" global="true"/>
<property-map resource="CommonUiLabels" map-name="uiLabelMap" global="true"/>
<property-map resource="OrderUiLabels" map-name="uiLabelMap" global="true"/>
<property-map resource="ProductUiLabels" map-name="uiLabelMap" global="true"/>
<property-map resource="ProjectMgrUiLabels" map-name="uiLabelMap" global="true"/>
<property-map resource="HumanResUiLabels" map-name="uiLabelMap" global="true"/>
<set field="layoutSettings.companyName" from-field="uiLabelMap.MyInformation" global="true"/>
<set field="layoutSettings.companySubtitle" from-field="uiLabelMap.PartyCompanySubtitle" global="true"/>
<!-- layoutSettings.headerImageUrl can be used to specify an application specific logo; if not set,
then the global layoutSettings.commonHeaderImageUrl (specified in GlobalDecorator) will be used. -->
<!--<set field="layoutSettings.headerImageUrl" value="/images/ofbiz_logo.jpg" global="true"/>-->
<!-- <set field="layoutSettings.headerMiddleBackgroundUrl" value="" global="true"/> -->
<!-- <set field="layoutSettings.headerRightBackgroundUrl" value="" global="true"/> -->
<!-- TODO: Use transform to specify component URI -->
<set field="layoutSettings.javaScripts[]" value="/partymgr/static/partymgr.js" global="true"/>
<set field="layoutSettings.styleSheets[]" value="/partymgr/static/partymgr.css" global="true"/>
<set field="activeApp" value="mypage" global="true"/>
<set field="applicationMenuName" value="MyPageAppBar" global="true"/>
<set field="applicationMenuLocation" value="component://mypage/widget/MyPageMenus.xml" global="true"/>
</actions>
<widgets>
<section>
<condition><not><if-empty field-name="userLogin"/></not></condition>
<actions>
<service service-name="getUserPreferenceGroup" result-map-name="preferences">
<field-map field-name="userPrefGroupId" value="MyPage" />
</service>
</actions>
<widgets/>
</section>
<include-screen name="GlobalDecorator" location="component://common/widget/CommonScreens.xml"/>
</widgets>
</section>
</screen>
<screen name="CommonPartyDecorator">
<section>
<actions>
<set field="headerItem" value="viewprofile"/>
<set field="partyId" from-field="userLogin.partyId"/>
<set field="parameters.partyId" from-field="userLogin.partyId"/>
<entity-one entity-name="Party" value-name="party"/>
<entity-one entity-name="Person" value-name="lookupPerson"/>
<entity-one entity-name="PartyGroup" value-name="lookupGroup"/>
</actions>
<widgets>
<decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
<decorator-section name="body">
<section>
<widgets>
<container style="h1"><label text="${uiLabelMap.PartyTheProfileOf} ${lookupPerson.personalTitle} ${lookupPerson.firstName} ${lookupPerson.middleName} ${lookupPerson.lastName} ${lookupPerson.suffix} ${lookupGroup.groupName} [${partyId}]"/></container>
<decorator-section-include name="body"/>
</widgets>
</section>
</decorator-section>
</decorator-screen>
</widgets>
</section>
</screen>
<screen name="CommonCalendarDecorator">
<section>
<widgets>
<decorator-section-include name="body"/>
</widgets>
</section>
</screen>
<screen name="CommonTimesheetDecorator">
<section>
<actions>
<set field="headerItem" value="${parameters.donePage}"/>
</actions>
<widgets>
<decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
<decorator-section name="body"/>
</decorator-screen>
</widgets>
</section>
</screen>
<screen name="CommonCommunicationEventDecorator">
<section>
<actions>
<set field="headerItem" value="${parameters.donePage}"/>
<script location="component://mypage/webapp/mypage/WEB-INF/actions/GetMyCommunicationEventRole.groovy"/>
</actions>
<widgets>
<decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
<decorator-section name="body">
<include-menu location="component://mypage/widget/MyPageMenus.xml" name="CommSubTabBar"/>
<decorator-section-include name="body"/>
</decorator-section>
</decorator-screen>
</widgets>
</section>
</screen>
<screen name="CommonMyTaskDecorator">
<section>
<actions>
<set field="headerItem" value="${parameters.donePage}"/>
</actions>
<widgets>
<decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
<decorator-section name="body"/>
</decorator-screen>
</widgets>
</section>
</screen>
<screen name="main">
<section>
<actions>
<set field="headerItem" value="main" />
<set field="parameters.donePage" value="main"/>
<!-- refresh every 3 minutes -->
<!-- set field="layoutSettings.extraHead" value="&lt;META HTTP-EQUIV=&quot;REFRESH&quot; CONTENT=&quot;180&quot;&gt;"/-->
</actions>
<widgets>
<decorator-screen name="main-decorator"
location="${parameters.mainDecoratorLocation}">
<decorator-section name="body">
<section>
<condition>
<if-has-permission permission="MYPAGE_EMPLOYEE" />
</condition>
<actions>
<set field="decorator" value="Y"/>
</actions>
<widgets>
<include-screen name="mainEmployee" />
</widgets>
</section>
<section>
<condition>
<if-has-permission permission="MYPAGE_CUSTOMER" />
</condition>
<actions>
<set field="decorator" value="Y"/>
</actions>
<widgets>
<include-screen name="mainCustomer" />
</widgets>
</section>
<section>
<condition>
<and>
<not><if-has-permission permission="MYPAGE_CUSTOMER"/></not>
<not><if-has-permission permission="MYPAGE_EMPLOYEE"/></not>
</and>
</condition>
<widgets>
<include-screen name="mainNoAccess" />
</widgets>
</section>
</decorator-section>
</decorator-screen>
</widgets>
</section>
</screen>
<screen name="mainEmployee">
<section>
<actions>
<service service-name="getUserPreferenceGroup"
result-map-name="preferences">
<field-map field-name="userPrefGroupId" value="MyPage" />
</service>
<!-- check if there are any customer requests for this user -->
<entity-condition list-name="custRequests" entity-name="CustReqAndTypeAndPartyRel">
<condition-list combine="and">
<condition-expr field-name="statusId" operator="equals" value="CRQ_SUBMITTED"/>
<condition-list combine="and">
<condition-expr field-name="roleTypeIdTo" operator="equals" value="REQ_TAKER"/>
<condition-expr field-name="partyIdTo" operator="equals" env-name="userLogin.partyId"/>
</condition-list>
</condition-list>
<order-by field-name="-custRequestDate"/>
</entity-condition>
</actions>
<widgets>
<section>
<condition>
<not><if-empty field-name="custRequests"/></not>
</condition>
<widgets>
<screenlet title="${uiLabelMap.IncomingCustRequests}" navigation-form-name="ListRequestList" >
<include-form name="ListRequestList" location="component://order/webapp/ordermgr/request/RequestForms.xml"/>
</screenlet>
</widgets>
</section>
<section>
<condition>
<if-compare field-name="preferences.userPrefMap.myCommunications"
operator="equals" value="Y" />
</condition>
<widgets>
<include-screen name="MyCommunications"
location="component://mypage/widget/MyPageScreens.xml"/>
</widgets>
</section>
<section>
<condition>
<if-compare field-name="preferences.userPrefMap.otherCommunications"
operator="equals" value="Y" />
</condition>
<widgets>
<include-screen name="OtherCommunications"
location="component://mypage/widget/MyPageScreens.xml" />
</widgets>
</section>
<section>
<condition>
<if-compare field-name="preferences.userPrefMap.myCompanyComms"
operator="equals" value="Y" />
</condition>
<widgets>
<include-screen name="MyCompanyComms"
location="component://mypage/widget/MyPageScreens.xml" />
</widgets>
</section>
<section>
<condition>
<if-compare field-name="preferences.userPrefMap.myTasks"
operator="equals" value="Y" />
</condition>
<widgets>
<include-screen name="MyTasks"
location="component://mypage/widget/MyPageScreens.xml" />
</widgets>
</section>
<section>
<condition>
<if-compare field-name="preferences.userPrefMap.myTimesheet"
operator="equals" value="Y" />
</condition>
<widgets>
<include-screen name="MyTimesheet"
location="component://mypage/widget/MyPageScreens.xml" />
</widgets>
</section>
</widgets>
</section>
</screen>
<screen name="mainCustomer">
<section>
<actions>
<set field="partyId" from-field="userLogin.partyId"/>
<set field="status" from-field="parameters.status" default-value="open"/>
<set field="status" value="${bsh:&quot;all&quot;.equals(status)?&quot;%&quot;:&quot;open&quot;}"/>
<entity-condition list-name="custRequests" entity-name="CustRequestInfoAndWorkEffortAndPartyRel">
<condition-list combine="and">
<condition-expr field-name="fromPartyId" operator="equals" value="${userLogin.partyId}"/>
<condition-list combine="or">
<condition-expr field-name="statusId" operator="equals" value="CRQ_REVIEWED"/>
<condition-expr field-name="statusId" operator="equals" value="CRQ_ACCEPTED"/>
</condition-list>
</condition-list>
<order-by field-name="+priority"/>
<order-by field-name="+custRequestDate"/>
</entity-condition>
<entity-condition list-name="custRequestsCompleted" entity-name="CustRequestInfoAndWorkEffortAndPartyRel">
<condition-list combine="and">
<condition-expr field-name="fromPartyId" operator="equals" value="${userLogin.partyId}"/>
<condition-expr field-name="statusId" operator="equals" value="CRQ_COMPLETED"/>
</condition-list>
<order-by field-name="custRequestDate"/>
</entity-condition>
<script location="component://party/webapp/partymgr/WEB-INF/actions/party/GetMyCompany.groovy"/>
<entity-condition list-name="companyCustRequests" entity-name="CustRequestInfoAndWorkEffortAndPartyRel">
<condition-list combine="and">
<condition-expr field-name="partyIdFrom" operator="equals" value="${myCompanyId}"/>
<condition-expr field-name="fromPartyId" operator="not-equals" value="${userLogin.partyId}"/>
</condition-list>
<order-by field-name="custRequestDate"/>
</entity-condition>
<!-- only list internal notes to the customer do not show the incoming or outgoing emails: will confuse only -->
<entity-condition entity-name="CommunicationEventAndRole" list-name="commEvents">
<condition-list combine="and">
<condition-expr field-name="communicationEventTypeId" operator="equals" value="COMMENT_NOTE" />
<condition-expr field-name="partyId" operator="equals" value="${partyId}" />
<condition-list combine="or">
<condition-expr field-name="roleStatusId"
operator="not-equals" value="COM_ROLE_COMPLETED" />
<condition-expr field-name="roleStatusId"
operator="like" value="${status}" />
</condition-list>
</condition-list>
<order-by field-name="-datetimeStarted" />
</entity-condition>
<service service-name="getUserPreferenceGroup" result-map-name="preferences">
<field-map field-name="userPrefGroupId" value="MyPage" />
</service>
</actions>
<widgets>
<screenlet title="${uiLabelMap.MyOpenCustomerRequests}" navigation-form-name="ListCustRequests" >
<link target="newrequest" text="${uiLabelMap.OrderNewRequest}" style="buttontext"/>
<include-form name="ListCustRequests" location="component://mypage/widget/MyPageForms.xml"/>
</screenlet>
<screenlet title="${uiLabelMap.MyCompletedCustomerRequests}" navigation-form-name="ListCustRequestsCompleted">
<include-form name="ListCustRequestsCompleted" location="component://mypage/widget/MyPageForms.xml"/>
</screenlet>
<section>
<condition>
<not><if-empty field-name="companyCustRequests"/></not>
</condition>
<widgets>
<screenlet title="${uiLabelMap.OtherCompanyCustomerRequests}" navigation-form-name="ListOtherCompanyRequests">
<include-form name="ListOtherCompanyRequests" location="component://mypage/widget/MyPageForms.xml"/>
</screenlet>
</widgets>
</section>
<screenlet title="${uiLabelMap.CommunicationsOfParty}: ${partyName.firstName} ${partyName.middleName} ${partyName.lastName} ${partyName.groupName} [${partyId}] "
navigation-menu-name="communicationsMenu" navigation-form-name="ListPartyCommEvents" name="myComms">
<include-menu name="communicationsMenu" location="component://mypage/widget/MyPageMenus.xml" />
<include-form name="ListPartyCommEvents" location="component://mypage/widget/MyPageForms.xml" />
</screenlet>
</widgets>
</section>
</screen>
<screen name="mainNoAccess">
<section>
<widgets>
<screenlet title="${uiLabelMap.CommonNoAccess}" navigation-form-name="ListRequestList" >
<container>
<label style="h1" text="${uiLabelMap.MyPageNoAccess1}"></label>
</container>
<container>
<label style="h2" text="${uiLabelMap.MyPageNoAccess2}"></label>
</container>
<container>
<label style="h3" text="${uiLabelMap.MyPageNoAccess3}"></label>
</container>
<container>
<label style="h3" text="${uiLabelMap.MyPageNoAccess4}"></label>
</container>
</screenlet>
</widgets>
</section>
</screen>
<screen name="preferences">
<section>
<actions>
<set field="headerItem" value="preferences"/>
<service service-name="getUserPreferenceGroup"
result-map-name="preferences">
<field-map field-name="userPrefGroupId" value="MyPage" />
</service>
</actions>
<widgets>
<decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
<decorator-section name="body">
<screenlet title="${uiLabelMap.CommonPreferences}: ${uiLabelMap.MyPagePagesVisible}">
<include-form name="preferences" location="component://mypage/widget/MyPageForms.xml"/>
</screenlet>
</decorator-section>
</decorator-screen>
</widgets>
</section>
</screen>
<screen name="MyTasks">
<section>
<actions>
<set field="headerItem" value="myTasks" />
</actions>
<widgets>
<decorator-screen name="main-decorator"
location="${parameters.mainDecoratorLocation}">
<decorator-section name="body">
<include-screen name="MyTasks"
location="component://mypage/widget/MyPageScreens.xml" />
</decorator-section>
</decorator-screen>
</widgets>
</section>
</screen>
<screen name="MyCommunications">
<section>
<actions>
<set field="headerItem" value="myCommunications" />
</actions>
<widgets>
<decorator-screen name="main-decorator"
location="${parameters.mainDecoratorLocation}">
<decorator-section name="body">
<include-screen name="MyCommunications"
location="component://mypage/widget/MyPageScreens.xml" />
</decorator-section>
</decorator-screen>
</widgets>
</section>
</screen>
<screen name="OtherCommunications">
<section>
<actions>
<set field="headerItem" value="otherCommunications" />
</actions>
<widgets>
<decorator-screen name="main-decorator"
location="${parameters.mainDecoratorLocation}">
<decorator-section name="body">
<include-screen name="OtherCommunications"
location="component://mypage/widget/MyPageScreens.xml" />
</decorator-section>
</decorator-screen>
</widgets>
</section>
</screen>
<screen name="MyCompanyComms">
<section>
<actions>
<set field="headerItem" value="myCompanyComms" />
</actions>
<widgets>
<decorator-screen name="main-decorator"
location="${parameters.mainDecoratorLocation}">
<decorator-section name="body">
<include-screen name="MyCompanyComms"
location="component://mypage/widget/MyPageScreens.xml" />
</decorator-section>
</decorator-screen>
</widgets>
</section>
</screen>
<screen name="MyTimesheet">
<section>
<actions>
<set field="headerItem" value="myTimesheet" />
</actions>
<widgets>
<decorator-screen name="main-decorator"
location="${parameters.mainDecoratorLocation}">
<decorator-section name="body">
<include-screen name="MyTimesheet"
location="component://mypage/widget/MyPageScreens.xml" />
</decorator-section>
</decorator-screen>
</widgets>
</section>
</screen>
<screen name="CommonRequestDecorator">
<section>
<actions/>
<widgets>
<decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
<decorator-section name="body">
<decorator-section-include name="body"/>
</decorator-section>
</decorator-screen>
</widgets>
</section>
</screen>
<screen name="custPreferences">
<section>
<actions>
<set field="headerItem" value="custPreferences"/>
<service service-name="getUserPreferenceGroup"
result-map-name="preferences">
<field-map field-name="userPrefGroupId" value="MyPage" />
</service>
</actions>
<widgets>
<decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
<decorator-section name="body">
<screenlet title="${uiLabelMap.CommonPreferences}">
<include-form name="custPreferences" location="component://mypage/widget/MyPageForms.xml"/>
</screenlet>
</decorator-section>
</decorator-screen>
</widgets>
</section>
</screen>
</screens>