Skip to content

Commit

Permalink
Merge pull request #15972 from aydun/report#24
Browse files Browse the repository at this point in the history
report#24 - Case Detail report - fix 'Active role?' when no relationships
  • Loading branch information
yashodha authored Dec 17, 2019
2 parents aebf30b + 58f5d9d commit 4356a60
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 37 deletions.
20 changes: 2 additions & 18 deletions CRM/Report/Form/Case/Detail.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,6 @@ public function __construct() {
$this->rel_types[$relid] = $v['label_b_a'];
}

$this->deleted_labels = [
'' => ts('- select -'),
0 => ts('No'),
1 => ts('Yes'),
];

$this->caseActivityTypes = [];
foreach (CRM_Case_PseudoConstant::caseActivityType() as $typeDetail) {
$this->caseActivityTypes[$typeDetail['id']] = $typeDetail['label'];
Expand Down Expand Up @@ -81,7 +75,7 @@ public function __construct() {
'is_deleted' => [
'title' => ts('Deleted?'),
'default' => FALSE,
'type' => CRM_Utils_Type::T_INT,
'type' => CRM_Utils_Type::T_BOOLEAN,
],
],
'filters' => [
Expand Down Expand Up @@ -109,9 +103,7 @@ public function __construct() {
],
'is_deleted' => [
'title' => ts('Deleted?'),
'type' => CRM_Utils_Type::T_INT,
'operatorType' => CRM_Report_Form::OP_SELECT,
'options' => $this->deleted_labels,
'type' => CRM_Utils_Type::T_BOOLEAN,
'default' => 0,
],
],
Expand Down Expand Up @@ -173,8 +165,6 @@ public function __construct() {
'is_active' => [
'title' => ts('Active Role?'),
'type' => CRM_Utils_Type::T_BOOLEAN,
'default' => TRUE,
'options' => CRM_Core_SelectValues::boolean(),
],
],
],
Expand Down Expand Up @@ -675,12 +665,6 @@ public function alterDisplay(&$rows) {
$entryFound = TRUE;
}

if (array_key_exists('civicrm_case_is_deleted', $row)) {
$value = $row['civicrm_case_is_deleted'];
$rows[$rowNum]['civicrm_case_is_deleted'] = $this->deleted_labels[$value];
$entryFound = TRUE;
}

$entryFound = $this->alterDisplayAddressFields($row, $rows, $rowNum, NULL, NULL) ? TRUE : $entryFound;
if (!$entryFound) {
break;
Expand Down
21 changes: 2 additions & 19 deletions CRM/Report/Form/Case/Summary.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,6 @@ public function __construct() {
$this->rel_types[$relid] = $v['label_b_a'];
}

$this->deleted_labels = [
'' => ts('- select -'),
0 => ts('No'),
1 => ts('Yes'),
];

$this->_columns = [
'civicrm_c2' => [
'dao' => 'CRM_Contact_DAO_Contact',
Expand Down Expand Up @@ -97,7 +91,7 @@ public function __construct() {
'is_deleted' => [
'title' => ts('Deleted?'),
'default' => FALSE,
'type' => CRM_Utils_Type::T_INT,
'type' => CRM_Utils_Type::T_BOOLEAN,
],
],
'filters' => [
Expand Down Expand Up @@ -125,9 +119,7 @@ public function __construct() {
],
'is_deleted' => [
'title' => ts('Deleted?'),
'type' => CRM_Report_Form::OP_INT,
'operatorType' => CRM_Report_Form::OP_SELECT,
'options' => $this->deleted_labels,
'type' => CRM_Utils_Type::T_BOOLEAN,
'default' => 0,
],
],
Expand Down Expand Up @@ -170,9 +162,6 @@ public function __construct() {
'is_active' => [
'title' => ts('Active Relationship?'),
'type' => CRM_Utils_Type::T_BOOLEAN,
//MV dev/core#603, not set default values Yes/No, this cause issue when relationship fields are not selected
// 'default' => TRUE,
'options' => ['' => ts('- Select -')] + CRM_Core_SelectValues::boolean(),
],
],
],
Expand Down Expand Up @@ -379,12 +368,6 @@ public function alterDisplay(&$rows) {
$entryFound = TRUE;
}

if (array_key_exists('civicrm_case_is_deleted', $row)) {
$value = $row['civicrm_case_is_deleted'];
$rows[$rowNum]['civicrm_case_is_deleted'] = $this->deleted_labels[$value];
$entryFound = TRUE;
}

if (!$entryFound) {
break;
}
Expand Down

0 comments on commit 4356a60

Please sign in to comment.