Skip to content

Commit

Permalink
#4225 Location: option to normalize geographic names
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Trofimov committed Feb 7, 2023
1 parent 454867f commit 9fef183
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions inc/classes/BxDolLocationFieldNominatim.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions template/location_field_plain.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '';
Expand All @@ -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))
Expand Down

0 comments on commit 9fef183

Please sign in to comment.