From aa83a942c4d3e84e48337e5127fd99c1c6cbf683 Mon Sep 17 00:00:00 2001 From: Deepak Srivastava Date: Thu, 29 Aug 2013 12:27:41 +0530 Subject: [PATCH] CRM-13193 --- CRM/Report/Form/Member/Detail.php | 44 ------------------------------ CRM/Report/Form/Member/Summary.php | 41 ++-------------------------- 2 files changed, 2 insertions(+), 83 deletions(-) diff --git a/CRM/Report/Form/Member/Detail.php b/CRM/Report/Form/Member/Detail.php index 7271933684..a6732d5976 100644 --- a/CRM/Report/Form/Member/Detail.php +++ b/CRM/Report/Form/Member/Detail.php @@ -391,50 +391,6 @@ class CRM_Report_Form_Member_Detail extends CRM_Report_Form { } } - function where() { - $clauses = array(); - foreach ($this->_columns as $tableName => $table) { - if (array_key_exists('filters', $table)) { - foreach ($table['filters'] as $fieldName => $field) { - $clause = NULL; - if (CRM_Utils_Array::value('operatorType', $field) & CRM_Utils_Type::T_DATE) { - $relative = CRM_Utils_Array::value("{$fieldName}_relative", $this->_params); - $from = CRM_Utils_Array::value("{$fieldName}_from", $this->_params); - $to = CRM_Utils_Array::value("{$fieldName}_to", $this->_params); - - $clause = $this->dateClause($field['name'], $relative, $from, $to, $field['type']); - } - else { - $op = CRM_Utils_Array::value("{$fieldName}_op", $this->_params); - if ($op) { - $clause = $this->whereClause($field, - $op, - CRM_Utils_Array::value("{$fieldName}_value", $this->_params), - CRM_Utils_Array::value("{$fieldName}_min", $this->_params), - CRM_Utils_Array::value("{$fieldName}_max", $this->_params) - ); - } - } - - if (!empty($clause)) { - $clauses[] = $clause; - } - } - } - } - - if (empty($clauses)) { - $this->_where = "WHERE ( 1 ) "; - } - else { - $this->_where = "WHERE " . implode(' AND ', $clauses); - } - - if ($this->_aclWhere) { - $this->_where .= " AND {$this->_aclWhere} "; - } - } - function groupBy() { $this->_groupBy = " GROUP BY {$this->_aliases['civicrm_contact']}.id, {$this->_aliases['civicrm_membership']}.membership_type_id"; } diff --git a/CRM/Report/Form/Member/Summary.php b/CRM/Report/Form/Member/Summary.php index db8e7ed36d..54078b812c 100644 --- a/CRM/Report/Form/Member/Summary.php +++ b/CRM/Report/Form/Member/Summary.php @@ -350,45 +350,8 @@ class CRM_Report_Form_Member_Summary extends CRM_Report_Form { // end of from function where() { - $clauses = array(); - foreach ($this->_columns as $tableName => $table) { - if (array_key_exists('filters', $table)) { - foreach ($table['filters'] as $fieldName => $field) { - $clause = NULL; - - if ($field['operatorType'] & CRM_Utils_Type::T_DATE) { - $relative = CRM_Utils_Array::value("{$fieldName}_relative", $this->_params); - $from = CRM_Utils_Array::value("{$fieldName}_from", $this->_params); - $to = CRM_Utils_Array::value("{$fieldName}_to", $this->_params); - - if ($relative || $from || $to) { - $clause = $this->dateClause($field['name'], $relative, $from, $to, $field['type']); - } - } - else { - $op = CRM_Utils_Array::value("{$fieldName}_op", $this->_params); - if ($op) { - $clause = $this->whereClause($field, - $op, - CRM_Utils_Array::value("{$fieldName}_value", $this->_params), - CRM_Utils_Array::value("{$fieldName}_min", $this->_params), - CRM_Utils_Array::value("{$fieldName}_max", $this->_params) - ); - } - } - if (!empty($clause)) { - $clauses[$fieldName] = $clause; - } - } - } - } - - if (!empty($clauses)) { - $this->_where = "WHERE {$this->_aliases['civicrm_membership']}.is_test = 0 AND " . implode(' AND ', $clauses); - } - else { - $this->_where = "WHERE {$this->_aliases['civicrm_membership']}.is_test = 0"; - } + $this->_whereClauses[] = "{$this->_aliases['civicrm_membership']}.is_test = 0"; + parent::where(); } function groupBy() { -- 2.25.1