From cba79d5a2af60bb70763203662247481712af2d6 Mon Sep 17 00:00:00 2001 From: Bradley Taylor Date: Mon, 6 Nov 2023 19:47:44 +0000 Subject: [PATCH] [REF][PHP8.2] Tidy up CRM_Report_Form_Case_Detail --- CRM/Report/Form/Case/Detail.php | 34 ++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/CRM/Report/Form/Case/Detail.php b/CRM/Report/Form/Case/Detail.php index bc90feede7..fc1d7de6c0 100644 --- a/CRM/Report/Form/Case/Detail.php +++ b/CRM/Report/Form/Case/Detail.php @@ -35,14 +35,34 @@ class CRM_Report_Form_Case_Detail extends CRM_Report_Form { protected $_caseTypeNameOrderBy = FALSE; + /** + * @var array + */ + protected $caseStatuses; + + /** + * @var array + */ + protected $caseTypes; + + /** + * @var array + */ + protected $relTypes; + + /** + * @var array + */ + protected $caseActivityTypes; + /** */ public function __construct() { - $this->case_statuses = CRM_Core_OptionGroup::values('case_status'); - $this->case_types = CRM_Case_PseudoConstant::caseType(); + $this->caseStatuses = CRM_Core_OptionGroup::values('case_status'); + $this->caseTypes = CRM_Case_PseudoConstant::caseType(); $rels = CRM_Core_PseudoConstant::relationshipType(); foreach ($rels as $relid => $v) { - $this->rel_types[$relid] = $v['label_b_a']; + $this->relTypes[$relid] = $v['label_b_a']; } $this->caseActivityTypes = []; @@ -165,7 +185,7 @@ class CRM_Report_Form_Case_Detail extends CRM_Report_Form { 'title' => ts('Case Role(s)'), 'type' => CRM_Utils_Type::T_INT, 'operatorType' => CRM_Report_Form::OP_MULTISELECT, - 'options' => $this->rel_types, + 'options' => $this->relTypes, ], 'is_active' => [ 'title' => ts('Active Role?'), @@ -597,14 +617,14 @@ class CRM_Report_Form_Case_Detail extends CRM_Report_Form { foreach ($rows as $rowNum => $row) { if (array_key_exists('civicrm_case_status_id', $row)) { if ($value = $row['civicrm_case_status_id']) { - $rows[$rowNum]['civicrm_case_status_id'] = $this->case_statuses[$value]; + $rows[$rowNum]['civicrm_case_status_id'] = $this->caseStatuses[$value]; $entryFound = TRUE; } } if (array_key_exists('civicrm_case_case_type_id', $row)) { if ($value = str_replace(CRM_Core_DAO::VALUE_SEPARATOR, '', $row['civicrm_case_case_type_id'])) { - $rows[$rowNum]['civicrm_case_case_type_id'] = $this->case_types[$value]; + $rows[$rowNum]['civicrm_case_case_type_id'] = $this->caseTypes[$value]; $entryFound = TRUE; } @@ -625,7 +645,7 @@ class CRM_Report_Form_Case_Detail extends CRM_Report_Form { if ($value = $row['civicrm_relationship_case_role']) { $caseRoles = explode(',', $value); foreach ($caseRoles as $num => $caseRole) { - $caseRoles[$num] = $this->rel_types[$caseRole]; + $caseRoles[$num] = $this->relTypes[$caseRole]; } $rows[$rowNum]['civicrm_relationship_case_role'] = implode('; ', $caseRoles); } -- 2.25.1