diff options
author | Antonio Gallo <tonicucoz@gmail.com> | 2011-10-04 19:40:28 +0000 |
---|---|---|
committer | Antonio Gallo <tonicucoz@gmail.com> | 2011-10-04 19:40:28 +0000 |
commit | 6feff147f42d74874c4347e5e19f29bf5a568ca7 (patch) | |
tree | e9c03002a6293b491a1825bd0619114a1b864c30 /h-source/Application | |
parent | 2f0587286b4e433b96a7db5db60a0dd94617f485 (diff) |
moderators can now hide/show issues
Diffstat (limited to 'h-source/Application')
-rw-r--r-- | h-source/Application/Controllers/HistoryController.php | 52 | ||||
-rw-r--r-- | h-source/Application/Controllers/IssuesController.php | 4 | ||||
-rw-r--r-- | h-source/Application/Include/languages.php | 1 | ||||
-rw-r--r-- | h-source/Application/Include/myFunctions.php | 3 | ||||
-rw-r--r-- | h-source/Application/Views/Issues/view.php | 374 |
5 files changed, 252 insertions, 182 deletions
diff --git a/h-source/Application/Controllers/HistoryController.php b/h-source/Application/Controllers/HistoryController.php index 8c14bb0..ad2c7dd 100644 --- a/h-source/Application/Controllers/HistoryController.php +++ b/h-source/Application/Controllers/HistoryController.php @@ -34,6 +34,7 @@ class HistoryController extends BaseController 'device' => 'device page', 'device_app' => 'device page', 'device_cl' => 'device page', + 'issue_del' => 'issue', ); public static $actionTable = array( @@ -51,6 +52,8 @@ class HistoryController extends BaseController 'deviceshow' => 'show', 'deviceapprove' => 'approve', 'deviceclear' => 'perm deleted', + 'issuehide' => 'hide', + 'issueshow' => 'show', ); protected $strings = array( @@ -155,6 +158,26 @@ class HistoryController extends BaseController ), + 'issuehide' => array( + + 'action' => 'issuehide', + 'check_status' => 'no', + 'to_status' => 'yes', + 'exec_string' => 'The issue has been hidden. Just reload the page', + 'error_string' => 'Error: the issue is already hidden', + + ), + + 'issueshow' => array( + + 'action' => 'issueshow', + 'check_status' => 'yes', + 'to_status' => 'no', + 'exec_string' => 'The issue is no more hidden. Just reload the page', + 'error_string' => 'Error: the issue is already visible', + + ), + 'devicehide' => array( 'action' => 'devicehide', @@ -212,7 +235,7 @@ class HistoryController extends BaseController 'group' => 'moderator', ), - + 'talk' => array( 'clean_type' => 'talk', @@ -243,6 +266,7 @@ class HistoryController extends BaseController 'field_name' => 'status', 'actions' => array('open','close'), 'group' => 'moderator', + 'types_to_show' => 'issue,issue_del', ), @@ -269,7 +293,7 @@ class HistoryController extends BaseController ), - //page deleted or not + //page hidden or not 'page_del' => array( 'clean_type' => 'page_del', @@ -281,6 +305,18 @@ class HistoryController extends BaseController ), + //issue hidden or not + 'issue_del' => array( + + 'clean_type' => 'issue_del', + 'model_name' => 'IssuesModel', + 'id_name' => 'id_issue', + 'field_name' => 'deleted', + 'actions' => array('issuehide','issueshow'), + 'group' => 'moderator', + + ), + //device page blocked or not 'device' => array( @@ -397,6 +433,16 @@ class HistoryController extends BaseController { $this->generic($lang, $token, 'deviceclear'); } + + public function issuehide($lang = 'en', $token = '') + { + $this->generic($lang, $token, 'issuehide'); + } + + public function issueshow($lang = 'en', $token = '') + { + $this->generic($lang, $token, 'issueshow'); + } protected function generic($lang = 'en', $token = '', $action = 'hide') { @@ -580,6 +626,8 @@ class HistoryController extends BaseController 'deviceshow' => 'restored', 'deviceapprove' => 'approved', 'deviceclear' => 'permanently deleted', + 'issuehide' => 'hidden', + 'issueshow' => 'restored', ); $this->append($data); diff --git a/h-source/Application/Controllers/IssuesController.php b/h-source/Application/Controllers/IssuesController.php index 1e0555d..274bc56 100644 --- a/h-source/Application/Controllers/IssuesController.php +++ b/h-source/Application/Controllers/IssuesController.php @@ -171,10 +171,10 @@ class IssuesController extends BaseController $data['form'] = $this->m['MessagesModel']->form->render($values); //retrieve the values from the table - $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(); + $data['table'] = $this->m['IssuesModel']->select()->where(array('id_issue'=>$clean['id_issue']))->send(); // javascript for moderator - $data['md_javascript'] = "moderator_dialog(\"hide\",\"message\");moderator_dialog(\"show\",\"message\");moderator_dialog(\"open\",\"issue\");moderator_dialog(\"close\",\"issue\");"; + $data['md_javascript'] = "moderator_dialog(\"hide\",\"message\");moderator_dialog(\"show\",\"message\");moderator_dialog(\"open\",\"issue\");moderator_dialog(\"close\",\"issue\");moderator_dialog(\"issuehide\",\"issue_del\");moderator_dialog(\"issueshow\",\"issue_del\");"; $data['go_to'] = $this->currPage."/".$this->lang."/".$clean['id_issue']; if (count($data['table']) > 0) diff --git a/h-source/Application/Include/languages.php b/h-source/Application/Include/languages.php index 89d116f..de36683 100644 --- a/h-source/Application/Include/languages.php +++ b/h-source/Application/Include/languages.php @@ -302,6 +302,7 @@ class Lang /*0254*/"There are no devices in the database with the vendorid:productid code specified by you." => "Non ci sono dispositivi nel database con il codice vendorid:productid da te specificato", /*0255*/"Would you like to add it to the database?" => "Vorresti inserirlo nel database?", /*0256*/"can free operating systems be installed?" => "possono essere installati sistemi operativi liberi?", + /*0257*/"This issue has been deleted" => "Questa questione รจ stata cancellata", ), 'es' => array ( diff --git a/h-source/Application/Include/myFunctions.php b/h-source/Application/Include/myFunctions.php index 5636240..7ac5705 100644 --- a/h-source/Application/Include/myFunctions.php +++ b/h-source/Application/Include/myFunctions.php @@ -537,6 +537,9 @@ function goToModeratedItem( $row = array() ) case 'issue': $url = 'issues/view/'.Lang::$current.'/'.$row['id']; break; + case 'issue_del': + $url = 'issues/view/'.Lang::$current.'/'.$row['id']; + break; case 'wiki_talk': $url = 'wiki/talk/'.Lang::$current.'/'.getWikiPageInfoFromTalkId($row['id']).'#wiki-talk-'.$row['id']; break; diff --git a/h-source/Application/Views/Issues/view.php b/h-source/Application/Views/Issues/view.php index 20344b8..cbedcde 100644 --- a/h-source/Application/Views/Issues/view.php +++ b/h-source/Application/Views/Issues/view.php @@ -21,211 +21,229 @@ ?> <script> - + $(document).ready(function() { - + $("#bb_code").markItUp(mySettings); - + }); - + </script> - + <div id="left"> - + <div class="position_tree_box"> <a href="<?php echo $this->baseUrl."/home/index/$lang";?>">Home</a> » <a href="<?php echo $this->baseUrl."/issues/viewall/$lang".$this->viewStatus;?>"><?php echo gtext("Issues");?></a> » <?php echo $id_issue;?> </div> - <?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/Glaze/folder_blue.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/Glaze/folder_blue_open.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_external_box"> - - <div class="issues_view_title"> - <?php echo $row['issues']['title'];?> - </div> - - <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> - <td><?php echo gtext("TOPIC");?>:</td> - <td><b><?php echo str_replace('-',' ',$row['issues']['topic']);?></b></td> - </tr> - <tr> - <td><?php echo gtext("STATUS");?>:</td> - <td><b><?php echo $row['issues']['status'];?></b></td> - </tr> - <tr> - <td><?php echo gtext("PRIORITY");?>:</td> - <td><b><?php echo $row['issues']['priority'];?></b></td> - </tr> - </table> - </div> - - <div class="issues_view_description_title"> - <?php echo gtext("Description");?>: - </div> - - <div class="issues_view_description"> - <?php echo decodeWikiText($row['issues']['message']);?> - </div> - - <?php if (strcmp($row['issues']['notice'],'') !== 0) { ?> - - <div class="issues_view_description_title"> - Response message (from h-node.com): - </div> - - <div class="issues_view_description"> - <?php echo decodeWikiText($row['issues']['notice']);?> - </div> - + <?php if (strcmp($table[0]['issues']['deleted'],'no') === 0 or $ismoderator) { ?> + <?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/Glaze/folder_blue.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/Glaze/folder_blue_open.png">open the issue again</a> + <?php } ?> - - <?php } ?> - </div> - <!--print the messages to this issue--> - <div class="issues_external_box"> - <div class="add_message_form_title"> - <?php echo gtext("Messages");?>: + <?php if (strcmp($row['issues']['deleted'],'no') == 0) { ?> + + <a id="<?php echo $row['issues']['id_issue'];;?>" class="issuehide_issue_del block_general" href="<?php echo $this->baseUrl."/home/index/$lang";?>"><img src="<?php echo $this->baseUrl;?>/Public/Img/Crystal/button_cancel.png">hide the issue</a> + + <?php } else { ?> + <div class="issue_hidden_notice">This issue is hidden for all the users that are not moderators</div> + + <a id="<?php echo $row['issues']['id_issue'];;?>" class="issueshow_issue_del block_general" href="<?php echo $this->baseUrl."/home/index/$lang";?>"><img src="<?php echo $this->baseUrl;?>/Public/Img/Crystal/button_ok.png">show the issue</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 - $mess_count = 0; - foreach ($messages as $row) { - $mess_count++; - ?> - - <?php if (strcmp($row['messages']['deleted'],'no') === 0) { ?> - - - <a name="message-<?php echo $row['messages']['id_mes'];?>"></a><div class="issues_message_item"> - <div class="issues_message_item_user"> - <div class="issues_message_item_user_inner"> - <?php echo $u->getUser($row['messages']['created_by']);?>: - </div> - <?php if ($ismoderator) { ?> - <a id="<?php echo $row['messages']['id_mes'];?>" class="hide_message hide_general" href="<?php echo $this->baseUrl."/home/index/$lang";?>"><img src="<?php echo $this->baseUrl;?>/Public/Img/Crystal/button_cancel.png">hide</a> - <?php } ?> - - </div> - - <div class="message_view_description"> - <?php echo decodeWikiText($row['messages']['message']);?> + <?php } ?> + + <div class="issues_external_box"> + + <div class="issues_view_title"> + <?php echo $row['issues']['title'];?> + </div> + + <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> + <td><?php echo gtext("TOPIC");?>:</td> + <td><b><?php echo str_replace('-',' ',$row['issues']['topic']);?></b></td> + </tr> + <tr> + <td><?php echo gtext("STATUS");?>:</td> + <td><b><?php echo $row['issues']['status'];?></b></td> + </tr> + <tr> + <td><?php echo gtext("PRIORITY");?>:</td> + <td><b><?php echo $row['issues']['priority'];?></b></td> + </tr> + </table> + </div> + + <div class="issues_view_description_title"> + <?php echo gtext("Description");?>: + </div> + + <div class="issues_view_description"> + <?php echo decodeWikiText($row['issues']['message']);?> + </div> + + <?php if (strcmp($row['issues']['notice'],'') !== 0) { ?> + + <div class="issues_view_description_title"> + Response message (from h-node.com): </div> - <div class="talk_message_item_date"> - submitted by <?php echo getLinkToUser($u->getUser($row['messages']['created_by']));?>, <?php echo smartDate($row['messages']['creation_date']);?> + + <div class="issues_view_description"> + <?php echo decodeWikiText($row['issues']['notice']);?> </div> - - <?php if ($ismoderator) { ?> - <!--view details--> - <div class="show_hidden_box_ext"> - <div class="md_type">message</div> - <a id="<?php echo $row['messages']['id_mes'];?>" class="hidden_message_view_details" href="<?php echo $this->baseUrl."/home/index/$lang";?>">view details</a> - <div class="moderation_details_box"></div> + + <?php } ?> + + <?php } ?> + </div> + + <!--print the messages to this issue--> + <div class="issues_external_box"> + <div class="add_message_form_title"> + <?php echo gtext("Messages");?>: + </div> + <?php + $mess_count = 0; + foreach ($messages as $row) { + $mess_count++; + ?> + + <?php if (strcmp($row['messages']['deleted'],'no') === 0) { ?> + + + <a name="message-<?php echo $row['messages']['id_mes'];?>"></a><div class="issues_message_item"> + <div class="issues_message_item_user"> + <div class="issues_message_item_user_inner"> + <?php echo $u->getUser($row['messages']['created_by']);?>: + </div> + <?php if ($ismoderator) { ?> + <a id="<?php echo $row['messages']['id_mes'];?>" class="hide_message hide_general" href="<?php echo $this->baseUrl."/home/index/$lang";?>"><img src="<?php echo $this->baseUrl;?>/Public/Img/Crystal/button_cancel.png">hide</a> + <?php } ?> + </div> - <?php } ?> - - </div> - - <?php } else { ?> - - <?php if ($ismoderator) { ?> - <a name="message-<?php echo $row['messages']['id_mes'];?>"></a> - <div class="issues_message_item_hidden"> - <?php echo gtext("this message has been deleted");?> - - <a id="<?php echo $row['messages']['id_mes'];?>" class="show_message hide_general" href="<?php echo $this->baseUrl."/home/index/$lang";?>"><img src="<?php echo $this->baseUrl;?>/Public/Img/Crystal/button_ok.png">make visible</a> - + + <div class="message_view_description"> + <?php echo decodeWikiText($row['messages']['message']);?> + </div> + <div class="talk_message_item_date"> + submitted by <?php echo getLinkToUser($u->getUser($row['messages']['created_by']));?>, <?php echo smartDate($row['messages']['creation_date']);?> + </div> + + <?php if ($ismoderator) { ?> <!--view details--> <div class="show_hidden_box_ext"> <div class="md_type">message</div> - <a id="<?php echo $row['messages']['id_mes'];?>" class="hidden_message_view_details" href="<?php echo $this->baseUrl."/home/index/$lang";?>">view details</a> - - <div class="details_of_hidden_message"> - <div class="details_of_hidden_message_inner"> - <div class="talk_message_item_date"> - submitted by <?php echo getLinkToUser($u->getUser($row['messages']['created_by']));?>, <?php echo smartDate($row['messages']['creation_date']);?> - </div> - <div class="message_view_description_hidden"> - <?php echo decodeWikiText($row['messages']['message']);?> + <div class="moderation_details_box"></div> + </div> + <?php } ?> + + </div> + + <?php } else { ?> + + <?php if ($ismoderator) { ?> + <a name="message-<?php echo $row['messages']['id_mes'];?>"></a> + <div class="issues_message_item_hidden"> + <?php echo gtext("this message has been deleted");?> + + <a id="<?php echo $row['messages']['id_mes'];?>" class="show_message hide_general" href="<?php echo $this->baseUrl."/home/index/$lang";?>"><img src="<?php echo $this->baseUrl;?>/Public/Img/Crystal/button_ok.png">make visible</a> + + <!--view details--> + <div class="show_hidden_box_ext"> + <div class="md_type">message</div> + + <a id="<?php echo $row['messages']['id_mes'];?>" class="hidden_message_view_details" href="<?php echo $this->baseUrl."/home/index/$lang";?>">view details</a> + + <div class="details_of_hidden_message"> + <div class="details_of_hidden_message_inner"> + <div class="talk_message_item_date"> + submitted by <?php echo getLinkToUser($u->getUser($row['messages']['created_by']));?>, <?php echo smartDate($row['messages']['creation_date']);?> + </div> + <div class="message_view_description_hidden"> + <?php echo decodeWikiText($row['messages']['message']);?> + </div> </div> + <div class="moderation_details_box"></div> </div> - <div class="moderation_details_box"></div> </div> - </div> - </div> + </div> + <?php } ?> <?php } ?> + <?php } ?> - - <?php } ?> - - <?php if ($mess_count === 0) { ?> - <?php echo gtext("there are no messages");?>.. - <?php } ?> - - </div> - <!--insert a message notice--> - <?php if ($islogged === 'yes') { ?> - - <div class="add_issue_form"> - <div class="add_message_form_title"> - <a name="form"><?php echo gtext("Add a message to this issue");?></a> - </div> - - <?php echo $notice;?> - - <!--preiview--> - <?php if (isset($preview_message)) { ?> - <div class="message_preview_notice"> - <?php echo gtext("preview of the message");?>: - </div> - <div class="issues_message_item_preview"> - <div class="message_view_description"> - <?php echo decodeWikiText($preview_message);?> - </div> - </div> + <?php if ($mess_count === 0) { ?> + <?php echo gtext("there are no messages");?>.. <?php } ?> - - <?php echo $form;?> + </div> - + + <!--insert a message notice--> + <?php if ($islogged === 'yes') { ?> + + <div class="add_issue_form"> + <div class="add_message_form_title"> + <a name="form"><?php echo gtext("Add a message to this issue");?></a> + </div> + + <?php echo $notice;?> + + <!--preiview--> + <?php if (isset($preview_message)) { ?> + <div class="message_preview_notice"> + <?php echo gtext("preview of the message");?>: + </div> + <div class="issues_message_item_preview"> + <div class="message_view_description"> + <?php echo decodeWikiText($preview_message);?> + </div> + </div> + <?php } ?> + + <?php echo $form;?> + </div> + + <?php } else { ?> + + <div class="talk_login_notice"> + <a name="form"><?php echo gtext("You have to");?> <a href="<?php echo $this->baseUrl."/users/login/$lang?redirect=".$currPos.$queryString;?>">login</a> <?php echo gtext("in order to submit a message to this issue");?></a> + </div> + + <?php } ?> + <?php } else { ?> - - <div class="talk_login_notice"> - <a name="form"><?php echo gtext("You have to");?> <a href="<?php echo $this->baseUrl."/users/login/$lang?redirect=".$currPos.$queryString;?>">login</a> <?php echo gtext("in order to submit a message to this issue");?></a> - </div> - + + <div style="margin:10px;"><?php echo gtext("This issue has been deleted"); ?></div> + <?php } ?> + </div> - </div>
\ No newline at end of file |