Skip to content

Commit

Permalink
Improved: Find order screen can't make a search without ship to country
Browse files Browse the repository at this point in the history
(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

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1866012 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
nmalin committed Aug 27, 2019
1 parent 18e29ba commit cbc0a76
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions applications/order/groovyScripts/order/FindOrders.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
6 changes: 3 additions & 3 deletions applications/order/template/order/FindOrders.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion themes/common-theme/template/includes/Countries.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit cbc0a76

Please sign in to comment.