svn commit: r777007 - in /ofbiz/trunk/applications/order: servicedef/services.xml src/org/ofbiz/order/order/OrderLookupServices.java 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: r777007 - in /ofbiz/trunk/applications/order: servicedef/services.xml src/org/ofbiz/order/order/OrderLookupServices.java webapp/ordermgr/order/findOrders.ftl

mor-2
Author: mor
Date: Thu May 21 08:23:08 2009
New Revision: 777007

URL: http://svn.apache.org/viewvc?rev=777007&view=rev
Log:
Misc. improvement over recently added filters on find order page

Modified:
    ofbiz/trunk/applications/order/servicedef/services.xml
    ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderLookupServices.java
    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=777007&r1=777006&r2=777007&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/servicedef/services.xml (original)
+++ ofbiz/trunk/applications/order/servicedef/services.xml Thu May 21 08:23:08 2009
@@ -800,7 +800,7 @@
         <attribute name="filterPartiallyReceivedPOs" type="String" mode="IN" optional="true"/>
         
         <!-- ship to country fields -->
-        <attribute name="country" type="String" mode="IN" optional="true"/>
+        <attribute name="countryGeoId" type="String" mode="IN" optional="true"/>
         <attribute name="includeCountry" type="String" mode="IN" optional="true"/>        
 
         <!-- view and page fields -->

Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderLookupServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderLookupServices.java?rev=777007&r1=777006&r2=777007&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderLookupServices.java (original)
+++ ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderLookupServices.java Thu May 21 08:23:08 2009
@@ -468,10 +468,10 @@
         }
 
         //Get all orders according to specific ship to country with "Only Include" or "Do not Include".
-        String country = (String) context.get("country");
+        String countryGeoId = (String) context.get("countryGeoId");
         String includeCountry = (String) context.get("includeCountry");
-        if (UtilValidate.isNotEmpty(country) && UtilValidate.isNotEmpty(includeCountry)) {
-            paramList.add("country=" + country);
+        if (UtilValidate.isNotEmpty(countryGeoId) && UtilValidate.isNotEmpty(includeCountry)) {
+            paramList.add("countryGeoId=" + countryGeoId);
             paramList.add("includeCountry=" + includeCountry);
             boolean hasRecord = false;
             List orExprs = FastList.newInstance();
@@ -487,13 +487,13 @@
                         if ("Y".equals(includeCountry)) {
                             andExprs = EntityCondition.makeCondition( UtilMisc.toList(
                                     EntityCondition.makeCondition("contactMechId", orderContactMech.get("contactMechId")),
-                                    EntityCondition.makeCondition("countryGeoId", EntityOperator.EQUALS, country)
+                                    EntityCondition.makeCondition("countryGeoId", EntityOperator.EQUALS, countryGeoId)
                                     ), EntityOperator.AND);
                         }
                         else {
                             andExprs = EntityCondition.makeCondition( UtilMisc.toList(
                                     EntityCondition.makeCondition("contactMechId", orderContactMech.get("contactMechId")),
-                                    EntityCondition.makeCondition("countryGeoId", EntityOperator.NOT_EQUAL, country)
+                                    EntityCondition.makeCondition("countryGeoId", EntityOperator.NOT_EQUAL, countryGeoId)
                                     ), EntityOperator.AND);
                         }
                         postalAddresses = delegator.findList("PostalAddress", andExprs, null, null, null, false);

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=777007&r1=777006&r2=777007&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/order/findOrders.ftl (original)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/order/findOrders.ftl Thu May 21 08:23:08 2009
@@ -94,6 +94,8 @@
   <input type='hidden' name='filterPartiallyReceivedPOs' value='${requestParameters.filterPartiallyReceivedPOs?if_exists}'/>
   <input type='hidden' name='filterPOsOpenPastTheirETA' value='${requestParameters.filterPOsOpenPastTheirETA?if_exists}'/>
   <input type='hidden' name='filterPOsWithRejectedItems' value='${requestParameters.filterPOsWithRejectedItems?if_exists}'/>
+  <input type='hidden' name='countryGeoId' value='${requestParameters.countryGeoId?if_exists}'/>
+  <input type='hidden' name='includeCountry' value='${requestParameters.includeCountry?if_exists}'/>
 </form>
 </#if>
 <form method="post" name="lookuporder" action="<@ofbizUrl>searchorders</@ofbizUrl>" onsubmit="javascript:lookupOrders();">
@@ -379,13 +381,24 @@
                 <td width='25%' align='right' class='label'>${uiLabelMap.OrderShipToCountry}</td>
                 <td width='5%'>&nbsp;</td>
                 <td align='left'>
-                    <select name="country">
-                      ${screens.render("component://common/widget/CommonScreens.xml#countries")}
-                    </select>
-                    <select name="includeCountry">
-                      <option value="Y">${uiLabelMap.OrderOnlyInclude}</option>
-                      <option value="N">${uiLabelMap.OrderDoNotInclude}</option>
-                    </select>
+                  <select name="countryGeoId">
+                    <#if requestParameters.countryGeoId?has_content>
+                        <#assign countryGeoId = requestParameters.countryGeoId>
+                        <#assign geo = delegator.findOne("Geo", Static["org.ofbiz.base.util.UtilMisc"].toMap("geoId", countryGeoId), true)>
+                        <option value="${countryGeoId}">${geo.geoName?if_exists}</option>
+                        <option value="${countryGeoId}">---</option>
+                    </#if>
+                    ${screens.render("component://common/widget/CommonScreens.xml#countries")}
+                  </select>
+                  <select name="includeCountry">
+                    <#if requestParameters.includeCountry?has_content>
+                       <#assign includeCountry = requestParameters.includeCountry>
+                       <option value="${includeCountry}"><#if "Y" == includeCountry>${uiLabelMap.OrderOnlyInclude}<#elseif "N" == includeCountry>${uiLabelMap.OrderDoNotInclude}</#if></option>
+                       <option value="${includeCountry}">---</option>
+                    </#if>  
+                    <option value="Y">${uiLabelMap.OrderOnlyInclude}</option>
+                    <option value="N">${uiLabelMap.OrderDoNotInclude}</option>
+                  </select>
                 </td>
               </tr>
               <tr><td colspan="3"><hr/></td></tr>