diff options
Diffstat (limited to 'h-source/Application/Controllers')
-rw-r--r-- | h-source/Application/Controllers/HistoryController.php | 14 |
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) |