From: Brian Shaughnessy Date: Wed, 21 Jan 2015 01:20:09 +0000 (-0500) Subject: CRM-15849 add where clause for greetings X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=02adf2f9aafcc55ba7bf73e04df97d5192c37e18;p=civicrm-core.git CRM-15849 add where clause for greetings --- diff --git a/CRM/Contact/BAO/Query.php b/CRM/Contact/BAO/Query.php index 63ef0c3a7e..4081202cf5 100644 --- a/CRM/Contact/BAO/Query.php +++ b/CRM/Contact/BAO/Query.php @@ -1683,6 +1683,12 @@ class CRM_Contact_BAO_Query { $this->sortName($values); return; + case 'addressee': + case 'postal_greeting': + case 'email_greeting': + $this->greetings($values); + return; + case 'email': $this->email($values); return; @@ -3282,6 +3288,21 @@ WHERE id IN ( $groupIDs ) } } + /* + * Where/qill clause for greeting fields + * + * @params $values + * + * @return void + */ + function greetings(&$values) { + list($name, $op, $value, $grouping, $wildcard) = $values; + $name .= '_display'; + + $this->_qill[$grouping][] = "Greeting $op $value"; + $this->_where[$grouping][] = self::buildClause("contact_a.{$name}", 'LIKE', "$value", 'String'); + } + /** * Where / qill clause for email *