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

report#24 - Case Detail report - fix 'Active role?' when no relationships #15972

Merged
merged 1 commit into from
Dec 17, 2019
Merged
Show file tree
Hide file tree
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
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