aboutsummaryrefslogtreecommitdiff
path: root/h-source/Application
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
parent547b27015b4173e33409cf1be1b0aea2dfa0994d (diff)
moderators can now open/close issues - part 1
Diffstat (limited to 'h-source/Application')
-rw-r--r--h-source/Application/Controllers/HistoryController.php47
-rw-r--r--h-source/Application/Controllers/IssuesController.php2
-rw-r--r--h-source/Application/Include/myFunctions.php3
-rw-r--r--h-source/Application/Views/Issues/view.php29
4 files changed, 77 insertions, 4 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');
diff --git a/h-source/Application/Controllers/IssuesController.php b/h-source/Application/Controllers/IssuesController.php
index 2a584b7..9c0715d 100644
--- a/h-source/Application/Controllers/IssuesController.php
+++ b/h-source/Application/Controllers/IssuesController.php
@@ -168,7 +168,7 @@ class IssuesController extends BaseController
$data['table'] = $this->m['IssuesModel']->select('id_issue,created_by,title,status,creation_date,topic,priority,message,notice')->where(array('id_issue'=>$clean['id_issue'],'deleted'=>'no'))->send();
// javascript for moderator
- $data['md_javascript'] = "moderator_dialog(\"hide\",\"message\");moderator_dialog(\"show\",\"message\");";
+ $data['md_javascript'] = "moderator_dialog(\"hide\",\"message\");moderator_dialog(\"show\",\"message\");moderator_dialog(\"open\",\"issue\");moderator_dialog(\"close\",\"issue\");";
$data['go_to'] = $this->currPage."/".$this->lang."/".$clean['id_issue'];
if (count($data['table']) > 0)
diff --git a/h-source/Application/Include/myFunctions.php b/h-source/Application/Include/myFunctions.php
index fa87b08..7e509cd 100644
--- a/h-source/Application/Include/myFunctions.php
+++ b/h-source/Application/Include/myFunctions.php
@@ -386,6 +386,9 @@ function goToModeratedItem( $row = array() )
case 'user':
$url = 'meet/user/'.Lang::$current.'/'.getUserName($row['id']);
break;
+ case 'issue':
+ $url = 'issues/view/'.Lang::$current.'/'.$row['id'];
+ break;
}
return 'http://'.DOMAIN_NAME.'/'.$url;
}
diff --git a/h-source/Application/Views/Issues/view.php b/h-source/Application/Views/Issues/view.php
index 1575d23..5789837 100644
--- a/h-source/Application/Views/Issues/view.php
+++ b/h-source/Application/Views/Issues/view.php
@@ -38,7 +38,32 @@
<div class="issues_external_box">
<?php foreach ($table as $row) { ?>
-
+
+ <?php if ($ismoderator) { ?>
+ <!--open/close an issue-->
+ <div class="moderator_box">
+ <?php if (strcmp($row['issues']['status'],'opened') == 0) { ?>
+ This issue is opened
+
+ <a id="<?php echo $row['issues']['id_issue'];;?>" class="close_issue block_general" href="<?php echo $this->baseUrl."/home/index/$lang";?>"><img src="<?php echo $this->baseUrl;?>/Public/Img/H2O/im-user.png">close the issue</a>
+
+ <?php } else { ?>
+ This issue is closed
+
+ <a id="<?php echo $row['issues']['id_issue'];;?>" class="open_issue block_general" href="<?php echo $this->baseUrl."/home/index/$lang";?>"><img src="<?php echo $this->baseUrl;?>/Public/Img/H2O/im-ban-user.png">open the issue again</a>
+
+ <?php } ?>
+
+ <!--view details-->
+ <div class="show_hidden_box_ext">
+ <div class="md_type">issue</div>
+ <a id="<?php echo $row['issues']['id_issue'];?>" class="hidden_message_view_details" href="<?php echo $this->baseUrl."/home/index/$lang";?>">view details</a>
+ <div class="moderation_details_box"></div>
+ </div>
+
+ </div>
+ <?php } ?>
+
<div class="issues_view_title">
<?php echo $row['issues']['title'];?>
</div>
@@ -46,7 +71,7 @@
<div class="talk_message_item_date">
submitted by <?php echo getLinkToUser($u->getUser($row['issues']['created_by']));?>, <?php echo smartDate($row['issues']['creation_date']);?>
</div>
-
+
<div class="issues_view_status_and_priority">
<table>
<tr>