'fields' => array(
'contact_source' => array(
'name' => 'sort_name',
- 'title' => ts('Source Contact Name'),
+ 'title' => ts('Source Name'),
'alias' => 'civicrm_contact_source',
'no_repeat' => TRUE,
),
'contact_assignee' => array(
'name' => 'sort_name',
- 'title' => ts('Assignee Contact Name'),
+ 'title' => ts('Assignee Name'),
'alias' => 'civicrm_contact_assignee',
'dbAlias' => "civicrm_contact_assignee.sort_name",
'default' => TRUE,
),
'contact_target' => array(
'name' => 'sort_name',
- 'title' => ts('Target Contact Name'),
+ 'title' => ts('Target Name'),
'alias' => 'civicrm_contact_target',
'dbAlias' => "civicrm_contact_target.sort_name",
'default' => TRUE,
'contact_source' => array(
'name' => 'sort_name',
'alias' => 'civicrm_contact_source',
- 'title' => ts('Source Contact Name'),
+ 'title' => ts('Source Name'),
'operator' => 'like',
'type' => CRM_Report_Form::OP_STRING,
),
'contact_assignee' => array(
'name' => 'sort_name',
'alias' => 'civicrm_contact_assignee',
- 'title' => ts('Assignee Contact Name'),
+ 'title' => ts('Assignee Name'),
'operator' => 'like',
'type' => CRM_Report_Form::OP_STRING,
),
'contact_target' => array(
'name' => 'sort_name',
'alias' => 'civicrm_contact_target',
- 'title' => ts('Target Contact Name'),
+ 'title' => ts('Target Name'),
'operator' => 'like',
'type' => CRM_Report_Form::OP_STRING,
),
'fields' => array(
'contact_source_email' => array(
'name' => 'email',
- 'title' => ts('Source Contact Email'),
+ 'title' => ts('Source Email'),
'alias' => 'civicrm_email_source',
),
'contact_assignee_email' => array(
'name' => 'email',
- 'title' => ts('Assignee Contact Email'),
+ 'title' => ts('Assignee Email'),
'alias' => 'civicrm_email_assignee',
),
'contact_target_email' => array(
'name' => 'email',
- 'title' => ts('Target Contact Email'),
+ 'title' => ts('Target Email'),
'alias' => 'civicrm_email_target',
),
),
'order_bys' => array(
'source_contact_email' => array(
'name' => 'email',
- 'title' => ts('Source Contact Email'),
+ 'title' => ts('Source Email'),
'dbAlias' => 'civicrm_email_contact_source_email',
),
),
),
+ 'civicrm_phone' => array(
+ 'dao' => 'CRM_Core_DAO_Phone',
+ 'fields' => array(
+ 'contact_source_phone' => array(
+ 'name' => 'phone',
+ 'title' => ts('Source Phone'),
+ 'alias' => 'civicrm_phone_source',
+ ),
+ 'contact_assignee_phone' => array(
+ 'name' => 'phone',
+ 'title' => ts('Assignee Phone'),
+ 'alias' => 'civicrm_phone_assignee',
+ ),
+ 'contact_target_phone' => array(
+ 'name' => 'phone',
+ 'title' => ts('Target Phone'),
+ 'alias' => 'civicrm_phone_target',
+ ),
+ ),
+ ),
'civicrm_activity' => array(
'dao' => 'CRM_Activity_DAO_Activity',
'fields' => array(
if (strstr($clause, 'civicrm_contact_assignee.') ||
strstr($clause, 'civicrm_contact_source.') ||
strstr($clause, 'civicrm_email_assignee.') ||
- strstr($clause, 'civicrm_email_source.')
+ strstr($clause, 'civicrm_email_source.') ||
+ strstr($clause, 'civicrm_phone_assignee.') ||
+ strstr($clause, 'civicrm_phone_source.')
) {
$removeKeys[] = $key;
unset($this->_selectClauses[$key]);
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, 'civicrm_phone_target.') ||
+ strstr($clause, 'civicrm_phone_source.')
) {
$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, 'civicrm_phone_target.') ||
+ strstr($clause, 'civicrm_phone_assignee.')
) {
$removeKeys[] = $key;
unset($this->_selectClauses[$key]);
foreach ($this->_selectClauses as $key => $clause) {
if (strstr($clause, 'civicrm_contact_contact_target') ||
strstr($clause, 'civicrm_contact_contact_assignee') ||
- strstr($clause, 'civicrm_contact_contact_source')
+ strstr($clause, 'civicrm_contact_contact_source') ||
+ strstr($clause, 'civicrm_phone_contact_source_phone') ||
+ strstr($clause, 'civicrm_phone_contact_assignee_phone') ||
+ strstr($clause, 'civicrm_email_contact_source_email') ||
+ strstr($clause, 'civicrm_email_contact_assignee_email') ||
+ strstr($clause, 'civicrm_email_contact_target_email') ||
+ strstr($clause, 'civicrm_phone_contact_target_phone')
) {
- $this->_selectClauses[$key] = "GROUP_CONCAT($clause SEPARATOR ';') as $clause";
+ $this->_selectClauses[$key] = "GROUP_CONCAT($clause SEPARATOR '; ') as $clause";
}
}
}
ON {$this->_aliases['civicrm_activity_contact']}.contact_id = civicrm_email_target.contact_id AND
civicrm_email_target.is_primary = 1";
}
+
+ if ($this->isTableSelected('civicrm_phone')) {
+ $this->_from .= "
+ LEFT JOIN civicrm_phone civicrm_phone_target
+ ON {$this->_aliases['civicrm_activity_contact']}.contact_id = civicrm_phone_target.contact_id AND
+ civicrm_phone_target.is_primary = 1 ";
+ }
$this->_aliases['civicrm_contact'] = 'civicrm_contact_target';
}
ON {$this->_aliases['civicrm_activity_contact']}.contact_id = civicrm_email_assignee.contact_id AND
civicrm_email_assignee.is_primary = 1";
}
+ if ($this->isTableSelected('civicrm_phone')) {
+ $this->_from .= "
+ LEFT JOIN civicrm_phone civicrm_phone_assignee
+ ON {$this->_aliases['civicrm_activity_contact']}.contact_id = civicrm_phone_assignee.contact_id AND
+ civicrm_phone_assignee.is_primary = 1 ";
+ }
$this->_aliases['civicrm_contact'] = 'civicrm_contact_assignee';
}
ON {$this->_aliases['civicrm_activity_contact']}.contact_id = civicrm_email_source.contact_id AND
civicrm_email_source.is_primary = 1";
}
+ if ($this->isTableSelected('civicrm_phone')) {
+ $this->_from .= "
+ LEFT JOIN civicrm_phone civicrm_phone_source
+ ON {$this->_aliases['civicrm_activity_contact']}.contact_id = civicrm_phone_source.contact_id AND
+ civicrm_phone_source.is_primary = 1 ";
+ }
$this->_aliases['civicrm_contact'] = 'civicrm_contact_source';
}
- $this->_from .= "INNER JOIN civicrm_option_value {$this->_aliases['civicrm_option_value']}
+ $this->_from .= " INNER JOIN civicrm_option_value {$this->_aliases['civicrm_option_value']}
ON {$this->_aliases['civicrm_option_value']}.option_group_id = {$activityTypeId}
AND {$this->_aliases['civicrm_option_value']}.value = {$this->_aliases['civicrm_activity']}.activity_type_id";
$this->addAddressFromClause();
ADD COLUMN civicrm_contact_contact_source VARCHAR(128),
ADD COLUMN civicrm_contact_contact_assignee_id VARCHAR(128),
ADD COLUMN civicrm_contact_contact_source_id VARCHAR(128),
+ ADD COLUMN civicrm_phone_contact_assignee_phone VARCHAR(128),
+ 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);
$onHover = ts('View Contact Summary for this Contact');
$onHoverAct = ts('View Activity Record');
}
-
foreach ($rows as $rowNum => $row) {
// if we have an activity type, format the View Activity link for use in various columns
if ($viewLinks &&