From 85c8c522e87952552a2e81997873bcc7ba29cb71 Mon Sep 17 00:00:00 2001 From: tertek Date: Fri, 26 Jan 2024 10:06:20 +0100 Subject: [PATCH] Remove class constructor. --- recordHomeDashboard.php | 44 +++++++++++++++++++++++++---------------- 1 file changed, 27 insertions(+), 17 deletions(-) diff --git a/recordHomeDashboard.php b/recordHomeDashboard.php index 7f33238..3aa195f 100644 --- a/recordHomeDashboard.php +++ b/recordHomeDashboard.php @@ -30,23 +30,21 @@ class recordHomeDashboard extends \ExternalModules\AbstractExternalModule { protected $events; protected $table_pk; - /** - * Constructs the class - * @return void - * @since 1.0.0 - * - */ - public function __construct() { - parent::__construct(); - global $Proj; - - $this->project_settings = $Proj; - $this->hasMultipleEvents= $Proj->longitudinal; - $this->hasMultipleArms = $Proj->multiple_arms; - //$this->events = array_keys($Proj->eventsForms); - $this->events = (is_array($Proj->eventsForms) ? array_keys($Proj->eventsForms) : null); - $this->table_pk = $Proj->table_pk; - } +// /** +// * Constructs the class +// * @return void +// * @since 1.0.0 +// * +// */ +// public function __construct() { +// parent::__construct(); +// //global $Proj; +// +// // $this->hasMultipleEvents= $Proj->longitudinal; +// // $this->hasMultipleArms = $Proj->multiple_arms; +// // $this->events = (is_array($Proj->eventsForms) ? array_keys($Proj->eventsForms) : null); +// // $this->table_pk = $Proj->table_pk; +// } /** * @@ -114,6 +112,11 @@ private function renderDashboard() { * */ public function getProjectParameters() { + + global $Proj; + $this->hasMultipleEvents= $Proj->longitudinal; + $this->hasMultipleArms = $Proj->multiple_arms; + return [ "hasMultipleEvents" => $this->hasMultipleEvents, "hasMultipleArms" => $this->hasMultipleArms @@ -172,6 +175,9 @@ private function getDisplayOptions() { * */ private function getInstancesData( $project_id , $record, $instrument, $fields=null, $events=[]) { + + global $Proj; + $this->table_pk = $Proj->table_pk; $field_names_array = []; $params = []; @@ -395,6 +401,10 @@ public function getFieldForInstrument($instrument) { */ public function getSafeRepeatingForms() { + global $Proj; + $this->hasMultipleEvents= $Proj->longitudinal; + $this->events = (is_array($Proj->eventsForms) ? array_keys($Proj->eventsForms) : null); + $repeatingForms = []; if($this->hasMultipleEvents) { // Stack repeating forms for all events