svn commit: r796371 - in /ofbiz/trunk/applications/product: config/ webapp/catalog/WEB-INF/ webapp/catalog/product/ widget/catalog/

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r796371 - in /ofbiz/trunk/applications/product: config/ webapp/catalog/WEB-INF/ webapp/catalog/product/ widget/catalog/

mor-2
Author: mor
Date: Tue Jul 21 16:37:01 2009
New Revision: 796371

URL: http://svn.apache.org/viewvc?rev=796371&view=rev
Log:
Added Orders tab to Product page. This will show all orders placed against the product. Patch from Akash Jain.

Added:
    ofbiz/trunk/applications/product/webapp/catalog/product/ViewProductOrders.ftl   (with props)
Modified:
    ofbiz/trunk/applications/product/config/ProductUiLabels.xml
    ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/controller.xml
    ofbiz/trunk/applications/product/widget/catalog/CommonScreens.xml
    ofbiz/trunk/applications/product/widget/catalog/Menus.xml
    ofbiz/trunk/applications/product/widget/catalog/ProductScreens.xml

Modified: ofbiz/trunk/applications/product/config/ProductUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/config/ProductUiLabels.xml?rev=796371&r1=796370&r2=796371&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/config/ProductUiLabels.xml (original)
+++ ofbiz/trunk/applications/product/config/ProductUiLabels.xml Tue Jul 21 16:37:01 2009
@@ -5732,6 +5732,9 @@
         <value xml:lang="th">แสดงการผลิตสินค้า</value>
         <value xml:lang="zh">浏览产品制造</value>
     </property>
+    <property key="PageTitleViewProductOrders">
+        <value xml:lang="en">View Product Orders</value>
+    </property>
     <property key="PageTitleViewProductStoreSegments">
         <value xml:lang="de">Läden Segmente anzeigen</value>
         <value xml:lang="en">View Product Store Segments</value>

Modified: ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/controller.xml?rev=796371&r1=796370&r2=796371&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/applications/product/webapp/catalog/WEB-INF/controller.xml Tue Jul 21 16:37:01 2009
@@ -2464,6 +2464,12 @@
         <response name="error" type="view" value="EditProductWorkEfforts"/>
     </request-map>
 
+    <request-map uri="viewProductOrder">
+        <security https="true" auth="true"/>
+        <event type="service" invoke="findOrders"/>
+        <response name="success" type="view" value="ViewProductOrder"/>
+        <response name="error" type="view" value="EditProduct"/>
+    </request-map>
 
    <!-- ================ Lookup Requests ================= -->
     <request-map uri="LookupContent"><security auth="true" https="true"/><response name="success" type="view" value="LookupContent"/></request-map>
@@ -2630,6 +2636,8 @@
 
     <view-map name="pendingReviews" type="screen" page="component://product/widget/catalog/ReviewScreens.xml#pendingReviews"/>
 
+    <view-map name="ViewProductOrder" type="screen" page="component://product/widget/catalog/ProductScreens.xml#ViewProductOrder"/>
+
     <!-- Product Configuration views -->
     <view-map name="ProductConfigItemArticle" type="screen" page="component://product/widget/catalog/ConfigScreens.xml#ProductConfigItemArticle"/>
     <view-map name="FindProductConfigItems" type="screen" page="component://product/widget/catalog/ConfigScreens.xml#FindProductConfigItems"/>

Added: ofbiz/trunk/applications/product/webapp/catalog/product/ViewProductOrders.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/catalog/product/ViewProductOrders.ftl?rev=796371&view=auto
==============================================================================
--- ofbiz/trunk/applications/product/webapp/catalog/product/ViewProductOrders.ftl (added)
+++ ofbiz/trunk/applications/product/webapp/catalog/product/ViewProductOrders.ftl Tue Jul 21 16:37:01 2009
@@ -0,0 +1,97 @@
+<#--
+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.
+-->
+
+<script language="JavaScript" type="text/javascript">
+    function paginateOrderList(viewSize, viewIndex) {
+        document.paginationForm.viewSize.value = viewSize;
+        document.paginationForm.viewIndex.value = viewIndex;
+        document.paginationForm.submit();
+    }
+</script>
+
+<div class="screenlet">
+  <div class="screenlet-title-bar">
+    <ul>
+      <li class="h3">${uiLabelMap.OrderOrderFound}</li>
+      <#if (orderList?has_content && 0 < orderList?size)>
+        <#if (orderListSize > highIndex)>
+          <li><a href="javascript:paginateOrderList('${viewSize}', '${viewIndex+1}')">${uiLabelMap.CommonNext}</a></li>
+        <#else>
+          <li><span class="disabled">${uiLabelMap.CommonNext}</span></li>
+        </#if>
+        <#if (orderListSize > 0)>
+          <li><span>${lowIndex} - ${highIndex} ${uiLabelMap.CommonOf} ${orderListSize}</span></li>
+        </#if>
+        <#if (viewIndex > 1)>
+          <li><a href="javascript:paginateOrderList('${viewSize}', '${viewIndex-1}')">${uiLabelMap.CommonPrevious}</a></li>
+        <#else>
+          <li><span class="disabled">${uiLabelMap.CommonPrevious}</span></li>
+        </#if>
+      </#if>
+    </ul>
+  </div>
+  <div class="screenlet-body">
+    <form name="paginationForm" method="post" action="<@ofbizUrl>viewProductOrder</@ofbizUrl>">
+      <input type="hidden" name="viewSize"/>
+      <input type="hidden" name="viewIndex"/>
+      <#if paramIdList?exists && paramIdList?has_content>
+        <#list paramIdList as paramIds>
+          <#assign paramId = paramIds.split("=")/>
+          <#if "productId" == paramId[0]>
+            <#assign productId = paramId[1]/>
+          </#if>
+          <input type="hidden" name="${paramId[0]}" value="${paramId[1]}"/>
+        </#list>
+      </#if>
+    </form>
+    <table class="basic-table hover-bar" cellspacing='0'>
+      <tr class="header-row">
+        <td>${uiLabelMap.OrderOrderId}</td>
+        <td>${uiLabelMap.FormFieldTitle_itemStatusId}</td>
+        <td>${uiLabelMap.FormFieldTitle_orderItemSeqId}</td>
+        <td>${uiLabelMap.OrderDate}</td>
+        <td>${uiLabelMap.OrderUnitPrice}</td>
+        <td>${uiLabelMap.OrderQuantity}</td>
+        <td>${uiLabelMap.OrderOrderType}</td>
+      </tr>
+      <#if orderList?has_content && productId?exists>
+        <#list orderList as order>
+          <#assign orderItems = delegator.findByAnd("OrderItem", {"orderId" : order.orderId, "productId" : productId})/>
+          <#list orderItems as orderItem>
+            <tr>
+              <td><a href="/ordermgr/control/orderview?orderId=${orderItem.orderId}" class='buttontext'>${orderItem.orderId}</a></td>
+              <#assign currentItemStatus = orderItem.getRelatedOne("StatusItem")/>
+              <td>${currentItemStatus.get("description",locale)?default(currentItemStatus.statusId)}</td>
+              <td>${orderItem.orderItemSeqId}</td>
+              <td>${order.orderDate}</td>
+              <td>${orderItem.unitPrice}</td>
+              <td>${orderItem.quantity}</td>
+              <#assign currentOrderType = order.getRelatedOne("OrderType")/>
+              <td>${currentOrderType.get("description",locale)?default(currentOrderType.orderTypeId)}</td>
+            </tr>
+          </#list>
+        </#list>
+      <#else>
+        <tr>
+          <td colspan='4'><h3>${uiLabelMap.OrderNoOrderFound}</h3></td>
+        </tr>
+      </#if>
+    </table>
+  </div>
+</div>
\ No newline at end of file

Propchange: ofbiz/trunk/applications/product/webapp/catalog/product/ViewProductOrders.ftl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/applications/product/webapp/catalog/product/ViewProductOrders.ftl
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Author URL Id"

Propchange: ofbiz/trunk/applications/product/webapp/catalog/product/ViewProductOrders.ftl
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: ofbiz/trunk/applications/product/widget/catalog/CommonScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/widget/catalog/CommonScreens.xml?rev=796371&r1=796370&r2=796371&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/widget/catalog/CommonScreens.xml (original)
+++ ofbiz/trunk/applications/product/widget/catalog/CommonScreens.xml Tue Jul 21 16:37:01 2009
@@ -54,6 +54,7 @@
         <section>
             <actions>
                 <property-map resource="PartyUiLabels" map-name="uiLabelMap" global="true"/>
+                <property-map resource="OrderUiLabels" map-name="uiLabelMap" global="true"/>
                 <set field="leftbarScreenName" value="leftbar"/>
                 <set field="leftbarScreenLocation" value="component://product/widget/catalog/CommonScreens.xml"/>
                 <set field="MainColumnStyle" value="leftonly"/>

Modified: ofbiz/trunk/applications/product/widget/catalog/Menus.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/widget/catalog/Menus.xml?rev=796371&r1=796370&r2=796371&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/widget/catalog/Menus.xml (original)
+++ ofbiz/trunk/applications/product/widget/catalog/Menus.xml Tue Jul 21 16:37:01 2009
@@ -392,6 +392,14 @@
                 <parameter param-name="productId"/>
             </link>
         </menu-item>
+        <menu-item name="viewProductOrder" title="${uiLabelMap.OrderOrder}">
+            <link target="viewProductOrder">
+                <parameter param-name="productId"/>
+                <parameter param-name="viewIndex" value="1"/>
+                <parameter param-name="viewSize" value="20"/>
+                <parameter param-name="showAll" value="Y"/>
+            </link>
+        </menu-item>
     </menu>
 
     <menu name="ConfigItemTabBar" extends="CommonTabBarMenu" extends-resource="component://common/widget/CommonMenus.xml">

Modified: ofbiz/trunk/applications/product/widget/catalog/ProductScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/widget/catalog/ProductScreens.xml?rev=796371&r1=796370&r2=796371&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/widget/catalog/ProductScreens.xml (original)
+++ ofbiz/trunk/applications/product/widget/catalog/ProductScreens.xml Tue Jul 21 16:37:01 2009
@@ -1842,4 +1842,22 @@
             </widgets>
         </section>
     </screen>
+
+    <screen name="ViewProductOrder">
+        <section>
+            <actions>
+                <set field="titleProperty" value="PageTitleViewProductOrders"/>
+                <script location="component://order/webapp/ordermgr/WEB-INF/actions/order/FindOrders.groovy"/>
+            </actions>
+            <widgets>
+                <decorator-screen name="CommonProductDecorator" location="${parameters.mainDecoratorLocation}">
+                    <decorator-section name="body">
+                        <platform-specific>
+                            <html><html-template location="component://product/webapp/catalog/product/ViewProductOrders.ftl"/></html>
+                        </platform-specific>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
 </screens>