From 6feff147f42d74874c4347e5e19f29bf5a568ca7 Mon Sep 17 00:00:00 2001 From: Antonio Gallo Date: Tue, 4 Oct 2011 19:40:28 +0000 Subject: moderators can now hide/show issues --- .../Application/Controllers/HistoryController.php | 52 ++- .../Application/Controllers/IssuesController.php | 4 +- h-source/Application/Include/languages.php | 1 + h-source/Application/Include/myFunctions.php | 3 + h-source/Application/Views/Issues/view.php | 374 +++++++++++---------- 5 files changed, 252 insertions(+), 182 deletions(-) (limited to 'h-source/Application') 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 @@ ?> - +
- + - - - - -
- - This issue is opened - - ">close the issue - - - This issue is closed - - ">open the issue again - - - - -
-
issue
- ">view details -
-
- -
- - -
- -
- -
- -
- submitted by getUser($row['issues']['created_by']));?>, -
- -
- - - - - - - - - - - - - -
:
:
:
-
- -
- : -
- -
- -
- - - -
- Response message (from h-node.com): -
- -
- -
- + + + + + +
+ + This issue is opened + + ">close the issue + + + This issue is closed + + ">open the issue again + - - -
- -
-
- : + + + ">hide the issue + + +
This issue is hidden for all the users that are not moderators
+ + ">show the issue + + + + +
+
issue
+ ">view details +
+
+
- - - - - -
-
-
- getUser($row['messages']['created_by']);?>: -
- - ">hide - - -
- -
- + + +
+ +
+ +
+ +
+ submitted by getUser($row['issues']['created_by']));?>, +
+ +
+ + + + + + + + + + + + + +
:
:
:
+
+ +
+ : +
+ +
+ +
+ + + +
+ Response message (from h-node.com):
-
- submitted by getUser($row['messages']['created_by']));?>, + +
+
- - - -
-
message
- ">view details -
+ + + + +
+ + +
+
+ : +
+ + + + + +
+
+
+ getUser($row['messages']['created_by']);?>: +
+ + ">hide + +
- - -
- - - - - -
- - - ">make visible - + +
+ +
+
+ submitted by getUser($row['messages']['created_by']));?>, +
+ +
message
- ">view details - -
-
-
- submitted by getUser($row['messages']['created_by']));?>, -
-
- +
+
+ + +
+ + + + + +
+ + + ">make visible + + +
+
message
+ + ">view details + +
+
+
+ submitted by getUser($row['messages']['created_by']));?>, +
+
+ +
+
-
-
-
+
+ + - - - - - .. - - -
- - - -
-
- -
- - - - - -
- : -
-
-
- -
-
+ + .. - - +
- + + + + +
+
+ +
+ + + + + +
+ : +
+
+
+ +
+
+ + + +
+ + + + + + + - - - + +
+ +
-
\ No newline at end of file -- cgit v1.2.3