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
$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
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'));
$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'));
$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();
// 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();