svn commit: r786711 - in /ofbiz/trunk/applications/order: servicedef/services.xml src/org/ofbiz/order/order/OrderServices.java webapp/ordermgr/WEB-INF/controller.xml webapp/ordermgr/order/findOrders.ftl

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

svn commit: r786711 - in /ofbiz/trunk/applications/order: servicedef/services.xml src/org/ofbiz/order/order/OrderServices.java webapp/ordermgr/WEB-INF/controller.xml webapp/ordermgr/order/findOrders.ftl

apatel-2
Author: apatel
Date: Fri Jun 19 23:11:42 2009
New Revision: 786711

URL: http://svn.apache.org/viewvc?rev=786711&view=rev
Log:
Added options to perform quickShip action on selected orders from list.

Modified:
    ofbiz/trunk/applications/order/servicedef/services.xml
    ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java
    ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml
    ofbiz/trunk/applications/order/webapp/ordermgr/order/findOrders.ftl

Modified: ofbiz/trunk/applications/order/servicedef/services.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/servicedef/services.xml?rev=786711&r1=786710&r2=786711&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/servicedef/services.xml (original)
+++ ofbiz/trunk/applications/order/servicedef/services.xml Fri Jun 19 23:11:42 2009
@@ -603,6 +603,10 @@
             location="org.ofbiz.order.order.OrderServices" invoke="massRejectOrders" auth="true">
         <implements service="massOrderChangeInterface"/>
     </service>
+    <service name="massQuickShipOrders" engine="java" transaction-timeout="300"
+            location="org.ofbiz.order.order.OrderServices" invoke="massQuickShipOrders" auth="true">
+        <implements service="massOrderChangeInterface"/>
+    </service>
     <service name="massPrintOrders" engine="java" transaction-timeout="300"
             location="org.ofbiz.order.order.OrderServices" invoke="massPrintOrders" auth="true">
         <implements service="massOrderChangeInterface"/>

Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java?rev=786711&r1=786710&r2=786711&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java (original)
+++ ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java Fri Jun 19 23:11:42 2009
@@ -4336,6 +4336,33 @@
         return ServiceUtil.returnSuccess();
     }
 
+    public static Map massQuickShipOrders(DispatchContext dctx, Map context) {
+        LocalDispatcher dispatcher = dctx.getDispatcher();
+        GenericValue userLogin = (GenericValue) context.get("userLogin");
+        List orderIds = (List) context.get("orderIdList");
+
+        for (Object orderId : orderIds){
+            if (UtilValidate.isEmpty(orderId)) {
+                continue;
+            }
+            Map ctx = FastMap.newInstance();
+            ctx.put("userLogin", userLogin);
+            ctx.put("orderId", orderId);
+
+            Map resp = null;
+            try {
+                resp = dispatcher.runSync("quickShipEntireOrder", ctx);
+            } catch (GenericServiceException e) {
+                Debug.logError(e, module);
+                return ServiceUtil.returnError(e.getMessage());
+            }
+            if (ServiceUtil.isError(resp)) {
+                return ServiceUtil.returnError("Error quickShipEntireOrder for order: ", null, null, resp);
+            }
+        }
+        return ServiceUtil.returnSuccess();
+    }
+
     public static Map massPickOrders(DispatchContext dctx, Map context) {
         LocalDispatcher dispatcher = dctx.getDispatcher();
         GenericDelegator delegator = dctx.getDelegator();

Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml?rev=786711&r1=786710&r2=786711&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml Fri Jun 19 23:11:42 2009
@@ -126,6 +126,12 @@
         <response name="success" type="request-redirect" value="findorders"/>
         <response name="error" type="view" value="findorders"/>
     </request-map>
+    <request-map uri="massQuickShipOrders">
+        <security https="true" auth="true"/>
+        <event type="service" path="" invoke="massQuickShipOrders"/>
+        <response name="success" type="request-redirect" value="findorders"/>
+        <response name="error" type="view" value="findorders"/>
+    </request-map>
     <request-map uri="massPickOrders">
         <security https="true" auth="true"/>
         <event type="service" path="" invoke="massPickOrders"/>

Modified: ofbiz/trunk/applications/order/webapp/ordermgr/order/findOrders.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/order/findOrders.ftl?rev=786711&r1=786710&r2=786711&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/order/findOrders.ftl (original)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/order/findOrders.ftl Fri Jun 19 23:11:42 2009
@@ -512,6 +512,7 @@
            <option value="<@ofbizUrl>massCancelOrders?hideFields=${requestParameters.hideFields?default("N")}${paramList}</@ofbizUrl>">${uiLabelMap.OrderCancelOrder}</option>
            <option value="<@ofbizUrl>massRejectOrders?hideFields=${requestParameters.hideFields?default("N")}${paramList}</@ofbizUrl>">${uiLabelMap.OrderRejectOrder}</option>
            <option value="<@ofbizUrl>massPickOrders?hideFields=${requestParameters.hideFields?default("N")}${paramList}</@ofbizUrl>">${uiLabelMap.OrderPickOrders}</option>
+           <option value="<@ofbizUrl>massQuickShipOrders?hideFields=${requestParameters.hideFields?default("N")}${paramList}</@ofbizUrl>">${uiLabelMap.OrderQuickShipEntireOrder}</option>
            <option value="<@ofbizUrl>massPrintOrders?hideFields=${requestParameters.hideFields?default('N')}${paramList}</@ofbizUrl>">${uiLabelMap.CommonPrint}</option>
            <option value="<@ofbizUrl>massCreateFileForOrders?hideFields=${requestParameters.hideFields?default('N')}${paramList}</@ofbizUrl>">${uiLabelMap.ContentCreateFile}</option>
         </select>