}
}
+ // check if geocode should be skipped (can be forced with an optional parameter through the api)
+ $skip_geocode = (isset($params['skip_geocode']) && $params['skip_geocode']) ? TRUE : FALSE;
+
// add latitude and longitude and format address if needed
- if (!empty($config->geocodeMethod) && ($config->geocodeMethod != 'CRM_Utils_Geocode_OpenStreetMaps') && empty($params['manual_geo_code'])) {
+ if (!$skip_geocode && !empty($config->geocodeMethod) && ($config->geocodeMethod != 'CRM_Utils_Geocode_OpenStreetMaps') && empty($params['manual_geo_code'])) {
$class = $config->geocodeMethod;
$class::format($params);
}
'description' => 'Optional param to indicate you want the street_address field parsed into individual params',
'type' => CRM_Utils_Type::T_BOOLEAN,
);
+ $params['skip_geocode'] = array(
+ 'title' => 'Skip geocode',
+ 'description' => 'Optional param to indicate you want to skip geocoding (useful when importing a lot of addresses
+ at once, the job \'Geocode and Parse Addresses\' can execute this task after the import)',
+ 'type' => CRM_Utils_Type::T_BOOLEAN,
+ );
$params['world_region'] = array(
'title' => ts('World Region'),
'name' => 'world_region',