From 9fef183bf51c57ccc3f89517531306e554b433ff Mon Sep 17 00:00:00 2001 From: Alex Trofimov Date: Tue, 7 Feb 2023 23:17:28 +1100 Subject: [PATCH] #4225 Location: option to normalize geographic names --- inc/classes/BxDolLocationFieldNominatim.php | 4 ++-- template/location_field_plain.html | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/inc/classes/BxDolLocationFieldNominatim.php b/inc/classes/BxDolLocationFieldNominatim.php index 87e3a35631..1f76d109c0 100644 --- a/inc/classes/BxDolLocationFieldNominatim.php +++ b/inc/classes/BxDolLocationFieldNominatim.php @@ -89,8 +89,7 @@ public function genInputLocation (&$aInput, $oForm) $aVars['id_status'] = $oForm->getInputId($aInput) . '_status'; $aVars['location_string'] = $sLocationString; $aVars['nominatim_server'] = $this->getNominatimServer(); - $aVars['nominatim_email'] = $this->getNominatimEmail(); - $aVars['normalize_names'] = getParam('sys_location_normalize_names') ? 1 : 0; + $aVars['nominatim_email'] = $this->getNominatimEmail(); $sRet = $oForm->getTemplate()->parseHtmlByName('location_field_plain_auto.html', $aVars); } @@ -134,6 +133,7 @@ public function genInputLocation (&$aInput, $oForm) 'nominatim_server' => $this->getNominatimServer(), 'nominatim_email' => $this->getNominatimEmail(), 'inputs' => $sInputs, + 'normalize_names' => getParam('sys_location_normalize_names') ? 1 : 0, )); } return $sRet; diff --git a/template/location_field_plain.html b/template/location_field_plain.html index e11280c7ef..5b35ae21b4 100644 --- a/template/location_field_plain.html +++ b/template/location_field_plain.html @@ -70,7 +70,7 @@ if ('undefined' !== typeof(oResult[0].address)) { if ('undefined' !== typeof(oResult[0].address.state) && 0 == $('input[name="__name___state"]').val().length) $('input[name="__name___state"]').val(oResult[0].address.state); - else if (__normalize_names __ && $('input[name="__name___state"]').val() != oResult[0].address.state) + else if (__normalize_names__ && $('input[name="__name___state"]').val() != oResult[0].address.state) $('input[name="__name___state"]').val(oResult[0].address.state); var sCity = ''; @@ -83,7 +83,7 @@ if (sCity && 0 == $('input[name="__name___city"]').val().length) $('input[name="__name___city"]').val(sCity); - else if (__normalize_names __ && sCity && $('input[name="__name___city"]').val() != sCity) + else if (__normalize_names__ && sCity && $('input[name="__name___city"]').val() != sCity) $('input[name="__name___city"]').val(sCity); } if ('undefined' !== typeof(oResult[0].licence))