From f38e3c1957d49a6fb580315ecd0e6b786f7bbbd0 Mon Sep 17 00:00:00 2001 From: eileen Date: Sat, 11 Mar 2017 16:27:12 +1300 Subject: [PATCH] CRM-20242 - Add developer Tab to Activity Detail report --- CRM/Report/Form.php | 1 + CRM/Report/Form/Activity.php | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/CRM/Report/Form.php b/CRM/Report/Form.php index 8fbc9c0584..0e2c28a008 100644 --- a/CRM/Report/Form.php +++ b/CRM/Report/Form.php @@ -2290,6 +2290,7 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND if (array_key_exists('fields', $table)) { foreach ($table['fields'] as $fieldName => $field) { if ($tableName == 'civicrm_address') { + // deprecated, use $this->isTableSelected. $this->_addressField = TRUE; } if ($tableName == 'civicrm_email') { diff --git a/CRM/Report/Form/Activity.php b/CRM/Report/Form/Activity.php index 820b6f6d1e..d294920864 100644 --- a/CRM/Report/Form/Activity.php +++ b/CRM/Report/Form/Activity.php @@ -727,7 +727,7 @@ FROM civireport_activity_temp_target tar GROUP BY civicrm_activity_id $having {$this->_orderBy}"; $select = 'AS addtogroup_contact_id'; $query = str_ireplace('AS civicrm_contact_contact_target_id', $select, $query); - $dao = CRM_Core_DAO::executeQuery($query); + $dao = $this->executeReportQuery($query); $contactIDs = array(); // Add resulting contacts to group @@ -804,7 +804,7 @@ GROUP BY civicrm_activity_id $having {$this->_orderBy}"; $insertCols = implode(',', $this->_selectAliases); $tempQuery = "CREATE TEMPORARY TABLE civireport_activity_temp_target {$this->_databaseAttributes} AS {$this->_select} {$this->_from} {$this->_where} "; - CRM_Core_DAO::executeQuery($tempQuery); + $this->executeReportQuery($tempQuery); // 2. add new columns to hold assignee and source results // fixme: add when required @@ -819,7 +819,7 @@ GROUP BY civicrm_activity_id $having {$this->_orderBy}"; ADD COLUMN civicrm_phone_contact_source_phone VARCHAR(128), ADD COLUMN civicrm_email_contact_assignee_email VARCHAR(128), ADD COLUMN civicrm_email_contact_source_email VARCHAR(128)"; - CRM_Core_DAO::executeQuery($tempQuery); + $this->executeReportQuery($tempQuery); // 3. fill temp table with assignee results $this->buildACLClause(array('civicrm_contact_assignee')); @@ -831,7 +831,7 @@ GROUP BY civicrm_activity_id $having {$this->_orderBy}"; $tempQuery = "INSERT INTO civireport_activity_temp_target ({$insertCols}) {$this->_select} {$this->_from} {$this->_where}"; - CRM_Core_DAO::executeQuery($tempQuery); + $this->executeReportQuery($tempQuery); // 4. fill temp table with source results $this->buildACLClause(array('civicrm_contact_source')); @@ -843,7 +843,7 @@ GROUP BY civicrm_activity_id $having {$this->_orderBy}"; $tempQuery = "INSERT INTO civireport_activity_temp_target ({$insertCols}) {$this->_select} {$this->_from} {$this->_where}"; - CRM_Core_DAO::executeQuery($tempQuery); + $this->executeReportQuery($tempQuery); // 5. show final result set from temp table $rows = array(); @@ -1079,7 +1079,7 @@ FROM civireport_activity_temp_target tar // initialize array of total counts $totals = array(); - $dao = CRM_Core_DAO::executeQuery($query); + $dao = $this->executeReportQuery($query); while ($dao->fetch()) { // let $this->_alterDisplay translate any integer ids to human-readable values. $rows[0] = $dao->toArray(); -- 2.25.1