Author: sichen
Date: Mon Sep 11 14:37:04 2006
New Revision: 442355

URL: http://svn.apache.org/viewvc?view=rev&rev=442355
Log:
Ability to update order item description when editing order items

Modified:
    incubator/ofbiz/trunk/applications/order/servicedef/services.xml
    
incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java
    
incubator/ofbiz/trunk/applications/order/webapp/ordermgr/order/editorderitems.ftl

Modified: incubator/ofbiz/trunk/applications/order/servicedef/services.xml
URL: 
http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/servicedef/services.xml?view=diff&rev=442355&r1=442354&r2=442355
==============================================================================
--- incubator/ofbiz/trunk/applications/order/servicedef/services.xml (original)
+++ incubator/ofbiz/trunk/applications/order/servicedef/services.xml Mon Sep 11 
14:37:04 2006
@@ -245,6 +245,7 @@
             location="org.ofbiz.order.order.OrderServices" 
invoke="updateApprovedOrderItems">
         <description>Update the quantities/prices for an existing 
order</description>
         <attribute name="orderId" type="String" mode="INOUT" optional="false"/>
+        <attribute name="itemDescriptionMap" type="Map" mode="IN" 
string-map-prefix="idm_" optional="true"/>
         <attribute name="itemQtyMap" type="Map" mode="IN" 
string-map-prefix="iqm_" optional="false"/>
         <attribute name="itemPriceMap" type="Map" mode="IN" 
string-map-prefix="ipm_" optional="false"/>
         <attribute name="overridePriceMap" type="Map" mode="IN" 
string-map-prefix="opm_" optional="false"/>

Modified: 
incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java
URL: 
http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java?view=diff&rev=442355&r1=442354&r2=442355
==============================================================================
--- 
incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java
 (original)
+++ 
incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java
 Mon Sep 11 14:37:04 2006
@@ -2893,6 +2893,7 @@
         Locale locale = (Locale) context.get("locale");
         String orderId = (String) context.get("orderId");
         Map overridePriceMap = (Map) context.get("overridePriceMap");
+        Map itemDescriptionMap = (Map) context.get("itemDescriptionMap");
         Map itemPriceMap = (Map) context.get("itemPriceMap");
         Map itemQtyMap = (Map) context.get("itemQtyMap");
 
@@ -2980,6 +2981,17 @@
                         Debug.log("Set item price: [" + itemSeqId + "] " + 
price, module);
                     }
 
+                }
+
+                // Update the item description
+                if (itemDescriptionMap != null && 
itemDescriptionMap.containsKey(itemSeqId)) {
+                    String description = (String) 
itemDescriptionMap.get(itemSeqId);
+                    if (UtilValidate.isNotEmpty(description)) {
+                        cartItem.setName(description);
+                        Debug.log("Set item description: [" + itemSeqId + "] " 
+ description, module);
+                    } else {
+                        return ServiceUtil.returnError("Item description must 
not be empty");
+                    }
                 }
             } else {
                 Debug.logInfo("Unable to locate shopping cart item for seqId 
#" + itemSeqId, module);

Modified: 
incubator/ofbiz/trunk/applications/order/webapp/ordermgr/order/editorderitems.ftl
URL: 
http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/webapp/ordermgr/order/editorderitems.ftl?view=diff&rev=442355&r1=442354&r2=442355
==============================================================================
--- 
incubator/ofbiz/trunk/applications/order/webapp/ordermgr/order/editorderitems.ftl
 (original)
+++ 
incubator/ofbiz/trunk/applications/order/webapp/ordermgr/order/editorderitems.ftl
 Mon Sep 11 14:37:04 2006
@@ -55,12 +55,23 @@
                 <#else>
                   <td valign="top">
                     <div class="tabletext">
-                      <#if productId?exists>
-                        ${orderItem.productId?default("N/A")} - 
${orderItem.itemDescription?if_exists}
-                      <#elseif orderItemType?exists>
-                        ${orderItemType.description} - 
${orderItem.itemDescription?if_exists}
+                      <#if orderHeader.statusId = "ORDER_CANCELLED" || 
orderHeader.statusId = "ORDER_COMPLETED">
+                        <#if productId?exists>
+                          ${orderItem.productId?default("N/A")} - 
${orderItem.itemDescription?if_exists}
+                        <#elseif orderItemType?exists>
+                          ${orderItemType.description} - 
${orderItem.itemDescription?if_exists}
+                        <#else>
+                          ${orderItem.itemDescription?if_exists}
+                        </#if>
                       <#else>
-                        ${orderItem.itemDescription?if_exists}
+                        <#if productId?exists>
+                          <#assign orderItemName = 
orderItem.productId?default("N/A")/>
+                        <#elseif orderItemType?exists>
+                          <#assign orderItemName = orderItemType.description/>
+                        </#if>
+                        <p>${uiLabelMap.ProductProduct}: ${orderItemName}</p>
+                        ${uiLabelMap.CommonDescription}:<br />
+                        <input style="textBox" type="text" size="20" 
name="idm_${orderItem.orderItemSeqId}" 
value="${orderItem.itemDescription?if_exists}"/>
                       </#if>
                     </div>
                     <#if productId?exists>


Reply via email to