Skip to content

Commit

Permalink
Remove class constructor.
Browse files Browse the repository at this point in the history
  • Loading branch information
tertek committed Jan 26, 2024
1 parent 4950ad1 commit 85c8c52
Showing 1 changed file with 27 additions and 17 deletions.
44 changes: 27 additions & 17 deletions recordHomeDashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
// }

/**
*
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 = [];
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 85c8c52

Please sign in to comment.