*/
$this->_columns = [
ts('Name') => 'sort_name',
- ts('Status') => 'activity_status',
- ts('Activity Type') => 'activity_type',
+ ts('Status') => 'activity_status_id',
+ ts('Activity Type') => 'activity_type_id',
ts('Activity Subject') => 'activity_subject',
ts('Scheduled By') => 'source_contact',
ts('Scheduled Date') => 'activity_date',
' ' => 'activity_id',
- ' ' => 'activity_type_id',
' ' => 'case_id',
ts('Location') => 'location',
ts('Duration') => 'duration',
ts('Assignee') => 'assignee',
];
- $this->_groupId = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup',
- 'activity_status',
- 'id',
- 'name'
- );
-
//Add custom fields to columns array for inclusion in export
$groupTree = CRM_Core_BAO_CustomGroup::getTree('Activity');
activity.id as activity_id,
activity.activity_type_id as activity_type_id,
contact_b.sort_name as source_contact,
- ov1.label as activity_type,
activity.subject as activity_subject,
activity.activity_date_time as activity_date,
- ov2.label as activity_status,
+ activity.status_id as activity_status_id,
cca.case_id as case_id,
activity.location as location,
activity.duration as duration,
*/
public function alterRow(&$row) {
$row['activity_date'] = CRM_Utils_Date::customFormat($row['activity_date'], '%B %E%f, %Y %l:%M %P');
+ $row['activity_type_id'] = CRM_Core_PseudoConstant::getLabel('CRM_Activity_DAO_Activity', 'activity_type_id', $row['activity_type_id']);
+ $row['activity_status_id'] = CRM_Core_PseudoConstant::getLabel('CRM_Activity_DAO_Activity', 'activity_status_id', $row['activity_status_id']);
}
/**
ON activity.id = target.activity_id AND target.record_type_id = {$targetID}
JOIN civicrm_contact contact_a
ON contact_a.id = target.contact_id
- JOIN civicrm_option_value ov1
- ON activity.activity_type_id = ov1.value AND ov1.option_group_id = 2
- JOIN civicrm_option_value ov2
- ON activity.status_id = ov2.value AND ov2.option_group_id = {$this->_groupId}
LEFT JOIN civicrm_activity_contact sourceContact
ON activity.id = sourceContact.activity_id AND sourceContact.record_type_id = {$sourceID}
JOIN civicrm_contact contact_b
<thead class="sticky">
<th scope="col" title="Select All Rows">{$form.toggleSelect.html}</th>
{foreach from=$columnHeaders item=header}
- {if ($header.sort eq 'activity_id') or ($header.sort eq 'activity_type_id') or ($header.sort eq 'case_id') }
- {elseif ($header.sort eq 'sort_name') or ($header.sort eq 'activity_status') or ($header.sort eq 'activity_type') or ($header.sort eq 'activity_subject') or ($header.sort eq 'source_contact') or ($header.SORT eq 'activity_date') or ($header.name eq null) }
+ {if ($header.sort eq 'activity_id') or ($header.sort eq 'case_id') }
+ {elseif ($header.sort eq 'sort_name') or ($header.sort eq 'activity_status_id') or ($header.sort eq 'activity_type_id') or ($header.sort eq 'activity_subject') or ($header.sort eq 'source_contact') or ($header.SORT eq 'activity_date') or ($header.name eq null) }
<th scope="col">
{if $header.sort}
{assign var='key' value=$header.sort}
{assign var=cbName value=$row.checkbox}
<td>{$form.$cbName.html}</td>
{foreach from=$columnHeaders item=header}
- {if ($header.sort eq 'sort_name') or ($header.sort eq 'activity_status') or ($header.sort eq 'activity_type') or ($header.sort eq 'activity_subject') or ($header.sort eq 'source_contact') or ($header.SORT eq 'activity_date') or ($header.name eq null) }
+ {if ($header.sort eq 'sort_name') or ($header.sort eq 'activity_status_id') or ($header.sort eq 'activity_type_id') or ($header.sort eq 'activity_subject') or ($header.sort eq 'source_contact') or ($header.SORT eq 'activity_date') or ($header.name eq null) }
{assign var=fName value=$header.sort}
{if $fName eq 'sort_name'}
<td><a href="{crmURL p='civicrm/contact/view' q="reset=1&cid=`$row.contact_id`&key=`$qfKey`"}">{$row.sort_name}</a></td>
{/if}
{if isset($row.activity_subject) AND $row.activity_subject NEQ 'NULL'}{$row.activity_subject}{else}{ts}(no subject){/ts}{/if}</a>
</td>
- {elseif ($fName eq 'activity_id') or ($fName eq 'activity_type_id') or ($fName eq 'case_id')}
+ {elseif ($fName eq 'activity_id') or ($fName eq 'case_id')}
{else}
<td>{$row.$fName}</td>
{/if}