From c93d9a98b2e0763f6797947f493f9f72057e8d42 Mon Sep 17 00:00:00 2001 From: stephen waite Date: Sun, 14 Jan 2018 16:23:22 -0500 Subject: [PATCH] fix php warnings for Rules (#1382) * fix php warnings for Rules --- interface/super/rules/base/library/BaseController.php | 12 +++++++++--- interface/super/rules/controllers/add/controller.php | 5 +++++ interface/super/rules/controllers/alerts/controller.php | 5 +++++ interface/super/rules/controllers/browse/controller.php | 4 ++++ interface/super/rules/controllers/detail/controller.php | 5 +++++ interface/super/rules/controllers/edit/controller.php | 6 +++++- interface/super/rules/library/ReminderIntervals.php | 9 +++++---- 7 files changed, 38 insertions(+), 8 deletions(-) diff --git a/interface/super/rules/base/library/BaseController.php b/interface/super/rules/base/library/BaseController.php index 46af1d72d..6f0f177fd 100644 --- a/interface/super/rules/base/library/BaseController.php +++ b/interface/super/rules/base/library/BaseController.php @@ -19,9 +19,15 @@ abstract class BaseController { - var $viewBean; - var $ruleManager; - var $codeManager; + public $viewBean; + public $ruleManager; + public $codeManager; + + public function __construct() + { + $this->viewBean = new stdClass(); + } + public function _action_error() { diff --git a/interface/super/rules/controllers/add/controller.php b/interface/super/rules/controllers/add/controller.php index 06b7d6fa0..969e5d62c 100644 --- a/interface/super/rules/controllers/add/controller.php +++ b/interface/super/rules/controllers/add/controller.php @@ -9,6 +9,11 @@ class Controller_add extends BaseController { + public function __construct() + { + parent::__construct(); + } + function _action_add() { $this->viewBean->_view = "add.php"; diff --git a/interface/super/rules/controllers/alerts/controller.php b/interface/super/rules/controllers/alerts/controller.php index 4129b7ddf..70e28b827 100644 --- a/interface/super/rules/controllers/alerts/controller.php +++ b/interface/super/rules/controllers/alerts/controller.php @@ -19,6 +19,11 @@ class Controller_alerts extends BaseController { + public function __construct() + { + parent::__construct(); + } + function _action_listactmgr() { $c = new CdrAlertManager(); diff --git a/interface/super/rules/controllers/browse/controller.php b/interface/super/rules/controllers/browse/controller.php index 6b8eb53f3..af1490ae5 100644 --- a/interface/super/rules/controllers/browse/controller.php +++ b/interface/super/rules/controllers/browse/controller.php @@ -10,6 +10,10 @@ require_once(src_dir() . "/clinical_rules.php"); class Controller_browse extends BaseController { + public function __construct() + { + parent::__construct(); + } function _action_list() { diff --git a/interface/super/rules/controllers/detail/controller.php b/interface/super/rules/controllers/detail/controller.php index c9a5d64b1..ff92ab718 100644 --- a/interface/super/rules/controllers/detail/controller.php +++ b/interface/super/rules/controllers/detail/controller.php @@ -9,6 +9,11 @@ class Controller_detail extends BaseController { + public function __construct() + { + parent::__construct(); + } + function _action_view() { $ruleId = _get('id'); diff --git a/interface/super/rules/controllers/edit/controller.php b/interface/super/rules/controllers/edit/controller.php index 161c6a4fe..3607e0784 100644 --- a/interface/super/rules/controllers/edit/controller.php +++ b/interface/super/rules/controllers/edit/controller.php @@ -9,6 +9,11 @@ class Controller_edit extends BaseController { + public function __construct() + { + parent::__construct(); + } + function _action_summary() { $ruleId = _get('id'); @@ -33,7 +38,6 @@ class Controller_edit extends BaseController if (is_null($rule_id)) { // its a new rule submit $ruleId = $this->getRuleManager()->updateSummary($ruleId, $types, $title, $developer, $funding, $release, $web_ref); - // redirect to the intervals page $this->redirect("index.php?action=edit!intervals&id=$ruleId"); } else { diff --git a/interface/super/rules/library/ReminderIntervals.php b/interface/super/rules/library/ReminderIntervals.php index 73ae27fac..36ddc09d1 100644 --- a/interface/super/rules/library/ReminderIntervals.php +++ b/interface/super/rules/library/ReminderIntervals.php @@ -59,10 +59,11 @@ class ReminderIntervals if (is_null($range)) { return $details; } - - foreach ($details as $detail) { - if ($detail->intervalRange == $range) { - return $detail; + if (is_array($details)) { + foreach ($details as $detail) { + if ($detail->intervalRange == $range) { + return $detail; + } } } -- 2.11.4.GIT