You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ja...@apache.org on 2020/06/20 12:07:27 UTC

[ofbiz-framework] branch trunk updated: Reverted: Use Compound Widget on rest of the project (OFBIZ-11821)

This is an automated email from the ASF dual-hosted git repository.

jamesyong pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 2f557b7  Reverted: Use Compound Widget on rest of the project (OFBIZ-11821)
2f557b7 is described below

commit 2f557b7fba7cc812388623a909deb764d3be162c
Author: James Yong <ja...@apache.org>
AuthorDate: Sat Jun 20 20:06:42 2020 +0800

    Reverted: Use Compound Widget on rest of the project (OFBIZ-11821)
    
    Verbose and may better suit in custom implementation.
---
 .../order/webapp/ordermgr/WEB-INF/controller.xml   |  7 +-
 .../order/widget/ordermgr/CustRequestForms.xml     | 99 ++++++++++++++++++++--
 .../order/widget/ordermgr/CustRequestScreens.xml   | 64 +++++++++++++-
 3 files changed, 157 insertions(+), 13 deletions(-)

diff --git a/applications/order/webapp/ordermgr/WEB-INF/controller.xml b/applications/order/webapp/ordermgr/WEB-INF/controller.xml
index c434730..c1c4936 100644
--- a/applications/order/webapp/ordermgr/WEB-INF/controller.xml
+++ b/applications/order/webapp/ordermgr/WEB-INF/controller.xml
@@ -23,7 +23,6 @@ under the License.
     <include location="component://common/webcommon/WEB-INF/common-controller.xml"/>
     <include location="component://commonext/webapp/WEB-INF/controller.xml"/>
     <include location="component://content/webapp/content/WEB-INF/controller.xml"/>
-    <include location="component://order/widget/ordermgr/FindRequestCompound.xml"/>
     <description>Order Manager Module Site Configuration File</description>
     
     <!-- Events to run on every request before security (chains exempt) -->
@@ -1328,6 +1327,10 @@ under the License.
     </request-map>
 
     <!-- =============== CustRequest mapping =================-->
+    <request-map uri="FindRequest">
+        <security https="true" auth="true"/>
+        <response name="success" type="view" value="FindRequest"/>
+    </request-map>
     <request-map uri="ViewRequest"><security https="true" auth="true"/><response name="success" type="view" value="ViewRequest"/></request-map>
     <request-map uri="EditRequest"><security https="true" auth="true"/><response name="success" type="view" value="EditRequest"/></request-map>
     <request-map uri="EditRequestCustomer"><security https="true" auth="true"/><response name="success" type="view" value="EditRequestCustomer"/></request-map>
@@ -2107,6 +2110,8 @@ under the License.
     <view-map name="ListQuoteNotes" type="screen" page="component://order/widget/ordermgr/QuoteScreens.xml#ListQuoteNotes"/>
     <view-map name="EditQuoteNote" type="screen" page="component://order/widget/ordermgr/QuoteScreens.xml#EditQuoteNote"/>
 
+    <view-map name="FindRequest" type="screen"
+              page="component://order/widget/ordermgr/CustRequestScreens.xml#FindRequest"/>
     <view-map name="ViewRequest" type="screen" page="component://order/widget/ordermgr/CustRequestScreens.xml#ViewRequest"/>
     <view-map name="EditRequest" type="screen" page="component://order/widget/ordermgr/CustRequestScreens.xml#EditRequest"/>
     <view-map name="EditRequestCustomer" type="screen" page="component://order/widget/ordermgr/CustRequestScreens.xml#EditRequestCustomer"/>
diff --git a/applications/order/widget/ordermgr/CustRequestForms.xml b/applications/order/widget/ordermgr/CustRequestForms.xml
index 9bf17bb..e85c156 100644
--- a/applications/order/widget/ordermgr/CustRequestForms.xml
+++ b/applications/order/widget/ordermgr/CustRequestForms.xml
@@ -18,18 +18,99 @@ specific language governing permissions and limitations
 under the License.
 -->
 
-<forms xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
-        xmlns="http://ofbiz.apache.org/Widget-Form" xsi:schemaLocation="http://ofbiz.apache.org/Widget-Form http://ofbiz.apache.org/dtds/widget-form.xsd">
+<forms xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns="http://ofbiz.apache.org/Widget-Form"
+       xsi:schemaLocation="http://ofbiz.apache.org/Widget-Form http://ofbiz.apache.org/dtds/widget-form.xsd">
+    <form name="FindRequests" target="FindRequest" title="" type="single" default-map-name="parameters"
+          header-row-style="header-row" default-table-style="basic-table">
+        <auto-fields-entity entity-name="CustRequest" default-field-type="find"/>
+        <field name="custRequestTypeId" position="2">
+            <drop-down allow-empty="true" allow-multiple="true">
+                <entity-options entity-name="CustRequestType" key-field-name="custRequestTypeId"/>
+            </drop-down>
+        </field>
+        <field name="statusId">
+            <drop-down allow-multiple="true">
+                <entity-options entity-name="StatusItem" key-field-name="statusId">
+                    <entity-constraint name="statusTypeId" operator="equals" value="CUSTREQ_STTS"/>
+                    <entity-order-by field-name="sequenceId"/>
+                </entity-options>
+            </drop-down>
+        </field>
+        <field name="salesChannelEnumId" title="${uiLabelMap.OrderSalesChannel}" position="2">
+            <drop-down allow-empty="true" allow-multiple="true">
+                <entity-options entity-name="Enumeration" key-field-name="enumId">
+                    <entity-constraint name="enumTypeId" value="ORDER_SALES_CHANNEL"/>
+                    <entity-order-by field-name="sequenceId"/>
+                </entity-options>
+            </drop-down>
+        </field>
+        <field name="fromPartyId" position="2">
+            <lookup target-form-name="LookupPartyName"/>
+        </field>
+        <field name="currencyUomId">
+            <ignored/>
+        </field>
+        <field name="maximumAmountUomId">
+            <ignored/>
+        </field>
+        <field name="custRequestCategoryId">
+            <ignored/>
+        </field>
+        <field name="fulfillContactMechId">
+            <ignored/>
+        </field>
+        <field name="priority">
+            <ignored/>
+        </field>
+        <field name="description">
+            <ignored/>
+        </field>
+        <field name="createdDate">
+            <ignored/>
+        </field>
+        <field name="createdByUserLogin">
+            <ignored/>
+        </field>
+        <field name="lastModifiedDate">
+            <ignored/>
+        </field>
+        <field name="lastModifiedByUserLogin">
+            <ignored/>
+        </field>
+        <field name="closedDateTime" position="2">
+            <date-find/>
+        </field>
+        <field name="responseRequiredDate" position="2">
+            <date-find/>
+        </field>
+        <field name="productStoreId" title="${uiLabelMap.ProductProductStore}">
+            <drop-down allow-empty="true" allow-multiple="true">
+                <entity-options description="${storeName}" entity-name="ProductStore" key-field-name="productStoreId">
+                    <entity-order-by field-name="storeName"/>
+                </entity-options>
+            </drop-down>
+        </field>
+        <field name="reason" position="2">
+            <text/>
+        </field>
+        <field name="submitButton" title="${uiLabelMap.CommonFind}" widget-style="smallSubmit">
+            <submit button-type="button"/>
+        </field>
+        <field name="noConditionFind">
+            <hidden value="Y"/><!-- if this isn't there then with all fields empty no query will be done -->
+        </field>
+    </form>
 
     <form name="ListRequests" type="list" extends="ListRequestList" list-name="listIt">
         <actions>
-          <service service-name="performFind" result-map="result" result-map-list="listIt">
-            <field-map field-name="inputFields" from-field="parameters"/>
-            <field-map field-name="entityName" from-field="entityName"/>
-            <field-map field-name="orderBy" from-field="parameters.sortField"/>
-            <field-map field-name="viewIndex" from-field="viewIndex"/>
-            <field-map field-name="viewSize" from-field="viewSize"/>
-          </service>
+            <service service-name="performFind" result-map="result" result-map-list="listIt">
+                <field-map field-name="inputFields" from-field="parameters"/>
+                <field-map field-name="entityName" from-field="entityName"/>
+                <field-map field-name="orderBy" from-field="parameters.sortField"/>
+                <field-map field-name="viewIndex" from-field="viewIndex"/>
+                <field-map field-name="viewSize" from-field="viewSize"/>
+            </service>
         </actions>
     </form>
 
diff --git a/applications/order/widget/ordermgr/CustRequestScreens.xml b/applications/order/widget/ordermgr/CustRequestScreens.xml
index dcf5f47..2c4e9a8 100644
--- a/applications/order/widget/ordermgr/CustRequestScreens.xml
+++ b/applications/order/widget/ordermgr/CustRequestScreens.xml
@@ -19,14 +19,72 @@ under the License.
 -->
 
 <screens xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-        xmlns="http://ofbiz.apache.org/Widget-Screen" xsi:schemaLocation="http://ofbiz.apache.org/Widget-Screen http://ofbiz.apache.org/dtds/widget-screen.xsd">
-    
+         xmlns="http://ofbiz.apache.org/Widget-Screen"
+         xsi:schemaLocation="http://ofbiz.apache.org/Widget-Screen http://ofbiz.apache.org/dtds/widget-screen.xsd">
+    <screen name="FindRequest">
+        <section>
+            <actions>
+                <set field="titleProperty" value="OrderFindRequests"/>
+                <set field="headerItem" value="request"/>
+                <set field="entityName" value="CustRequest"/>
+                <set field="asm_multipleSelectForm" value="FindRequests"/>
+                <set field="asm_asmListItemPercentOfForm" value="110"/>
+                <set field="custRequestType.asm_multipleSelect" value="FindRequests_custRequestTypeId"/>
+                <set field="custRequestType.asm_sortable" value="true"/>
+                <set field="custRequestType.asm_title" value=" "/>
+                <set field="statusId.asm_multipleSelect" value="FindRequests_statusId"/>
+                <set field="statusId.asm_sortable" value="true"/>
+                <set field="statusId.asm_title" value=" "/>
+                <set field="productStoreId.asm_multipleSelect" value="FindRequests_productStoreId"/>
+                <set field="productStoreId.asm_sortable" value="true"/>
+                <set field="productStoreId.asm_title" value=" "/>
+                <set field="salesChannelEnumId.asm_multipleSelect" value="FindRequests_salesChannelEnumId"/>
+                <set field="salesChannelEnumId.asm_sortable" value="true"/>
+                <set field="salesChannelEnumId.asm_title" value=" "/>
+                <set field="asm_listField[]" from-field="custRequestType"/>
+                <set field="asm_listField[]" from-field="statusId"/>
+                <set field="asm_listField[]" from-field="productStoreId"/>
+                <set field="asm_listField[]" from-field="salesChannelEnumId"/>
+            </actions>
+            <widgets>
+                <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
+                    <decorator-section name="body">
+                        <decorator-screen name="FindScreenDecorator"
+                                          location="component://common/widget/CommonScreens.xml">
+                            <decorator-section name="menu-bar">
+                                <container style="button-bar">
+                                    <link target="request" text="${uiLabelMap.OrderNewRequest}"
+                                          style="buttontext create"/>
+                                </container>
+                            </decorator-section>
+                            <decorator-section name="search-options">
+                                <platform-specific>
+                                    <html>
+                                        <html-template multi-block="true"
+                                                       location="component://common-theme/template/includes/SetMultipleSelectJsList.ftl"/>
+                                    </html>
+                                </platform-specific>
+                                <include-form name="FindRequests"
+                                              location="component://order/widget/ordermgr/FindRequestCompound.xml"/>
+                            </decorator-section>
+                            <decorator-section name="search-results">
+                                <include-form name="ListRequests"
+                                              location="component://order/widget/ordermgr/CustRequestForms.xml"/>
+                            </decorator-section>
+                        </decorator-screen>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
+
     <screen name="ViewCustRequest">
         <section>
             <actions>
                 <set field="custRequestId" from-field="parameters.custRequestId" default-value="${parameters.id}"/>
                 <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="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"/>