From f425e1426d915af45beee43a95e545aa5228c7c3 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Sun, 16 Aug 2015 22:03:40 -0700 Subject: [PATCH] CRM-16373 - Config - Remove `mapGeoCoding` option It looks like this is a boolean that enables/disables certain geocoding features. However, the variable is not actually editable, so it is effectively fixed at "true". --- CRM/Contact/Selector.php | 4 ++-- CRM/Core/Config/Variables.php | 8 -------- CRM/Event/BAO/Event.php | 2 +- templates/CRM/Event/Form/Registration/EventInfoBlock.tpl | 2 +- templates/CRM/Event/Page/EventInfo.tpl | 2 +- .../templates/CRM/Event/Page/4/EventInfo.tpl | 2 +- .../templates/CRM/Event/Page/8/EventInfo.tpl | 2 +- 7 files changed, 7 insertions(+), 15 deletions(-) diff --git a/CRM/Contact/Selector.php b/CRM/Contact/Selector.php index 7bf0c9cdb7..7bd1562f29 100644 --- a/CRM/Contact/Selector.php +++ b/CRM/Contact/Selector.php @@ -787,7 +787,7 @@ class CRM_Contact_Selector extends CRM_Core_Selector_Base implements CRM_Core_Se ); } elseif ((is_numeric(CRM_Utils_Array::value('geo_code_1', $row))) || - ($config->mapGeoCoding && !empty($row['city']) && + (!empty($row['city']) && CRM_Utils_Array::value('state_province', $row) ) ) { @@ -956,7 +956,7 @@ class CRM_Contact_Selector extends CRM_Core_Selector_Base implements CRM_Core_Se ); } elseif ((is_numeric(CRM_Utils_Array::value('geo_code_1', $row))) || - ($config->mapGeoCoding && !empty($row['city']) && + (!empty($row['city']) && CRM_Utils_Array::value('state_province', $row) ) ) { diff --git a/CRM/Core/Config/Variables.php b/CRM/Core/Config/Variables.php index 0c5fd6da1b..e43a36314d 100644 --- a/CRM/Core/Config/Variables.php +++ b/CRM/Core/Config/Variables.php @@ -298,14 +298,6 @@ class CRM_Core_Config_Variables extends CRM_Core_Config_Defaults { */ public $geocodeMethod = ''; - /** - * - * - * @var boolean - */ - public $mapGeoCoding = 1; - - /** * Whether database-level logging should be performed * @var boolean diff --git a/CRM/Event/BAO/Event.php b/CRM/Event/BAO/Event.php index a9a530aebd..1af2f6c685 100644 --- a/CRM/Event/BAO/Event.php +++ b/CRM/Event/BAO/Event.php @@ -466,7 +466,7 @@ $event_summary_limit $params = array('entity_id' => $dao->id, 'entity_table' => 'civicrm_event'); $values['location'] = CRM_Core_BAO_Location::getValues($params, TRUE); if (is_numeric(CRM_Utils_Array::value('geo_code_1', $values['location']['address'][1])) || - ($config->mapGeoCoding && + ( !empty($values['location']['address'][1]['city']) && !empty($values['location']['address'][1]['state_province_id']) ) diff --git a/templates/CRM/Event/Form/Registration/EventInfoBlock.tpl b/templates/CRM/Event/Form/Registration/EventInfoBlock.tpl index 2a5eee1f07..235126147f 100644 --- a/templates/CRM/Event/Form/Registration/EventInfoBlock.tpl +++ b/templates/CRM/Event/Form/Registration/EventInfoBlock.tpl @@ -57,7 +57,7 @@ {if ( $event.is_map && $config->mapProvider && ( ( !empty($location.address.1.geo_code_1) && is_numeric($location.address.1.geo_code_1) ) || - ( $config->mapGeoCoding && !empty($location.address.1.city) AND !empty($location.address.1.state_province) ) ) ) } + ( !empty($location.address.1.city) AND !empty($location.address.1.state_province) ) ) ) }
{ts}Map this Location{/ts} {/if} diff --git a/templates/CRM/Event/Page/EventInfo.tpl b/templates/CRM/Event/Page/EventInfo.tpl index 7aae194e2f..ff1ca59e99 100644 --- a/templates/CRM/Event/Page/EventInfo.tpl +++ b/templates/CRM/Event/Page/EventInfo.tpl @@ -148,7 +148,7 @@ {if ( $event.is_map && $config->mapProvider && ( is_numeric($location.address.1.geo_code_1) || - ( $config->mapGeoCoding && $location.address.1.city AND $location.address.1.state_province ) ) ) } + ( $location.address.1.city AND $location.address.1.state_province ) ) ) }
{assign var=showDirectly value="1"} diff --git a/tools/drupal/modules/multicurrency/templates/CRM/Event/Page/4/EventInfo.tpl b/tools/drupal/modules/multicurrency/templates/CRM/Event/Page/4/EventInfo.tpl index 617d31abeb..d215b86277 100644 --- a/tools/drupal/modules/multicurrency/templates/CRM/Event/Page/4/EventInfo.tpl +++ b/tools/drupal/modules/multicurrency/templates/CRM/Event/Page/4/EventInfo.tpl @@ -40,7 +40,7 @@ {$location.1.name}
{/if} {$location.1.address.display|nl2br} - {if ( $event.is_map && $config->mapAPIKey && ( is_numeric($location.1.address.geo_code_1) || ( $config->mapGeoCoding && $location.1.address.city AND $location.1.address.state_province ) ) ) } + {if ( $event.is_map && $config->mapAPIKey && ( is_numeric($location.1.address.geo_code_1) || ( $location.1.address.city AND $location.1.address.state_province ) ) ) }
{ts}Map this Location{/ts} {/if} diff --git a/tools/drupal/modules/multicurrency/templates/CRM/Event/Page/8/EventInfo.tpl b/tools/drupal/modules/multicurrency/templates/CRM/Event/Page/8/EventInfo.tpl index 617d31abeb..d215b86277 100644 --- a/tools/drupal/modules/multicurrency/templates/CRM/Event/Page/8/EventInfo.tpl +++ b/tools/drupal/modules/multicurrency/templates/CRM/Event/Page/8/EventInfo.tpl @@ -40,7 +40,7 @@ {$location.1.name}
{/if} {$location.1.address.display|nl2br} - {if ( $event.is_map && $config->mapAPIKey && ( is_numeric($location.1.address.geo_code_1) || ( $config->mapGeoCoding && $location.1.address.city AND $location.1.address.state_province ) ) ) } + {if ( $event.is_map && $config->mapAPIKey && ( is_numeric($location.1.address.geo_code_1) || ( $location.1.address.city AND $location.1.address.state_province ) ) ) }
{ts}Map this Location{/ts} {/if} -- 2.25.1