aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonio Gallo <tonicucoz@gmail.com>2011-07-14 09:23:58 +0000
committerAntonio Gallo <tonicucoz@gmail.com>2011-07-14 09:23:58 +0000
commit8e1a6083cf4be6b0fb2d31863e409dfcb4705261 (patch)
tree70e18170130cb4d238389981630adb86a22b0966
parentd8e1f81df2e40574c0e685910bf99407f7e66017 (diff)
a page can't be hidden or shown if it has been permanently deleted
-rw-r--r--h-source/Application/Controllers/HistoryController.php14
1 files changed, 11 insertions, 3 deletions
diff --git a/h-source/Application/Controllers/HistoryController.php b/h-source/Application/Controllers/HistoryController.php
index a3421a9..ee68381 100644
--- a/h-source/Application/Controllers/HistoryController.php
+++ b/h-source/Application/Controllers/HistoryController.php
@@ -162,7 +162,8 @@ class HistoryController extends BaseController
'to_status' => 'yes',
'exec_string' => 'The device page has been hidden. Just reload the page',
'error_string' => 'Error: the device page is already hidden',
-
+ 'allowed_only_if' => array('cleared'=>'no'),
+
),
'deviceshow' => array(
@@ -172,7 +173,8 @@ class HistoryController extends BaseController
'to_status' => 'no',
'exec_string' => 'The device page is no more hidden. Just reload the page',
'error_string' => 'Error: the device page is already visible',
-
+ 'allowed_only_if' => array('cleared'=>'no'),
+
),
'deviceapprove' => array(
@@ -182,7 +184,8 @@ class HistoryController extends BaseController
'to_status' => 'yes',
'exec_string' => 'The device page has been approved. Just reload the page',
'error_string' => 'Error: the device page is already approved',
-
+ 'allowed_only_if' => array('cleared'=>'no'),
+
),
'deviceclear' => array(
@@ -436,6 +439,11 @@ class HistoryController extends BaseController
$model->select()->where(array($clean['id_name'] => $clean['id'],$clean['field_name'] => $this->strings[$action]['check_status']));
+ if (isset($this->strings[$action]['allowed_only_if']) and is_array($this->strings[$action]['allowed_only_if']))
+ {
+ $model->aWhere($this->strings[$action]['allowed_only_if']);
+ }
+
$count = $model->rowNumber();
if ($count > 0)