projects
/
civicrm-core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge remote-tracking branch 'upstream/4.4' into 4.4-4.5-2014-09-29-14-51-22
[civicrm-core.git]
/
CRM
/
Contact
/
BAO
/
ProximityQuery.php
diff --git
a/CRM/Contact/BAO/ProximityQuery.php
b/CRM/Contact/BAO/ProximityQuery.php
index 6b58e8fc9fb0c57ef9d0665eaae381510d8f2ace..b5e065df0fa7459126cae5589dd0a9f00ab8562f 100644
(file)
--- a/
CRM/Contact/BAO/ProximityQuery.php
+++ b/
CRM/Contact/BAO/ProximityQuery.php
@@
-185,6
+185,14
@@
class CRM_Contact_BAO_ProximityQuery {
);
}
);
}
+ /**
+ * @param $latitude
+ * @param $longitude
+ * @param $distance
+ * @param string $tablePrefix
+ *
+ * @return string
+ */
static function where($latitude, $longitude, $distance, $tablePrefix = 'civicrm_address') {
self::initialize();
static function where($latitude, $longitude, $distance, $tablePrefix = 'civicrm_address') {
self::initialize();
@@
-233,6
+241,12
@@
ACOS(
return $where;
}
return $where;
}
+ /**
+ * @param $query
+ * @param $values
+ *
+ * @throws Exception
+ */
static function process(&$query, &$values) {
list($name, $op, $distance, $grouping, $wildcard) = $values;
static function process(&$query, &$values) {
list($name, $op, $distance, $grouping, $wildcard) = $values;
@@
-275,7
+289,7
@@
ACOS(
if (!isset($proximityAddress['country_id'])) {
// get it from state if state is present
if (isset($proximityAddress['state_province_id'])) {
if (!isset($proximityAddress['country_id'])) {
// get it from state if state is present
if (isset($proximityAddress['state_province_id'])) {
- $proximityAddress['country_id'] = CRM_Core_PseudoConstant::country
ForState
($proximityAddress['state_province_id']);
+ $proximityAddress['country_id'] = CRM_Core_PseudoConstant::country
IDForStateID
($proximityAddress['state_province_id']);
}
elseif (isset($config->defaultContactCountry)) {
$proximityAddress['country_id'] = $config->defaultContactCountry;
}
elseif (isset($config->defaultContactCountry)) {
$proximityAddress['country_id'] = $config->defaultContactCountry;
@@
-337,6
+351,9
@@
ACOS(
return;
}
return;
}
+ /**
+ * @param $input
+ */
static function fixInputParams(&$input) {
foreach ($input as $param) {
if (CRM_Utils_Array::value('0', $param) == 'prox_distance') {
static function fixInputParams(&$input) {
foreach ($input as $param) {
if (CRM_Utils_Array::value('0', $param) == 'prox_distance') {