Author: bibryam
Date: Tue Dec 25 10:27:56 2007
New Revision: 606797

URL: http://svn.apache.org/viewvc?rev=606797&view=rev
Log:
Applied my patch from JIRA Issue # OFBIZ-82 "Support for product catalogs in 
ordermgr order entry" reported by Si Chen.

Modified:
    
ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/orderagreements.bsh
    
ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/orderview.bsh
    ofbiz/trunk/applications/order/webapp/ordermgr/entry/orderagreements.ftl
    ofbiz/trunk/applications/order/webapp/ordermgr/order/appendorderitem.ftl

Modified: 
ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/orderagreements.bsh
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/orderagreements.bsh?rev=606797&r1=606796&r2=606797&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/orderagreements.bsh
 (original)
+++ 
ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/orderagreements.bsh
 Tue Dec 25 10:27:56 2007
@@ -48,12 +48,21 @@
         if ("PURCHASE_ORDER".equals(shoppingCart.getOrderType())) {
             // the agreement for a PO is from customer to payToParty (ie, us)
             agreements = delegator.findByAndCache("Agreement", 
UtilMisc.toMap("partyIdTo", partyId, "partyIdFrom", payToPartyId));
+            catalogCol = CatalogWorker.getAllCatalogIds(request);
         } else {
             // the agreement for a sales order is from us to the customer
             agreements = delegator.findByAndCache("Agreement", 
UtilMisc.toMap("partyIdTo", payToPartyId, "partyIdFrom", partyId));
+            catalogCol = CatalogWorker.getCatalogIdsAvailable(delegator, 
productStoreId, partyId);
         }
         if (agreements != null && agreements.size() > 0) {
             context.put("agreements", agreements);
+        }
+        if (catalogCol != null && catalogCol.size() > 0) {
+            currentCatalogId = (String) catalogCol.get(0);
+            currentCatalogName = CatalogWorker.getCatalogName(request, 
currentCatalogId);
+            context.put("catalogCol", catalogCol);
+            context.put("currentCatalogId", currentCatalogId);
+            context.put("currentCatalogName", currentCatalogName);
         }
     }
 }

Modified: 
ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/orderview.bsh
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/orderview.bsh?rev=606797&r1=606796&r2=606797&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/orderview.bsh
 (original)
+++ 
ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/orderview.bsh
 Tue Dec 25 10:27:56 2007
@@ -28,6 +28,7 @@
 import org.ofbiz.order.order.*;
 import org.ofbiz.party.contact.*;
 import org.ofbiz.product.inventory.InventoryWorker;
+import org.ofbiz.product.catalog.CatalogWorker;
 import org.ofbiz.accounting.payment.*;
 
 orderId = parameters.get("orderId");
@@ -378,6 +379,20 @@
         returnableItems = returnableItemServiceMap.get("returnableItems");
     }
     context.put("returnableItems", returnableItems);
+    
+    // get the catalogIds for appending items
+    if ("SALES_ORDER".equals(orderType)) {
+        catalogCol = CatalogWorker.getCatalogIdsAvailable(delegator, 
productStoreId, partyId);
+    } else {
+        catalogCol = CatalogWorker.getAllCatalogIds(request);
+    }
+    if (catalogCol != null && catalogCol.size() > 0) {
+        currentCatalogId = (String) catalogCol.get(0);
+        currentCatalogName = CatalogWorker.getCatalogName(request, 
currentCatalogId);
+        context.put("catalogCol", catalogCol);
+        context.put("currentCatalogId", currentCatalogId);
+        context.put("currentCatalogName", currentCatalogName);
+    }    
 }
 
 if (orderHeader != null) {

Modified: 
ofbiz/trunk/applications/order/webapp/ordermgr/entry/orderagreements.ftl
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/entry/orderagreements.ftl?rev=606797&r1=606796&r2=606797&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/entry/orderagreements.ftl 
(original)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/entry/orderagreements.ftl 
Tue Dec 25 10:27:56 2007
@@ -105,6 +105,24 @@
       <tr>
         <td>&nbsp;</td>
         <td class="tableheadtext" align="right">
+          ${uiLabelMap.ProductChooseCatalog}
+        </td>
+        <td>&nbsp;</td>
+        <td align="left">
+           <select name='CURRENT_CATALOG_ID' class='selectBox'>
+            <option value='${currentCatalogId}'>${currentCatalogName}</option>
+            <option value='${currentCatalogId}'></option>
+            <#list catalogCol as catalogId>
+              <#assign thisCatalogName = 
Static["org.ofbiz.product.catalog.CatalogWorker"].getCatalogName(request, 
catalogId)>
+              <option value='${catalogId}'>${thisCatalogName}</option>
+            </#list>
+          </select>
+        </td>
+      </tr>
+
+      <tr>
+        <td>&nbsp;</td>
+        <td class="tableheadtext" align="right">
           ${uiLabelMap.WorkEffortWorkEffortId}
         </td>
         <td>&nbsp;</td>

Modified: 
ofbiz/trunk/applications/order/webapp/ordermgr/order/appendorderitem.ftl
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/order/appendorderitem.ftl?rev=606797&r1=606796&r2=606797&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/order/appendorderitem.ftl 
(original)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/order/appendorderitem.ftl 
Tue Dec 25 10:27:56 2007
@@ -24,9 +24,17 @@
     </div>
     <div class="screenlet-body">
         <form method="post" 
action="<@ofbizUrl>appendItemToOrder?${paramString}</@ofbizUrl>" 
name="appendItemForm">
-            <#-- TODO: Presently, this is the ofbiz way of getting the 
prodCatalog, which is not generic. Replace with a selecatble list defaulting to 
this instead -->
-            <input type="hidden" name="prodCatalogId" 
value="${Static["org.ofbiz.product.catalog.CatalogWorker"].getCurrentCatalogId(request)?if_exists}"/>
             <table class="basic-table" cellspacing="0">
+                <tr>
+                  <td class="label">${uiLabelMap.ProductChooseCatalog} :</td>
+                  <td><select name='prodCatalogId' class='selectBox'>
+                    <#list catalogCol as catalogId>
+                      <#assign thisCatalogName = 
Static["org.ofbiz.product.catalog.CatalogWorker"].getCatalogName(request, 
catalogId)>
+                      <option value='${catalogId}'>${thisCatalogName}</option>
+                    </#list>
+                  </select>
+                  </td>
+                </tr>
                 <tr>
                   <td class="label">${uiLabelMap.ProductProductId} :</td>
                   <td><input type="text" size="25" name="productId" 
value="${requestParameters.productId?if_exists}"/>


Reply via email to