Skip to content

Commit

Permalink
CIVICRM-965: Added relationship active filter in CiviCRM Case reports.
Browse files Browse the repository at this point in the history
  • Loading branch information
agilewarealok committed Aug 21, 2018
1 parent b0c4809 commit 6a260de
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
16 changes: 14 additions & 2 deletions CRM/Report/Form/Case/Detail.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ public function __construct() {
1 => ts('Yes'),
);

$this->active_role_labels = array(
0 => ts('No'),
1 => ts('Yes'),
);

$this->caseActivityTypes = array();
foreach (CRM_Case_PseudoConstant::caseActivityType() as $typeDetail) {
$this->caseActivityTypes[$typeDetail['id']] = $typeDetail['label'];
Expand Down Expand Up @@ -180,6 +185,12 @@ public function __construct() {
'operatorType' => CRM_Report_Form::OP_MULTISELECT,
'options' => $this->rel_types,
),
'is_active' => array(
'title' => ts('Active Role?'),
'type' => CRM_Utils_Type::T_BOOLEAN,
'default' => TRUE,
'options' => $this->active_role_labels,
),
),
),
'civicrm_email' => array(
Expand Down Expand Up @@ -572,8 +583,9 @@ public function postProcess() {
}

public function checkEnabledFields() {
if (isset($this->_params['case_role_value'])
&& !empty($this->_params['case_role_value'])
if ((isset($this->_params['case_role_value'])
&& !empty($this->_params['case_role_value'])) ||
(isset($this->_params['is_active_value']))
) {
$this->_relField = TRUE;
}
Expand Down
11 changes: 11 additions & 0 deletions CRM/Report/Form/Case/Summary.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ public function __construct() {
1 => ts('Yes'),
);

$this->active_relationship_labels = array(
0 => ts('No'),
1 => ts('Yes'),
);

$this->_columns = array(
'civicrm_c2' => array(
'dao' => 'CRM_Contact_DAO_Contact',
Expand Down Expand Up @@ -182,6 +187,12 @@ public function __construct() {
'operatorType' => CRM_Report_Form::OP_MULTISELECT,
'options' => $this->rel_types,
),
'is_active' => array(
'title' => ts('Active Relationship?'),
'type' => CRM_Utils_Type::T_BOOLEAN,
'default' => TRUE,
'options' => $this->active_relationship_labels,
),
),
),
'civicrm_relationship_type' => array(
Expand Down

0 comments on commit 6a260de

Please sign in to comment.