Progress 9 for the dashboards
This commit is contained in:
@@ -14,6 +14,7 @@ class PMDashlet extends DashletInstance implements DashletInterface {
|
|||||||
public function setup($dasInsUid) {
|
public function setup($dasInsUid) {
|
||||||
try {
|
try {
|
||||||
$dashletInstance = $this->getDashletInstance($dasInsUid);
|
$dashletInstance = $this->getDashletInstance($dasInsUid);
|
||||||
|
G::LoadClass($dashletInstance['DAS_CLASS']);
|
||||||
$this->dashletObject = new $dashletInstance['DAS_CLASS']();
|
$this->dashletObject = new $dashletInstance['DAS_CLASS']();
|
||||||
$this->dashletObject->setup($dashletInstance);
|
$this->dashletObject->setup($dashletInstance);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ class Dashboard extends Controller {
|
|||||||
$result = new stdclass();
|
$result = new stdclass();
|
||||||
$result->status = 'OK';
|
$result->status = 'OK';
|
||||||
try {
|
try {
|
||||||
$this->pmDashlet->saveDashletInstance($data);
|
$this->pmDashlet->saveDashletInstance(get_object_vars($data));
|
||||||
}
|
}
|
||||||
catch (Exception $error) {
|
catch (Exception $error) {
|
||||||
$result->status = 'ERROR';
|
$result->status = 'ERROR';
|
||||||
@@ -123,12 +123,18 @@ class Dashboard extends Controller {
|
|||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function deleteDashletInstance($dasInsUid) {
|
public function deleteDashletInstance($data) {
|
||||||
$this->setResponseType('json');
|
$this->setResponseType('json');
|
||||||
$result = new stdclass();
|
$result = new stdclass();
|
||||||
$result->status = 'OK';
|
$result->status = 'OK';
|
||||||
try {
|
try {
|
||||||
$this->pmDashlet->deleteDashletInstance($dasInsUid);
|
if (!isset($data->DAS_INS_UID)) {
|
||||||
|
$data->DAS_INS_UID = '';
|
||||||
|
}
|
||||||
|
if ($data->DAS_INS_UID == '') {
|
||||||
|
throw new Exception('Parameter "DAS_INS_UID" is empty.');
|
||||||
|
}
|
||||||
|
$this->pmDashlet->deleteDashletInstance($data->DAS_INS_UID);
|
||||||
}
|
}
|
||||||
catch (Exception $error) {
|
catch (Exception $error) {
|
||||||
$result->status = 'ERROR';
|
$result->status = 'ERROR';
|
||||||
|
|||||||
Reference in New Issue
Block a user