From 1a7029b83bf9f1075f7e3f705540f19d70552d5b Mon Sep 17 00:00:00 2001 From: Monish Deb Date: Wed, 30 Oct 2019 17:52:40 +0530 Subject: [PATCH] Add CRM_Contact_BAO_Query::getQillValue fn --- CRM/Case/BAO/Query.php | 23 ++--------------------- CRM/Contact/BAO/Query.php | 18 +++++++++++++++++- 2 files changed, 19 insertions(+), 22 deletions(-) diff --git a/CRM/Case/BAO/Query.php b/CRM/Case/BAO/Query.php index 55e32bd99e..f144663067 100644 --- a/CRM/Case/BAO/Query.php +++ b/CRM/Case/BAO/Query.php @@ -291,7 +291,7 @@ class CRM_Case_BAO_Query extends CRM_Core_BAO_Query { } $query->_where[$grouping][] = CRM_Contact_BAO_Query::buildClause("civicrm_case.{$name}", $op, $value, "Integer"); - $query->_qill[$grouping][] = self::getQillValue('CRM_Case_DAO_Case', $name, $value, $op, $label); + $query->_qill[$grouping][] = CRM_Contact_BAO_Query::getQillValue('CRM_Case_DAO_Case', $name, $value, $op, $label); $query->_tables['civicrm_case'] = $query->_whereTables['civicrm_case'] = 1; return; @@ -332,7 +332,7 @@ class CRM_Case_BAO_Query extends CRM_Core_BAO_Query { case 'case_subject': $query->_where[$grouping][] = CRM_Contact_BAO_Query::buildClause("civicrm_case.subject", $op, $value, 'String'); - $query->_qill[$grouping][] = self::getQillValue('CRM_Case_DAO_Case', $name, $value, $op, 'Case Subject'); + $query->_qill[$grouping][] = CRM_Contact_BAO_Query::getQillValue('CRM_Case_DAO_Case', $name, $value, $op, 'Case Subject'); $query->_tables['civicrm_case'] = $query->_whereTables['civicrm_case'] = 1; $query->_tables['civicrm_case_contact'] = $query->_whereTables['civicrm_case_contact'] = 1; return; @@ -588,25 +588,6 @@ case_relation_type.id = case_relationship.relationship_type_id )"; return $from; } - /** - * Get the qill (search description for field) for the specified field. - * - * @todo this is private because it is the first step towards generalising rather than - * the final product IMHO. - * - * @param string $daoName - * @param string $name - * @param string $value - * @param string|array $op - * @param string $label - * - * @return string - */ - private static function getQillValue($daoName, string $name, $value, $op, string $label) { - list($op, $value) = CRM_Contact_BAO_Query::buildQillForFieldValue($daoName, $name, $value, $op); - return ts('%1 %2 %3', [1 => $label, 2 => $op, 3 => $value]); - } - /** * Getter for the qill object. * diff --git a/CRM/Contact/BAO/Query.php b/CRM/Contact/BAO/Query.php index bb5665b259..d67f250dc0 100644 --- a/CRM/Contact/BAO/Query.php +++ b/CRM/Contact/BAO/Query.php @@ -6247,6 +6247,22 @@ AND displayRelType.is_active = 1 return [CRM_Utils_Array::value($op, $qillOperators, $op), $fieldValue]; } + /** + * Get the qill (search description for field) for the specified field. + * + * @param string $daoName + * @param string $name + * @param string $value + * @param string|array $op + * @param string $label + * + * @return string + */ + public static function getQillValue($daoName, string $name, $value, $op, string $label) { + list($op, $value) = self::buildQillForFieldValue($daoName, $name, $value, $op); + return ts('%1 %2 %3', [1 => $label, 2 => $op, 3 => $value]); + } + /** * Alter value to reflect wildcard settings. * @@ -6651,7 +6667,7 @@ AND displayRelType.is_active = 1 FROM ( SELECT civicrm_contribution.total_amount, civicrm_contribution.currency $from - $where AND civicrm_contribution.cancel_date IS NOT NULL + $where AND civicrm_contribution.cancel_date IS NOT NULL GROUP BY civicrm_contribution.id ) as conts GROUP BY currency"; -- 2.25.1