aboutsummaryrefslogtreecommitdiff
path: root/h-source/Application/Controllers/HistoryController.php
diff options
context:
space:
mode:
authorAntonio Gallo <tonicucoz@gmail.com>2010-12-29 22:08:39 +0000
committerAntonio Gallo <tonicucoz@gmail.com>2010-12-29 22:08:39 +0000
commit98cde2db446345b80636fe933702d8fc72179965 (patch)
tree775de8a0f068bd0815a71e7660dd7ca212bf0b49 /h-source/Application/Controllers/HistoryController.php
parent547b27015b4173e33409cf1be1b0aea2dfa0994d (diff)
moderators can now open/close issues - part 1
Diffstat (limited to 'h-source/Application/Controllers/HistoryController.php')
-rw-r--r--h-source/Application/Controllers/HistoryController.php47
1 files changed, 46 insertions, 1 deletions
diff --git a/h-source/Application/Controllers/HistoryController.php b/h-source/Application/Controllers/HistoryController.php
index 76b1158..f5ae1a2 100644
--- a/h-source/Application/Controllers/HistoryController.php
+++ b/h-source/Application/Controllers/HistoryController.php
@@ -65,6 +65,26 @@ class HistoryController extends BaseController
),
+ 'open' => array(
+
+ 'action' => 'open',
+ 'check_status' => 'closed',
+ 'to_status' => 'opened',
+ 'exec_string' => 'The issue has been opened. Just reload the page',
+ 'error_string' => 'Error: the issue is already opened',
+
+ ),
+
+ 'close' => array(
+
+ 'action' => 'close',
+ 'check_status' => 'opened',
+ 'to_status' => 'closed',
+ 'exec_string' => 'The issue has been closed. Just reload the page',
+ 'error_string' => 'Error: the issue is already closed',
+
+ ),
+
);
protected $types = array(
@@ -102,6 +122,17 @@ class HistoryController extends BaseController
),
+ 'issue' => array(
+
+ 'clean_type' => 'issue',
+ 'model_name' => 'IssuesModel',
+ 'id_name' => 'id_issue',
+ 'field_name' => 'status',
+ 'actions' => array('open','close'),
+ 'group' => 'moderator',
+
+ ),
+
);
public function __construct($model, $controller, $queryString)
@@ -133,6 +164,16 @@ class HistoryController extends BaseController
$this->generic($lang, $token, 'unblock');
}
+ public function open($lang = 'en', $token = '')
+ {
+ $this->generic($lang, $token, 'open');
+ }
+
+ public function close($lang = 'en', $token = '')
+ {
+ $this->generic($lang, $token, 'close');
+ }
+
protected function generic($lang = 'en', $token = '', $action = 'hide')
{
header('Content-type: text/html; charset=UTF-8');
@@ -237,6 +278,10 @@ class HistoryController extends BaseController
$data['object'] = 'user';
$data['box_class'] = 'details_of_actions_inner_user';
break;
+ case 'issue':
+ $data['object'] = 'issue';
+ $data['box_class'] = 'details_of_actions_inner_user';
+ break;
default:
$data['object'] = 'message';
$data['box_class'] = 'details_of_actions_inner';
@@ -245,7 +290,7 @@ class HistoryController extends BaseController
$data['res'] = $this->m['HistoryModel']->select()->where(array('id'=>$clean['id'],'type'=>$clean['type'],'gr'=>$clean['group']))->send();
- $data['md_action'] = array('hide'=>'hidden','show'=>'restored','block'=>'blocked','unblock'=>'un-blocked');
+ $data['md_action'] = array('hide'=>'hidden','show'=>'restored','block'=>'blocked','unblock'=>'un-blocked','open'=>'opened again','close'=>'closed');
$this->append($data);
$this->load('viewall');