svn commit: r439995 - in /incubator/ofbiz/trunk/applications: ecommerce/webapp/ecommerce/WEB-INF/ ecommerce/webapp/ecommerce/order/ order/servicedef/ order/src/org/ofbiz/order/shoppingcart/ order/webapp/ordermgr/WEB-INF/ order/webapp/ordermgr/order/

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

svn commit: r439995 - in /incubator/ofbiz/trunk/applications: ecommerce/webapp/ecommerce/WEB-INF/ ecommerce/webapp/ecommerce/order/ order/servicedef/ order/src/org/ofbiz/order/shoppingcart/ order/webapp/ordermgr/WEB-INF/ order/webapp/ordermgr/order/

jacopoc
Author: jacopoc
Date: Mon Sep  4 02:36:01 2006
New Revision: 439995

URL: http://svn.apache.org/viewvc?view=rev&rev=439995
Log:
Order items are now cancelled invoking directly the "cancelOrderItem" service instead of calling the omonimous CheckOutEvents method (that I have removed).

Modified:
    incubator/ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/controller.xml
    incubator/ofbiz/trunk/applications/ecommerce/webapp/ecommerce/order/orderitems.ftl
    incubator/ofbiz/trunk/applications/order/servicedef/secas.xml
    incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutEvents.java
    incubator/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml
    incubator/ofbiz/trunk/applications/order/webapp/ordermgr/order/editorderitems.ftl

Modified: incubator/ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/controller.xml?view=diff&rev=439995&r1=439994&r2=439995
==============================================================================
--- incubator/ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/controller.xml (original)
+++ incubator/ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/controller.xml Mon Sep  4 02:36:01 2006
@@ -672,11 +672,10 @@
     </request-map>
     <request-map uri="cancelOrderItem">
         <security https="true" auth="true"/>
-        <event type="java" path="org.ofbiz.order.shoppingcart.CheckOutEvents" invoke="cancelOrderItem"/>
+        <event type="service" invoke="cancelOrderItem"/>
         <response name="success" type="view" value="orderstatus"/>
         <response name="error" type="view" value="orderstatus"/>
     </request-map>
-
     <request-map uri="downloadDigitalProduct">
         <security auth="true" https="true"/>
         <event type="java" path="org.ofbiz.order.order.OrderEvents" invoke="downloadDigitalProduct"/>

Modified: incubator/ofbiz/trunk/applications/ecommerce/webapp/ecommerce/order/orderitems.ftl
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/ecommerce/webapp/ecommerce/order/orderitems.ftl?view=diff&rev=439995&r1=439994&r2=439995
==============================================================================
--- incubator/ofbiz/trunk/applications/ecommerce/webapp/ecommerce/order/orderitems.ftl (original)
+++ incubator/ofbiz/trunk/applications/ecommerce/webapp/ecommerce/order/orderitems.ftl Mon Sep  4 02:36:01 2006
@@ -157,7 +157,7 @@
                 <#if maySelectItems?default("N") == "Y">
                   <td>&nbsp;</td>
                   <#if (orderHeader.statusId != "ORDER_SENT" && orderItem.statusId != "ITEM_COMPLETED" && orderItem.statusId != "ITEM_CANCELLED")>
-                    <td><a href="<@ofbizUrl>cancelOrderItem?orderId=${orderItem.orderId}&item_seq=${orderItem.orderItemSeqId}</@ofbizUrl>" class="buttontext">${uiLabelMap.CommonCancel}</a></td>
+                    <td><a href="<@ofbizUrl>cancelOrderItem?orderId=${orderItem.orderId}&amp;orderItemSeqId=${orderItem.orderItemSeqId}</@ofbizUrl>" class="buttontext">${uiLabelMap.CommonCancel}</a></td>
                   <#else>
                     <td>&nbsp;</td>
                   </#if>

Modified: incubator/ofbiz/trunk/applications/order/servicedef/secas.xml
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/servicedef/secas.xml?view=diff&rev=439995&r1=439994&r2=439995
==============================================================================
--- incubator/ofbiz/trunk/applications/order/servicedef/secas.xml (original)
+++ incubator/ofbiz/trunk/applications/order/servicedef/secas.xml Mon Sep  4 02:36:01 2006
@@ -94,7 +94,16 @@
     <eca service="appendOrderItem" event="return">
         <action service="processOrderPayments" mode="sync"/>
     </eca>
-
+    <!-- cancel order items -->
+    <eca service="cancelOrderItem" event="commit">
+        <action service="recreateOrderAdjustments" mode="sync"/>
+        <action service="resetGrandTotal" mode="sync"/>
+    </eca>
+    <!--
+    <eca service="cancelOrderItem" event="return">
+        <action service="processOrderPayments" mode="sync"/>
+    </eca>
+    -->
     <!-- order confirmation/notification email ECAs -->
     <eca service="sendOrderConfirmation" event="commit">
         <action service="createOrderNotificationLog" mode="sync"/>

Modified: incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutEvents.java
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutEvents.java?view=diff&rev=439995&r1=439994&r2=439995
==============================================================================
--- incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutEvents.java (original)
+++ incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutEvents.java Mon Sep  4 02:36:01 2006
@@ -77,47 +77,6 @@
         }
     }
 
-    public static String cancelOrderItem(HttpServletRequest request, HttpServletResponse response) {
-        LocalDispatcher dispatcher = (LocalDispatcher) request.getAttribute("dispatcher");
-        GenericValue userLogin = (GenericValue) request.getSession().getAttribute("userLogin");
-        String orderId = request.getParameter("orderId");
-        String itemSeqId = request.getParameter("item_seq");
-        String groupSeqId = request.getParameter("group_seq");
-        Locale locale = UtilHttp.getLocale(request);
-
-        Map fields = UtilMisc.toMap("orderId", orderId, "orderItemSeqId", itemSeqId, "shipGroupSeqId", groupSeqId, "userLogin", userLogin);
-        Map result = null;
-        String errMsg = null;
-
-        try {
-            result = dispatcher.runSync("cancelOrderItem", fields);
-        } catch (GenericServiceException e) {
-            Debug.logError(e, module);
-            errMsg = UtilProperties.getMessage(resource, "checkevents.cannot_cancel_item", locale);
-            request.setAttribute("_ERROR_MESSAGE_", errMsg);
-            return "error";
-        }
-        if (result.containsKey(ModelService.ERROR_MESSAGE)) {
-            request.setAttribute("_ERROR_MESSAGE_", result.get(ModelService.ERROR_MESSAGE));
-            return "error";
-        }
-
-        try {
-            result = dispatcher.runSync("recreateOrderAdjustments", UtilMisc.toMap("userLogin", userLogin, "orderId", orderId));
-        } catch (GenericServiceException e) {
-            Debug.logError(e, module);
-            errMsg = UtilProperties.getMessage(resource, "checkevents.cannot_recalc_adjustments", locale);
-            request.setAttribute("_ERROR_MESSAGE_", errMsg);
-            return "error";
-        }
-        if (result.containsKey(ModelService.ERROR_MESSAGE)) {
-            request.setAttribute("_ERROR_MESSAGE_", result.get(ModelService.ERROR_MESSAGE));
-            return "error";
-        }
-
-        return "success";
-    }
-
     public static String setCheckOutPages(HttpServletRequest request, HttpServletResponse response) {
         if ("error".equals(CheckOutEvents.cartNotEmpty(request, response)) == true) {
             return "error";

Modified: incubator/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml?view=diff&rev=439995&r1=439994&r2=439995
==============================================================================
--- incubator/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml (original)
+++ incubator/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml Mon Sep  4 02:36:01 2006
@@ -215,7 +215,7 @@
     </request-map>
     <request-map uri="cancelOrderItem">
         <security https="true" auth="true"/>
-        <event type="java" path="org.ofbiz.order.shoppingcart.CheckOutEvents" invoke="cancelOrderItem"/>
+        <event type="service" invoke="cancelOrderItem"/>
         <response name="success" type="view" value="orderview"/>
         <response name="error" type="view" value="orderview"/>
     </request-map>

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=439995&r1=439994&r2=439995
==============================================================================
--- incubator/ofbiz/trunk/applications/order/webapp/ordermgr/order/editorderitems.ftl (original)
+++ incubator/ofbiz/trunk/applications/order/webapp/ordermgr/order/editorderitems.ftl Mon Sep  4 02:36:01 2006
@@ -122,7 +122,7 @@
                   <td>&nbsp;</td>
                   <td align="right" valign="top" nowrap>
                     <#if (security.hasEntityPermission("ORDERMGR", "_ADMIN", session) && orderItem.statusId != "ITEM_CANCELLED" && orderItem.statusId != "ITEM_COMPLETED") || (security.hasEntityPermission("ORDERMGR", "_UPDATE", session) && orderItem.statusId != "ITEM_CANCELLED" && orderItem.statusId != "ITEM_COMPLETED" && orderHeader.statusId != "ORDER_SENT")>
-                      <div class="tabletext"><a href="<@ofbizUrl>cancelOrderItem?item_seq=${orderItem.orderItemSeqId}&${paramString}</@ofbizUrl>" class="buttontext">${uiLabelMap.CommonCancelAll}</a></div>
+                      <div class="tabletext"><a href="<@ofbizUrl>cancelOrderItem?orderItemSeqId=${orderItem.orderItemSeqId}&amp;${paramString}</@ofbizUrl>" class="buttontext">${uiLabelMap.CommonCancelAll}</a></div>
                     <#else>
                       &nbsp;
                     </#if>
@@ -189,7 +189,7 @@
                     <td align="right" valign="top" nowrap>
                       <#assign itemStatusOkay = (orderItem.statusId != "ITEM_CANCELLED" && orderItem.statusId != "ITEM_COMPLETED" && (shipGroupAssoc.cancelQuantity?default(0) < shipGroupAssoc.quantity?default(0)))>
                       <#if (security.hasEntityPermission("ORDERMGR", "_ADMIN", session) && itemStatusOkay) || (security.hasEntityPermission("ORDERMGR", "_UPDATE", session) && itemStatusOkay && orderHeader.statusId != "ORDER_SENT")>
-                        <div class="tabletext"><a href="<@ofbizUrl>cancelOrderItem?item_seq=${orderItem.orderItemSeqId}&group_seq=${shipGroup.shipGroupSeqId}&${paramString}</@ofbizUrl>" class="buttontext">${uiLabelMap.CommonCancel}</a></div>
+                        <div class="tabletext"><a href="<@ofbizUrl>cancelOrderItem?orderItemSeqId=${orderItem.orderItemSeqId}&amp;shipGroupSeqId=${shipGroup.shipGroupSeqId}&amp;${paramString}</@ofbizUrl>" class="buttontext">${uiLabelMap.CommonCancel}</a></div>
                       <#else>
                         &nbsp;
                       </#if>