From 7851a058b26e9f18adeae8ea4849457f81669570 Mon Sep 17 00:00:00 2001 From: Kurund Jalmi Date: Mon, 17 Aug 2015 13:17:22 +0530 Subject: [PATCH] CRM-16719: stats fixes --- CRM/Report/Form/ActivitySummary.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CRM/Report/Form/ActivitySummary.php b/CRM/Report/Form/ActivitySummary.php index b851dbd7d9..c73202e479 100644 --- a/CRM/Report/Form/ActivitySummary.php +++ b/CRM/Report/Form/ActivitySummary.php @@ -458,10 +458,14 @@ class CRM_Report_Form_ActivitySummary extends CRM_Report_Form { $statistics = parent::statistics($rows); $totalType = $totalActivity = $totalDuration = 0; + $query = "SELECT SUM(activity_civireport.duration) + FROM civicrm_activity activity_civireport + {$this->_where} {$this->_groupBy}"; + $actSQL = "SELECT COUNT(DISTINCT {$this->_aliases['civicrm_activity']}.activity_type_id ) as civicrm_activity_activity_type_id_count, COUNT(DISTINCT {$this->_aliases['civicrm_activity']}.id ) as civicrm_activity_activity_id_count, - SUM({$this->_aliases['civicrm_activity']}.duration ) as civicrm_activity_activity_duration + ($query) as civicrm_activity_activity_duration {$this->_from} {$this->_where} {$this->_groupBy}"; $actDAO = CRM_Core_DAO::executeQuery($actSQL); -- 2.25.1