From 11a5aa5dc21e59e1480e89b23728024a04f6795e Mon Sep 17 00:00:00 2001 From: Dave Greenberg Date: Wed, 27 Aug 2014 15:00:19 -0700 Subject: [PATCH] CRM-15121 - whitespace fix. ---------------------------------------- * CRM-15121: https://issues.civicrm.org/jira/browse/CRM-15121 --- CRM/Contact/BAO/Query.php | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/CRM/Contact/BAO/Query.php b/CRM/Contact/BAO/Query.php index 0f9e0fa7f0..84ed1af12c 100644 --- a/CRM/Contact/BAO/Query.php +++ b/CRM/Contact/BAO/Query.php @@ -1819,7 +1819,7 @@ class CRM_Contact_BAO_Query { //why on earth do they put ' in the middle & not on the outside? We have to assume it's //to support 'something' so lets add them conditionally to support the api (which is a tested flow // so if you are looking to alter this check api test results - if(strpos(trim($idList), "'") > 0) { + if (strpos(trim($idList), "'") > 0) { $idList = "'" . $idList . "'"; } @@ -2136,7 +2136,7 @@ class CRM_Contact_BAO_Query { // per CRM-14743 we are adding modified_date & created_date operator support $operations = array_keys($value); foreach ($operations as $operator) { - if(!in_array($operator, CRM_Core_DAO::acceptedSQLOperators())) { + if (!in_array($operator, CRM_Core_DAO::acceptedSQLOperators())) { // we don't know when this might happen CRM_Core_Error::fatal(); } @@ -2531,7 +2531,7 @@ class CRM_Contact_BAO_Query { case 'civicrm_relationship': if (self::$_relType == 'reciprocal') { - if(self::$_relationshipTempTable) { + if (self::$_relationshipTempTable) { // we have a temptable to join on $tbl = self::$_relationshipTempTable; $from .= " INNER JOIN {$tbl} civicrm_relationship ON civicrm_relationship.contact_id = contact_a.id"; @@ -2579,7 +2579,7 @@ class CRM_Contact_BAO_Query { elseif (strpos($name, '-email') != 0) { $locationTypeName = 'email'; } - if($locationTypeName) { + if ($locationTypeName) { //we have a join on an location table - possibly in conjunction with search builder - CRM-14263 $parts = explode('-', $name); $locationID = array_search($parts[0], CRM_Core_BAO_Address::buildOptions('location_type_id', 'get', array('name' => $parts[0]))); @@ -4024,7 +4024,7 @@ WHERE id IN ( $groupIDs ) */ function relationship(&$values) { list($name, $op, $value, $grouping, $wildcard) = $values; - if($this->_relationshipValuesAdded){ + if ($this->_relationshipValuesAdded){ return; } // also get values array for relation_target_name @@ -4052,7 +4052,7 @@ WHERE id IN ( $groupIDs ) } $rTypeValues = array(); - if( !empty($relationType) ) { + if (!empty($relationType) ) { $rel = explode('_', $relationType[2]); self::$_relType = $rel[1]; $params = array('id' => $rel[0]); @@ -4065,12 +4065,12 @@ WHERE id IN ( $groupIDs ) } // if we are creating a temp table we build our own where for the relationship table $relationshipTempTable = NULL; - if(self::$_relType == 'reciprocal' && empty($targetGroup)) { + if (self::$_relType == 'reciprocal' && empty($targetGroup)) { $where = array(); self::$_relationshipTempTable = $relationshipTempTable = CRM_Core_DAO::createTempTableName( 'civicrm_rel'); - if($nameClause) { + if ($nameClause) { $where[$grouping][] = " sort_name $nameClause "; } } @@ -4090,7 +4090,7 @@ WHERE id IN ( $groupIDs ) $allRelationshipType = array_merge($allRelationshipType, $relTypeHou); if ($nameClause || !$targetGroup) { - if( !empty($relationType) ) { + if (!empty($relationType) ) { $this->_qill[$grouping][] = $allRelationshipType[$relationType[2]] ." $name"; } else { $this->_qill[$grouping][] = $name; @@ -4167,7 +4167,7 @@ civicrm_relationship.is_permission_a_b = 0 } $this->addRelationshipDateClauses($grouping, $where); - if( !empty($relationType) && !empty($rType) && isset($rType->id)){ + if (!empty($relationType) && !empty($rType) && isset($rType->id)){ $where[$grouping][] = 'civicrm_relationship.relationship_type_id = ' . $rType->id; } $this->_tables['civicrm_relationship'] = $this->_whereTables['civicrm_relationship'] = 1; @@ -4215,12 +4215,12 @@ civicrm_relationship.is_permission_a_b = 0 foreach ($dateTypes as $dateField){ $dateValueLow = $this->getWhereValues('relation_'. $dateField .'_low', $grouping); $dateValueHigh= $this->getWhereValues('relation_'. $dateField .'_high', $grouping); - if(!empty($dateValueLow)){ + if (!empty($dateValueLow)){ $date = date('Ymd', strtotime($dateValueLow[2])); $where[$grouping][] = "civicrm_relationship.$dateField >= $date"; $this->_qill[$grouping][] = ($dateField == 'end_date' ? ts('Relationship Ended on or After') : ts('Relationship Recorded Start Date On or Before')) . " " . CRM_Utils_Date::customFormat($date); } - if(!empty($dateValueHigh)){ + if (!empty($dateValueHigh)){ $date = date('Ymd', strtotime($dateValueHigh[2])); $where[$grouping][] = "civicrm_relationship.$dateField <= $date"; $this->_qill[$grouping][] = ( $dateField == 'end_date' ? ts('Relationship Ended on or Before') : ts('Relationship Recorded Start Date On or After')) . " " . CRM_Utils_Date::customFormat($date); @@ -4398,7 +4398,7 @@ civicrm_relationship.is_permission_a_b = 0 list($select, $from, $where, $having) = $query->query($count); $options = $query->_options; - if(!empty($query->_permissionWhereClause)){ + if (!empty($query->_permissionWhereClause)){ if (empty($where)) { $where = "WHERE $query->_permissionWhereClause"; } @@ -4740,7 +4740,7 @@ SELECT COUNT( conts.total_amount ) as total_count, SUM( conts.total_amount ) as total_amount, AVG( conts.total_amount ) as total_avg, conts.currency as currency"; - if($this->_permissionWhereClause) { + if ($this->_permissionWhereClause) { $where .= " AND " . $this->_permissionWhereClause; } if ($context == 'search') { -- 2.25.1