Index: trunk/extensions/ArticleFeedbackv5/ArticleFeedbackv5.i18n.php |
— | — | @@ -61,6 +61,7 @@ |
62 | 62 | 'articlefeedbackv5-special-filter-abusive' => 'Abusive ($1)', |
63 | 63 | 'articlefeedbackv5-special-filter-helpful' => 'Helpful ($1)', |
64 | 64 | 'articlefeedbackv5-special-filter-unhelpful' => 'Unhelpful ($1)', |
| 65 | + 'articlefeedbackv5-special-filter-needsoversight' => ' Oversight requested ($1)', |
65 | 66 | 'articlefeedbackv5-special-filter-visible' => 'Visible ($1)', |
66 | 67 | 'articlefeedbackv5-special-filter-invisible' => 'Hidden ($1)', |
67 | 68 | 'articlefeedbackv5-special-filter-deleted' => 'Deleted ($1)', |
— | — | @@ -80,12 +81,14 @@ |
81 | 82 | 'articlefeedbackv5-special-pagetitle' => 'Feedback: $1', |
82 | 83 | |
83 | 84 | 'articlefeedbackv5-form-optionid' => 'Option $1', |
| 85 | + 'articlefeedbackv5-hidden' => 'Hidden', |
84 | 86 | 'articlefeedbackv5-form-hide' => 'Hide this post ($1)', |
85 | 87 | 'articlefeedbackv5-form-unhide' => 'Show this post', |
86 | 88 | 'articlefeedbackv5-form-helpful' => 'Mark as helpful ($1)', |
87 | 89 | 'articlefeedbackv5-form-abuse' => 'Flag as abuse ($1)', |
88 | 90 | 'articlefeedbackv5-form-delete' => 'Delete', |
89 | | - 'articlefeedbackv5-form-oversight' => 'Mark for oversight', |
| 91 | + 'articlefeedbackv5-form-oversight' => 'Request oversight', |
| 92 | + 'articlefeedbackv5-form-unoversight' => 'Unmark for oversight', |
90 | 93 | 'articlefeedbackv5-form-undelete' => 'Show this post', |
91 | 94 | 'articlefeedbackv5-form-header' => 'Feedback #$1, at $2', |
92 | 95 | 'articlefeedbackv5-form1-header-found' => '{{GENDER:$1|$1}} found what they were looking for:', |
— | — | @@ -107,6 +110,7 @@ |
108 | 111 | 'articlefeedbackv5-unhide-saved' => 'Feedback shown', |
109 | 112 | 'articlefeedbackv5-undelete-saved' => 'Feedback shown', |
110 | 113 | 'articlefeedbackv5-oversight-saved' => 'Marked for oversight', |
| 114 | + 'articlefeedbackv5-unoversight-saved' => 'Oversight flag removed', |
111 | 115 | 'articlefeedbackv5-error-loading-feedback' => 'Error loading feedback', |
112 | 116 | 'articlefeedbackv5-invalid-feedback-id' => 'Invalid feedback ID', |
113 | 117 | 'articlefeedbackv5-invalid-feedback-flag' => 'Invalid feedback flag', |
Index: trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.special.js |
— | — | @@ -140,12 +140,12 @@ |
141 | 141 | return false; |
142 | 142 | } ); |
143 | 143 | |
144 | | - $.each( ['unhide', 'undelete', 'oversight', 'hide', 'abuse', 'delete', 'helpful', 'unhelpful'], |
| 144 | + $.each( ['unhide', 'undelete', 'oversight', 'hide', 'abuse', 'delete', 'helpful', 'unhelpful', 'unoversight'], |
145 | 145 | function ( index, value ) { |
146 | 146 | $( '.articleFeedbackv5-' + value + '-link' ).live( 'click', function( e ) { |
147 | 147 | $.articleFeedbackv5special.flagFeedback( $.articleFeedbackv5special.stripID( this, 'articleFeedbackv5-' + value + '-link-' ), value ); |
148 | | - }) |
149 | | - }); |
| 148 | + } ) |
| 149 | + } ); |
150 | 150 | } |
151 | 151 | |
152 | 152 | // }}} |
Index: trunk/extensions/ArticleFeedbackv5/api/ApiFlagFeedbackArticleFeedbackv5.php |
— | — | @@ -51,7 +51,7 @@ |
52 | 52 | $update[] = 'af_needs_oversight = FALSE'; |
53 | 53 | } elseif( $params['flagtype'] == 'oversight' ) { |
54 | 54 | // flag for oversight |
55 | | - $update[] = 'af_oversight = TRUE'; |
| 55 | + $update[] = 'af_needs_oversight = TRUE'; |
56 | 56 | } elseif( in_array( $params['flagtype'], $flags ) ) { |
57 | 57 | // Probably this doesn't need validation, since the API |
58 | 58 | // will handle it, but if it's getting interpolated into |
— | — | @@ -182,7 +182,7 @@ |
183 | 183 | ApiBase::PARAM_REQUIRED => true, |
184 | 184 | ApiBase::PARAM_ISMULTI => false, |
185 | 185 | ApiBase::PARAM_TYPE => array( |
186 | | - 'abuse', 'hide', 'helpful', 'unhelpful', 'delete', 'undelete', 'unhide', 'oversight' ) |
| 186 | + 'abuse', 'hide', 'helpful', 'unhelpful', 'delete', 'undelete', 'unhide', 'oversight', 'unoversight' ) |
187 | 187 | ), |
188 | 188 | ); |
189 | 189 | } |
Index: trunk/extensions/ArticleFeedbackv5/api/ApiViewFeedbackArticleFeedbackv5.php |
— | — | @@ -156,7 +156,8 @@ |
157 | 157 | 'aa_response_rating', 'aa_response_option_id', |
158 | 158 | 'afi_data_type', 'af_created', 'user_name', |
159 | 159 | 'af_user_ip', 'af_hide_count', 'af_abuse_count', |
160 | | - 'af_helpful_count', 'af_unhelpful_count', 'af_delete_count', |
| 160 | + 'af_helpful_count', 'af_unhelpful_count', |
| 161 | + 'af_delete_count', 'af_needs_oversight', |
161 | 162 | '(SELECT COUNT(*) FROM revision WHERE rev_id > af_revision_id AND rev_page = '.( integer ) $pageId.') AS age', |
162 | 163 | 'CONVERT(af_helpful_count, SIGNED) - CONVERT(af_unhelpful_count, SIGNED) AS net_helpfulness', |
163 | 164 | 'page_latest', 'af_revision_id', 'page_title' |
— | — | @@ -222,9 +223,12 @@ |
223 | 224 | } |
224 | 225 | |
225 | 226 | switch( $filter ) { |
| 227 | + case 'needsoversight': |
| 228 | + $where[] = 'af_needs_oversight IS TRUE'; |
| 229 | + break; |
226 | 230 | case 'id': |
227 | 231 | # Used for permalinks. |
228 | | - $where[ 'af_id' ] = $filterValue; |
| 232 | + $where['af_id'] = $filterValue; |
229 | 233 | break; |
230 | 234 | case 'all': |
231 | 235 | # relies on the above to handler filtering, |
— | — | @@ -368,6 +372,7 @@ |
369 | 373 | if( $record[0]->af_hide_count > 0 ) { |
370 | 374 | # unhide |
371 | 375 | $link = 'unhide'; |
| 376 | + $tools .= Html::element( 'li', array(), wfMessage( 'articlefeedbackv5-hidden' ) ); |
372 | 377 | } |
373 | 378 | $tools .= Html::rawElement( 'li', array(), Html::element( 'a', array( |
374 | 379 | 'id' => "articleFeedbackv5-$link-link-$id", |
— | — | @@ -375,28 +380,38 @@ |
376 | 381 | ), wfMessage( "articlefeedbackv5-form-$link", $record[0]->af_hide_count )->text() ) ); |
377 | 382 | } |
378 | 383 | |
379 | | - # TODO: a third link, to remove oversight flag |
380 | 384 | if( $can_delete ) { |
381 | 385 | # delete |
382 | 386 | $link = 'delete'; |
383 | 387 | if( $record[0]->af_delete_count > 0 ) { |
384 | | - # undelete |
385 | 388 | $link = 'undelete'; |
386 | 389 | } |
387 | | -# } else { |
388 | | -# if( $record[0]->af_needs_oversight ) { |
389 | | -# # TODO: already flagged |
390 | | -# $link = 'oversight'; |
391 | | -# } |
392 | | -# # flag for oversight |
393 | | -# $link = 'oversight'; |
| 390 | + $tools .= Html::rawElement( 'li', array(), Html::element( 'a', array( |
| 391 | + 'id' => "articleFeedbackv5-$link-link-$id", |
| 392 | + 'class' => "articleFeedbackv5-$link-link" |
| 393 | + ), wfMessage( "articlefeedbackv5-form-$link", $record[0]->af_delete_count )->text() ) ); |
394 | 394 | } |
395 | 395 | |
396 | | - $tools .= Html::rawElement( 'li', array(), Html::element( 'a', array( |
397 | | - 'id' => "articleFeedbackv5-$link-link-$id", |
398 | | - 'class' => "articleFeedbackv5-$link-link" |
399 | | - ), wfMessage( "articlefeedbackv5-form-$link", $record[0]->af_delete_count )->text() ) ) |
400 | | - . Html::closeElement( 'ul' ) |
| 396 | + $link = null; |
| 397 | + if( $record[0]->af_needs_oversight ) { |
| 398 | + if( $can_delete ) { |
| 399 | + $link = 'unoversight'; |
| 400 | + } else { |
| 401 | + $link = 'oversighted'; |
| 402 | + } |
| 403 | + } elseif( $can_hide ) { |
| 404 | + # flag for oversight |
| 405 | + $link = 'oversight'; |
| 406 | + } |
| 407 | + |
| 408 | + if( $link ) { |
| 409 | + $tools .= Html::rawElement( 'li', array(), Html::element( 'a', array( |
| 410 | + 'id' => "articleFeedbackv5-$link-link-$id", |
| 411 | + 'class' => "articleFeedbackv5-$link-link" |
| 412 | + ), wfMessage( "articlefeedbackv5-form-$link", $record[0]->af_delete_count )->text() ) ); |
| 413 | + } |
| 414 | + |
| 415 | + $tools .= Html::closeElement( 'ul' ) |
401 | 416 | . Html::closeElement( 'div' ); |
402 | 417 | } |
403 | 418 | |
— | — | @@ -555,7 +570,7 @@ |
556 | 571 | ApiBase::PARAM_REQUIRED => false, |
557 | 572 | ApiBase::PARAM_ISMULTI => false, |
558 | 573 | ApiBase::PARAM_TYPE => array( |
559 | | - 'all', 'invisible', 'visible', 'comment', 'id', 'helpful', 'unhelpful', 'abusive', 'deleted' ) |
| 574 | + 'all', 'invisible', 'visible', 'comment', 'id', 'helpful', 'unhelpful', 'abusive', 'deleted', 'needsoversight' ) |
560 | 575 | ), |
561 | 576 | 'filtervalue' => array( |
562 | 577 | ApiBase::PARAM_REQUIRED => false, |
Index: trunk/extensions/ArticleFeedbackv5/SpecialArticleFeedbackv5.php |
— | — | @@ -41,7 +41,7 @@ |
42 | 42 | |
43 | 43 | if( $wgUser->isAllowed( 'aftv5-see-hidden-feedback' ) ) { |
44 | 44 | array_push( $this->filters, |
45 | | - 'invisible', 'unhelpful', 'abusive' |
| 45 | + 'invisible', 'unhelpful', 'abusive', 'needsoversight' |
46 | 46 | ); |
47 | 47 | } |
48 | 48 | |
Index: trunk/extensions/ArticleFeedbackv5/ArticleFeedbackv5.hooks.php |
— | — | @@ -167,12 +167,14 @@ |
168 | 168 | 'articlefeedbackv5-invalid-feedback-flag', |
169 | 169 | 'articlefeedbackv5-abuse-saved', |
170 | 170 | 'articlefeedbackv5-hide-saved', |
| 171 | + 'articlefeedbackv5-hidden', |
171 | 172 | 'articlefeedbackv5-delete-saved', |
172 | 173 | 'articlefeedbackv5-helpful-saved', |
173 | 174 | 'articlefeedbackv5-unhelpful-saved', |
174 | 175 | 'articlefeedbackv5-unhide-saved', |
175 | 176 | 'articlefeedbackv5-undelete-saved', |
176 | 177 | 'articlefeedbackv5-oversight-saved', |
| 178 | + 'articlefeedbackv5-unoversight-saved', |
177 | 179 | 'articlefeedbackv5-comment-link', |
178 | 180 | 'articlefeedbackv5-special-sort-asc', |
179 | 181 | 'articlefeedbackv5-special-sort-desc' |