if (strstr($clause, 'civicrm_contact_target.') ||
strstr($clause, 'civicrm_contact_source.') ||
strstr($clause, 'civicrm_email_target.') ||
- strstr($clause, 'civicrm_email_source.')
+ strstr($clause, 'civicrm_email_source.') ||
+ strstr($clause, 'address_civireport.')
) {
$removeKeys[] = $key;
unset($this->_selectClauses[$key]);
if (strstr($clause, 'civicrm_contact_target.') ||
strstr($clause, 'civicrm_contact_assignee.') ||
strstr($clause, 'civicrm_email_target.') ||
- strstr($clause, 'civicrm_email_assignee.')
+ strstr($clause, 'civicrm_email_assignee.') ||
+ strstr($clause, 'address_civireport.')
) {
$removeKeys[] = $key;
unset($this->_selectClauses[$key]);
function postProcess() {
$this->buildACLClause(array('civicrm_contact_source', 'civicrm_contact_target', 'civicrm_contact_assignee'));
-
$this->beginPostProcess();
// 1. fill temp table with target results
CRM_Core_DAO::executeQuery($tempQuery);
// 3. fill temp table with assignee results
- $this->select('assignee');
- $this->from('assignee');
- $this->where();
- $insertCols = implode(',', $this->_selectAliases);
- // fixme: do this when assignee name/email is selected
- $tempQuery = "INSERT INTO civireport_activity_temp_target ({$insertCols})
+ if (CRM_Utils_Array::value("contact_assignee", $this->_params['fields']) ||
+ CRM_Utils_Array::value("contact_assignee_email", $this->_params['fields'])) {
+ $this->select('assignee');
+ $this->from('assignee');
+ $this->where();
+ $insertCols = implode(',', $this->_selectAliases);
+ $tempQuery = "INSERT INTO civireport_activity_temp_target ({$insertCols})
{$this->_select}
{$this->_from} {$this->_where}";
- CRM_Core_DAO::executeQuery($tempQuery);
+ CRM_Core_DAO::executeQuery($tempQuery);
+ }
// 4. fill temp table with source results
- $this->select('source');
- $this->from('source');
- $this->where();
- $insertCols = implode(',', $this->_selectAliases);
- // fixme: do this when source name/email is selected
- $tempQuery = "INSERT INTO civireport_activity_temp_target ({$insertCols})
+ if (CRM_Utils_Array::value("contact_source", $this->_params['fields']) ||
+ CRM_Utils_Array::value("contact_source_email", $this->_params['fields'])) {
+ $this->select('source');
+ $this->from('source');
+ $this->where();
+ $insertCols = implode(',', $this->_selectAliases);
+ $tempQuery = "INSERT INTO civireport_activity_temp_target ({$insertCols})
{$this->_select}
{$this->_from} {$this->_where}";
- CRM_Core_DAO::executeQuery($tempQuery);
+ CRM_Core_DAO::executeQuery($tempQuery);
+ }
// 5. show final result set from temp table
$rows = array();
}
}
- $entryFound = $this->alterDisplayAddressFields($row, $rows, $rowNum, 'activity', 'List all activities for this ') ? TRUE : $entryFound;
-
if (!$entryFound) {
break;
}