From 847b56f3f7243a16ca09094085ed3f0eedea54ad Mon Sep 17 00:00:00 2001 From: Julio Cesar Laura Date: Mon, 31 Oct 2011 15:14:01 -0400 Subject: [PATCH] Progress 4 for the dashboards --- workflow/engine/classes/class.pmDashlet.php | 13 ++++++++++++- workflow/engine/classes/model/Dashlet.php | 12 +++++++++++- .../engine/classes/model/DashletInstance.php | 16 +++++++++++++++- workflow/engine/controllers/dashboard.php | 2 +- 4 files changed, 39 insertions(+), 4 deletions(-) diff --git a/workflow/engine/classes/class.pmDashlet.php b/workflow/engine/classes/class.pmDashlet.php index a80a74f9f..8a52b0083 100644 --- a/workflow/engine/classes/class.pmDashlet.php +++ b/workflow/engine/classes/class.pmDashlet.php @@ -7,12 +7,14 @@ require_once 'model/DashletInstance.php'; class PMDashlet extends DashletInstance implements DashletInterface { // Own properties + private $dashletObject; // Interface functions public function setup($dasInsUid) { try { - // + //$dashletInstance = $this->getDashletInstance($dasInsUid); + //$this->dashletObject = new $ } catch (Exception $error) { throw $error; @@ -54,6 +56,15 @@ class PMDashlet extends DashletInstance implements DashletInterface { } } + public function getDashletInstance($dasInsUid) { + try { + // + } + catch (Exception $error) { + throw $error; + } + } + public function saveDashletInstance($data) { try { // diff --git a/workflow/engine/classes/model/Dashlet.php b/workflow/engine/classes/model/Dashlet.php index 6060de6be..626ef8c8c 100644 --- a/workflow/engine/classes/model/Dashlet.php +++ b/workflow/engine/classes/model/Dashlet.php @@ -6,7 +6,7 @@ require_once 'classes/model/om/BaseDashlet.php'; /** * Skeleton subclass for representing a row from the 'DASHLET' table. * - * + * * * You should add additional methods to this class to meet the * application requirements. This class will only be generated as @@ -16,4 +16,14 @@ require_once 'classes/model/om/BaseDashlet.php'; */ class Dashlet extends BaseDashlet { + public function load($dasUid) { + try { + $dashlet = DashletPeer::retrieveByPK($dasUid); + return $dashlet->toArray(BasePeer::TYPE_FIELDNAME); + } + catch (Exception $error) { + throw $error; + } + } + } // Dashlet diff --git a/workflow/engine/classes/model/DashletInstance.php b/workflow/engine/classes/model/DashletInstance.php index 23ad40e0e..170878f5f 100644 --- a/workflow/engine/classes/model/DashletInstance.php +++ b/workflow/engine/classes/model/DashletInstance.php @@ -6,7 +6,7 @@ require_once 'classes/model/om/BaseDashletInstance.php'; /** * Skeleton subclass for representing a row from the 'DASHLET_INSTANCE' table. * - * + * * * You should add additional methods to this class to meet the * application requirements. This class will only be generated as @@ -16,4 +16,18 @@ require_once 'classes/model/om/BaseDashletInstance.php'; */ class DashletInstance extends BaseDashletInstance { + public function load($dasInsUid) { + try { + $dashletInstance = DashletInstancePeer::retrieveByPK($dasInsUid); + $fields = $dashletInstance->toArray(BasePeer::TYPE_FIELDNAME); + if ($fields['DAS_INS_ADDITIONAL_PROPERTIES'] != '') { + $fields = array_merge($fields, unserialize($fields['DAS_INS_ADDITIONAL_PROPERTIES'])); + } + return $fields; + } + catch (Exception $error) { + throw $error; + } + } + } // DashletInstance diff --git a/workflow/engine/controllers/dashboard.php b/workflow/engine/controllers/dashboard.php index b42d8235c..940c03219 100644 --- a/workflow/engine/controllers/dashboard.php +++ b/workflow/engine/controllers/dashboard.php @@ -8,7 +8,7 @@ class Dashboard extends Controller { // Class properties - private pmDashlet; + private $pmDashlet; // Class constructor public function __construct() {