You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by nm...@apache.org on 2019/08/27 21:32:41 UTC

svn commit: r1866013 - in /ofbiz/ofbiz-framework/branches/release18.12: applications/order/groovyScripts/order/FindOrders.groovy applications/order/template/order/FindOrders.ftl themes/common-theme/template/includes/Countries.ftl

Author: nmalin
Date: Tue Aug 27 21:32:41 2019
New Revision: 1866013

URL: http://svn.apache.org/viewvc?rev=1866013&view=rev
Log:
Improved: Backport 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/branches/release18.12/applications/order/groovyScripts/order/FindOrders.groovy
    ofbiz/ofbiz-framework/branches/release18.12/applications/order/template/order/FindOrders.ftl
    ofbiz/ofbiz-framework/branches/release18.12/themes/common-theme/template/includes/Countries.ftl

Modified: ofbiz/ofbiz-framework/branches/release18.12/applications/order/groovyScripts/order/FindOrders.groovy
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/branches/release18.12/applications/order/groovyScripts/order/FindOrders.groovy?rev=1866013&r1=1866012&r2=1866013&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/branches/release18.12/applications/order/groovyScripts/order/FindOrders.groovy (original)
+++ ofbiz/ofbiz-framework/branches/release18.12/applications/order/groovyScripts/order/FindOrders.groovy Tue Aug 27 21:32:41 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/branches/release18.12/applications/order/template/order/FindOrders.ftl
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/branches/release18.12/applications/order/template/order/FindOrders.ftl?rev=1866013&r1=1866012&r2=1866013&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/branches/release18.12/applications/order/template/order/FindOrders.ftl (original)
+++ ofbiz/ofbiz-framework/branches/release18.12/applications/order/template/order/FindOrders.ftl Tue Aug 27 21:32:41 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/branches/release18.12/themes/common-theme/template/includes/Countries.ftl
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/branches/release18.12/themes/common-theme/template/includes/Countries.ftl?rev=1866013&r1=1866012&r2=1866013&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/branches/release18.12/themes/common-theme/template/includes/Countries.ftl (original)
+++ ofbiz/ofbiz-framework/branches/release18.12/themes/common-theme/template/includes/Countries.ftl Tue Aug 27 21:32:41 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>