From 5b0a27535f2f9c27dc18832e3a801469773a3092 Mon Sep 17 00:00:00 2001 From: yashodha Date: Tue, 14 Mar 2017 11:14:45 +0530 Subject: [PATCH] CRM-20255 - Add developer tabs to more reports --- CRM/Report/Form/Contribute/Repeat.php | 18 +++++++++--------- CRM/Report/Form/Event/Income.php | 10 +++++----- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/CRM/Report/Form/Contribute/Repeat.php b/CRM/Report/Form/Contribute/Repeat.php index f4b2483274..4d4472237b 100644 --- a/CRM/Report/Form/Contribute/Repeat.php +++ b/CRM/Report/Form/Contribute/Repeat.php @@ -683,7 +683,7 @@ LEFT JOIN $this->tempTableRepeat2 {$this->_aliases['civicrm_contribution']}2 public function statistics(&$rows) { $statistics = parent::statistics($rows); $sql = "{$this->_select} {$this->_from} {$this->_where}"; - $dao = CRM_Core_DAO::executeQuery($sql); + $dao = $this->executeReportQuery($sql); //store contributions in array 'contact_sums' for comparison $contact_sums = array(); while ($dao->fetch()) { @@ -765,7 +765,7 @@ SELECT COUNT({$this->_aliases['civicrm_contribution']}1.total_amount_count ) $sql = "{$select} {$this->_from} {$this->_where} GROUP BY currency "; - $dao = CRM_Core_DAO::executeQuery($sql); + $dao = $this->executeReportQuery($sql); $amount = $average = $amount2 = $average2 = array(); $count = $count2 = 0; @@ -834,7 +834,7 @@ GROUP BY currency $count = 0; $sql = "{$this->_select} {$this->_from} {$this->_where} {$this->_groupBy} {$this->_limit}"; - $dao = CRM_Core_DAO::executeQuery($sql); + $dao = $this->executeReportQuery($sql); $rows = array(); while ($dao->fetch()) { foreach ($this->_columnHeaders as $key => $value) { @@ -1033,10 +1033,10 @@ CREATE TEMPORARY TABLE $this->tempTableRepeat1 ( total_amount_sum int, total_amount_count int ) ENGINE=HEAP {$this->_databaseAttributes}"; - CRM_Core_DAO::executeQuery($sql); - CRM_Core_DAO::executeQuery("INSERT INTO $this->tempTableRepeat1 {$subContributionQuery1}"); + $this->executeReportQuery($sql); + $this->executeReportQuery("INSERT INTO $this->tempTableRepeat1 {$subContributionQuery1}"); - CRM_Core_DAO::executeQuery(" + $this->executeReportQuery(" ALTER TABLE $this->tempTableRepeat1 ADD INDEX ({$this->contributionJoinTableColumn}) "); @@ -1049,11 +1049,11 @@ total_amount_sum int, total_amount_count int, currency varchar(3) ) ENGINE=HEAP {$this->_databaseAttributes}"; - CRM_Core_DAO::executeQuery($sql); + $this->executeReportQuery($sql); $sql = "INSERT INTO $this->tempTableRepeat2 {$subContributionQuery2}"; - CRM_Core_DAO::executeQuery($sql); + $this->executeReportQuery($sql); - CRM_Core_DAO::executeQuery(" + $this->executeReportQuery(" ALTER TABLE $this->tempTableRepeat2 ADD INDEX ({$this->contributionJoinTableColumn}) "); diff --git a/CRM/Report/Form/Event/Income.php b/CRM/Report/Form/Event/Income.php index 334faeb08e..f2f6f653b9 100644 --- a/CRM/Report/Form/Event/Income.php +++ b/CRM/Report/Form/Event/Income.php @@ -124,7 +124,7 @@ class CRM_Report_Form_Event_Income extends CRM_Report_Form_Event { WHERE civicrm_event.id IN( {$eventID}) {$groupBy}"; - $eventDAO = CRM_Core_DAO::executeQuery($sql); + $eventDAO = $this->executeReportQuery($sql); $currency = array(); while ($eventDAO->fetch()) { $eventSummary[$eventDAO->event_id]['Title'] = $eventDAO->event_title; @@ -150,7 +150,7 @@ class CRM_Report_Form_Event_Income extends CRM_Report_Form_Event { GROUP BY civicrm_participant.event_id "; - $counteDAO = CRM_Core_DAO::executeQuery($pariticipantCount); + $counteDAO = $this->executeReportQuery($pariticipantCount); while ($counteDAO->fetch()) { $count[$counteDAO->event_id] = $counteDAO->count; } @@ -170,7 +170,7 @@ class CRM_Report_Form_Event_Income extends CRM_Report_Form_Event { GROUP BY civicrm_participant.role_id, civicrm_participant.event_id, civicrm_participant.fee_currency "; - $roleDAO = CRM_Core_DAO::executeQuery($role); + $roleDAO = $this->executeReportQuery($role); while ($roleDAO->fetch()) { // fix for multiple role, CRM-6507 @@ -214,7 +214,7 @@ class CRM_Report_Form_Event_Income extends CRM_Report_Form_Event { GROUP BY civicrm_participant.status_id, civicrm_participant.event_id "; - $statusDAO = CRM_Core_DAO::executeQuery($status); + $statusDAO = $this->executeReportQuery($status); while ($statusDAO->fetch()) { $statusRows[$statusDAO->event_id][$participantStatus[$statusDAO->STATUSID]]['total'] = $statusDAO->participant; @@ -244,7 +244,7 @@ class CRM_Report_Form_Event_Income extends CRM_Report_Form_Event { GROUP BY c.payment_instrument_id, civicrm_participant.event_id "; - $instrumentDAO = CRM_Core_DAO::executeQuery($paymentInstrument); + $instrumentDAO = $this->executeReportQuery($paymentInstrument); while ($instrumentDAO->fetch()) { //allow only if instrument is present in contribution table -- 2.25.1