Skip to content

Commit

Permalink
[REF][PHP8.2] Avoid dynamic properties in CRM_Case_Form_CaseView
Browse files Browse the repository at this point in the history
  • Loading branch information
braders committed Jan 7, 2023
1 parent f4ab9fb commit 38d7803
Showing 1 changed file with 49 additions and 2 deletions.
51 changes: 49 additions & 2 deletions CRM/Case/Form/CaseView.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,59 @@ class CRM_Case_Form_CaseView extends CRM_Core_Form {
*/
private $_mergeCases = FALSE;

/**
* Related case view
*
* @var bool
* @internal
*/
public $_showRelatedCases = FALSE;

/**
* Does user have capabilities to access all cases and activities
*
* @var bool
* @internal
*/
public $_hasAccessToAllCases = FALSE;

/**
* ID of contact being viewed
*
* @var int
* @internal
*/
public $_contactID;

/**
* ID of case being viewed
*
* @var int
* @internal
*/
public $_caseID;

/**
* Various case details, for use in the template
*
* @var array
* @internal
*/
public $_caseDetails = [];

/**
* The name of the type associated with the current case
*
* @var string
* @internal
*/
public $_caseType;

/**
* Set variables up before form is built.
*/
public function preProcess() {
$this->_showRelatedCases = $_GET['relatedCases'] ?? NULL;
$this->_showRelatedCases = (bool) ($_GET['relatedCases'] ?? FALSE);

$xmlProcessorProcess = new CRM_Case_XMLProcessor_Process();
$isMultiClient = $xmlProcessorProcess->getAllowMultipleCaseClients();
Expand All @@ -40,7 +88,6 @@ public function preProcess() {
if ($this->_showRelatedCases) {
$relatedCases = $this->get('relatedCases');
if (!isset($relatedCases)) {
$cId = CRM_Utils_Request::retrieve('cid', 'Integer');
$caseId = CRM_Utils_Request::retrieve('id', 'Integer');
$relatedCases = CRM_Case_BAO_Case::getRelatedCases($caseId);
}
Expand Down

0 comments on commit 38d7803

Please sign in to comment.