svn commit: r1866012 - in /ofbiz/ofbiz-framework/trunk: applications/order/groovyScripts/order/FindOrders.groovy applications/order/template/order/FindOrders.ftl themes/common-theme/template/includes/Countries.ftl

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

svn commit: r1866012 - in /ofbiz/ofbiz-framework/trunk: applications/order/groovyScripts/order/FindOrders.groovy applications/order/template/order/FindOrders.ftl themes/common-theme/template/includes/Countries.ftl

nmalin
Author: nmalin
Date: Tue Aug 27 21:30:58 2019
New Revision: 1866012

URL: http://svn.apache.org/viewvc?rev=1866012&view=rev
Log:
Improved:  Find order screen can't make a search without ship to country
(OFBIZ-11176)
When you search orders on the standard screen [1] you can't unselect a country.
The problem come from the populate country list by countries.ftl who select by default a country without possibility to escape it.
We added a possibility to escape it through variable doNotPreselectDefaultCountryGeoId

[1] https://localhost:8443/ordermgr/control/findorders

Modified:
    ofbiz/ofbiz-framework/trunk/applications/order/groovyScripts/order/FindOrders.groovy
    ofbiz/ofbiz-framework/trunk/applications/order/template/order/FindOrders.ftl
    ofbiz/ofbiz-framework/trunk/themes/common-theme/template/includes/Countries.ftl

Modified: ofbiz/ofbiz-framework/trunk/applications/order/groovyScripts/order/FindOrders.groovy
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/order/groovyScripts/order/FindOrders.groovy?rev=1866012&r1=1866011&r2=1866012&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/order/groovyScripts/order/FindOrders.groovy (original)
+++ ofbiz/ofbiz-framework/trunk/applications/order/groovyScripts/order/FindOrders.groovy Tue Aug 27 21:30:58 2019
@@ -114,6 +114,9 @@ if (currentGoodIdentificationTypeId) {
     context.currentGoodIdentificationType = currentGoodIdentificationType
 }
 
+//for countries drop down, set the list on empty value by default
+context.doNotPreselectDefaultCountryGeoId = 'Y'
+
 // create the fromDate for calendar
 fromCal = Calendar.getInstance()
 fromCal.setTime(new java.util.Date())

Modified: ofbiz/ofbiz-framework/trunk/applications/order/template/order/FindOrders.ftl
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/order/template/order/FindOrders.ftl?rev=1866012&r1=1866011&r2=1866012&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/order/template/order/FindOrders.ftl (original)
+++ ofbiz/ofbiz-framework/trunk/applications/order/template/order/FindOrders.ftl Tue Aug 27 21:30:58 2019
@@ -414,10 +414,10 @@ function toggleOrderIdList() {
                     <#if requestParameters.countryGeoId?has_content>
                         <#assign countryGeoId = requestParameters.countryGeoId>
                         <#assign geo = delegator.findOne("Geo", Static["org.apache.ofbiz.base.util.UtilMisc"].toMap("geoId", countryGeoId), true)>
-                        <option value="${countryGeoId}">${geo.geoName!}</option>
-                        <option value="${countryGeoId}">---</option>
+                        <option value="${countryGeoId}" selected="selected">${geo.geoName!}</option>
+                        <option value="" >${uiLabelMap.CommonAny}</option>
                     <#else>
-                        <option value="">---</option>
+                        <option value="" selected="selected">${uiLabelMap.CommonAny}</option>
                     </#if>
                     ${screens.render("component://common/widget/CommonScreens.xml#countries")}
                   </select>

Modified: ofbiz/ofbiz-framework/trunk/themes/common-theme/template/includes/Countries.ftl
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/themes/common-theme/template/includes/Countries.ftl?rev=1866012&r1=1866011&r2=1866012&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/themes/common-theme/template/includes/Countries.ftl (original)
+++ ofbiz/ofbiz-framework/trunk/themes/common-theme/template/includes/Countries.ftl Tue Aug 27 21:30:58 2019
@@ -18,7 +18,7 @@ under the License.
 -->
 <#assign countries = Static["org.apache.ofbiz.common.CommonWorkers"].getCountryList(delegator)>
 <#list countries as country>
-  <#if defaultCountryGeoId??>
+  <#if defaultCountryGeoId?? && ! doNotPreselectDefaultCountryGeoId??>
     <option value='${country.geoId}' ${(country.geoId==defaultCountryGeoId)?string("selected=\"selected\"","")}>${country.get("geoName",locale)?default(country.geoId)}</option>
   <#else>
     <option value='${country.geoId}'>${country.get("geoName",locale)?default(country.geoId)}</option>