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

[REF][PHP8.2] Avoid dynamic properties in CRM_Case_Form_CaseView #25292

Merged
merged 1 commit into from
Jan 7, 2023
Merged
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
[REF][PHP8.2] Avoid dynamic properties in CRM_Case_Form_CaseView
  • Loading branch information
braders committed Jan 7, 2023
commit 38d78030a843f584ddce9b2c10aabe362a3c9366
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