Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change "Last Action Date" filter variable name CRM-20930 #10712

Merged
merged 2 commits into from
Aug 3, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 52 additions & 3 deletions CRM/Report/Form/Case/Detail.php
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,21 @@ public function __construct() {
),
'civicrm_activity_last' => array(
'dao' => 'CRM_Activity_DAO_Activity',
'fields' => array(
'last_activity_activity_subject' => array(
'name' => 'subject',
'title' => ts('Subject of the last activity in the case'),
),
'last_activity_activity_type' => array(
'name' => 'activity_type_id',
'title' => ts('Activity type of the last activity'),
),
'last_activity_date_time' => array(
'name' => 'activity_date_time',
'title' => ts('Last Action Date'),
'operatorType' => CRM_Report_Form::OP_DATE,
),
),
'filters' => array(
'last_activity_date_time' => array(
'name' => 'activity_date_time',
Expand All @@ -270,6 +285,18 @@ public function __construct() {
'name' => 'activity_type_id',
'title' => ts('Activity type of the last completed activity'),
),
'last_completed_date_time' => array(
'name' => 'activity_date_time',
'title' => ts('Last Completed Action Date'),
'operatorType' => CRM_Report_Form::OP_DATE,
),
),
'filters' => array(
'last_completed_date_time' => array(
'name' => 'activity_date_time',
'title' => ts('Last Completed Action Date'),
'operatorType' => CRM_Report_Form::OP_DATE,
),
),
),
);
Expand Down Expand Up @@ -336,6 +363,9 @@ public function select() {
$select[] = "GROUP_CONCAT({$field['dbAlias']} ORDER BY {$field['dbAlias']} )
as {$tableName}_{$fieldName}";
}
if ($tableName == 'civicrm_activity_last') {
$this->_activityLast = TRUE;
}
if ($tableName == 'civicrm_activity_last_completed') {
$this->_activityLastCompleted = TRUE;
}
Expand Down Expand Up @@ -581,9 +611,16 @@ public function checkEnabledFields() {
$this->_relField = TRUE;
}

if (!empty($this->_params['activity_date_time_relative']) ||
!empty($this->_params['activity_date_time_from']) ||
CRM_Utils_Array::value('activity_date_time_to', $this->_params)
if (!empty($this->_params['last_completed_date_time_relative']) ||
!empty($this->_params['last_completed_date_time_from']) ||
CRM_Utils_Array::value('last_completed_date_time_to', $this->_params)
) {
$this->_activityLastCompleted = TRUE;
}

if (!empty($this->_params['last_activity_date_time_relative']) ||
!empty($this->_params['last_activity_date_time_from']) ||
CRM_Utils_Array::value('last_activity_date_time_to', $this->_params)
) {
$this->_activityLast = TRUE;
}
Expand Down Expand Up @@ -658,6 +695,12 @@ public function alterDisplay(&$rows) {
}
$entryFound = TRUE;
}
if (array_key_exists('civicrm_activity_last_last_activity_activity_subject', $row) &&
empty($row['civicrm_activity_last_last_activity_activity_subject'])
) {
$rows[$rowNum]['civicrm_activity_last_last_activity_activity_subject'] = ts('(no subject)');
$entryFound = TRUE;
}
if (array_key_exists('civicrm_activity_last_completed_last_completed_activity_subject', $row) &&
empty($row['civicrm_activity_last_completed_last_completed_activity_subject'])
) {
Expand All @@ -675,6 +718,12 @@ public function alterDisplay(&$rows) {
$rows[$rowNum]['civicrm_contact_client_sort_name_hover'] = ts("View Contact Summary for this Contact");
$entryFound = TRUE;
}
if (array_key_exists('civicrm_activity_last_last_activity_activity_type', $row)) {
if ($value = $row['civicrm_activity_last_last_activity_activity_type']) {
$rows[$rowNum]['civicrm_activity_last_last_activity_activity_type'] = $activityTypes[$value];
}
$entryFound = TRUE;
}
if (array_key_exists('civicrm_activity_last_completed_last_completed_activity_type', $row)) {
if ($value = $row['civicrm_activity_last_completed_last_completed_activity_type']) {
$rows[$rowNum]['civicrm_activity_last_completed_last_completed_activity_type'] = $activityTypes[$value];
Expand Down