Index: trunk/extensions/FlaggedRevs/dataclasses/FlaggedRevsStats.php |
— | — | @@ -202,7 +202,6 @@ |
203 | 203 | if ( FlaggedRevs::useOnlyIfProtected() ) { |
204 | 204 | return array( $aveRT, $medianRT, $rPerTable ); // disabled |
205 | 205 | } |
206 | | - $nowUnix = wfTimestamp( TS_UNIX ); // current time in UNIX TS |
207 | 206 | # Only go so far back...otherwise we will get garbage values due to |
208 | 207 | # the fact that FlaggedRevs wasn't enabled until after a while. |
209 | 208 | $dbr = wfGetDB( DB_SLAVE ); |
— | — | @@ -327,8 +326,8 @@ |
328 | 327 | $secondsR = 0; // total wait seconds for edits later reviewed |
329 | 328 | $secondsP = 0; // total wait seconds for edits still pending |
330 | 329 | $aveRT = $medianRT = 0; |
| 330 | + $times = array(); |
331 | 331 | if ( $dbr->numRows( $res ) ) { |
332 | | - $times = array(); |
333 | 332 | # Get the elapsed times revs were pending (flagged time - edit time) |
334 | 333 | foreach ( $res as $row ) { |
335 | 334 | $time = wfTimestamp(TS_UNIX,$row->nft) - wfTimestamp(TS_UNIX,$row->rt); |
Index: trunk/extensions/FlaggedRevs/business/RevisionReviewForm.php |
— | — | @@ -4,7 +4,8 @@ |
5 | 5 | */ |
6 | 6 | class RevisionReviewForm extends FRGenericSubmitForm { |
7 | 7 | /* Form parameters which can be user given */ |
8 | | - protected $page = null; # Target page obj |
| 8 | + protected $page = null; # Target Title obj |
| 9 | + protected $article = null; # Target Page obj |
9 | 10 | protected $approve = false; # Approval requested |
10 | 11 | protected $unapprove = false; # De-approval requested |
11 | 12 | protected $reject = false; # Rejection requested |
— | — | @@ -258,7 +259,7 @@ |
259 | 260 | if ( $this->getAction() === 'approve' ) { |
260 | 261 | $rev = Revision::newFromTitle( $this->page, $this->oldid ); |
261 | 262 | # Check for archived/deleted revisions... |
262 | | - if ( !$rev || $rev->mDeleted ) { |
| 263 | + if ( !$rev || $rev->getVisibility() ) { |
263 | 264 | return 'review_bad_oldid'; |
264 | 265 | } |
265 | 266 | $oldFrev = FlaggedRevision::newFromTitle( $this->page, $this->oldid, FR_MASTER ); |
— | — | @@ -376,7 +377,7 @@ |
377 | 378 | } |
378 | 379 | |
379 | 380 | # The new review entry... |
380 | | - $flaggedRevision = new FlaggedRevision( array( |
| 381 | + $flaggedRevision = new FlaggedRevision( array( |
381 | 382 | 'rev' => $rev, |
382 | 383 | 'user_id' => $this->user->getId(), |
383 | 384 | 'timestamp' => wfTimestampNow(), |
— | — | @@ -416,8 +417,8 @@ |
417 | 418 | $this->newLastChangeTime = $flaggedRevision->getTimestamp(); |
418 | 419 | |
419 | 420 | wfProfileOut( __METHOD__ ); |
420 | | - return true; |
421 | | - } |
| 421 | + return true; |
| 422 | + } |
422 | 423 | |
423 | 424 | /** |
424 | 425 | * @param FlaggedRevision $frev |
— | — | @@ -451,8 +452,8 @@ |
452 | 453 | $this->newLastChangeTime = ''; |
453 | 454 | |
454 | 455 | wfProfileOut( __METHOD__ ); |
455 | | - return true; |
456 | | - } |
| 456 | + return true; |
| 457 | + } |
457 | 458 | |
458 | 459 | /** |
459 | 460 | * Get a validation key from versioning metadata |
Index: trunk/extensions/FlaggedRevs/presentation/FlaggedRevsXML.php |
— | — | @@ -154,8 +154,9 @@ |
155 | 155 | * @return string, css color for this quality |
156 | 156 | */ |
157 | 157 | public static function getQualityColor( $quality ) { |
158 | | - if ( $quality === false ) |
| 158 | + if ( $quality === false ) { |
159 | 159 | return 'flaggedrevs-color-0'; |
| 160 | + } |
160 | 161 | switch( $quality ) { |
161 | 162 | case 2: |
162 | 163 | $css = 'flaggedrevs-color-3'; |
— | — | @@ -166,6 +167,8 @@ |
167 | 168 | case 0: |
168 | 169 | $css = 'flaggedrevs-color-1'; |
169 | 170 | break; |
| 171 | + default: |
| 172 | + $css = ''; |
170 | 173 | } |
171 | 174 | return $css; |
172 | 175 | } |
Index: trunk/extensions/FlaggedRevs/presentation/specialpages/reports/ProblemChanges_body.php |
— | — | @@ -19,6 +19,8 @@ |
20 | 20 | $catTitle = Title::newFromText( $category ); |
21 | 21 | $this->category = is_null( $catTitle ) ? '' : $catTitle->getText(); |
22 | 22 | $feedType = $wgRequest->getVal( 'feed' ); |
| 23 | + |
| 24 | + $incLimit = 0; |
23 | 25 | if ( $this->including() ) { |
24 | 26 | $incLimit = $this->parseParams( $par ); // apply non-URL params |
25 | 27 | } |
— | — | @@ -254,6 +256,7 @@ |
255 | 257 | * Get the tags of the revisions of a page after a certain rev |
256 | 258 | * @param integer $pageId, page ID |
257 | 259 | * @param integer $revId, rev ID |
| 260 | + * @return Array |
258 | 261 | */ |
259 | 262 | protected static function getRevisionTags( $pageId, $revId ) { |
260 | 263 | $tags = array(); |
Index: trunk/extensions/FlaggedRevs/presentation/modules/review.js |
— | — | @@ -24,7 +24,7 @@ |
25 | 25 | var somezero = false; |
26 | 26 | |
27 | 27 | // Determine if this is a "quality" or "incomplete" review |
28 | | - for( tag in wgFlaggedRevsParams.tags ) { |
| 28 | + for( var tag in wgFlaggedRevsParams.tags ) { |
29 | 29 | var controlName = "wp" + tag; |
30 | 30 | var levels = document.getElementsByName(controlName); |
31 | 31 | if( !levels.length ) continue; |
— | — | @@ -33,7 +33,7 @@ |
34 | 34 | if( levels[0].nodeName == 'SELECT' ) { |
35 | 35 | selectedlevel = levels[0].selectedIndex; |
36 | 36 | } else if( levels[0].type == 'radio' ) { |
37 | | - for( i = 0; i < levels.length; i++ ) { |
| 37 | + for( var i = 0; i < levels.length; i++ ) { |
38 | 38 | if( levels[i].checked ) { |
39 | 39 | selectedlevel = i; |
40 | 40 | break; |
— | — | @@ -46,7 +46,7 @@ |
47 | 47 | } |
48 | 48 | |
49 | 49 | // Get quality level for this tag |
50 | | - qualityLevel = wgFlaggedRevsParams.tags[tag]['quality']; |
| 50 | + var qualityLevel = wgFlaggedRevsParams.tags[tag]['quality']; |
51 | 51 | |
52 | 52 | if( selectedlevel < qualityLevel ) { |
53 | 53 | quality = false; // not a quality review |
— | — | @@ -72,12 +72,12 @@ |
73 | 73 | * Update <select> color for the selected item |
74 | 74 | */ |
75 | 75 | 'updateRatingFormColors': function() { |
76 | | - for( tag in wgFlaggedRevsParams.tags ) { |
| 76 | + for( var tag in wgFlaggedRevsParams.tags ) { |
77 | 77 | var controlName = "wp" + tag; |
78 | 78 | var levels = document.getElementsByName(controlName); |
79 | 79 | if( levels.length && levels[0].nodeName == 'SELECT' ) { |
80 | | - selectedlevel = levels[0].selectedIndex; |
81 | | - value = levels[0].getElementsByTagName('option')[selectedlevel].value; |
| 80 | + var selectedlevel = levels[0].selectedIndex; |
| 81 | + var value = levels[0].getElementsByTagName('option')[selectedlevel].value; |
82 | 82 | levels[0].className = 'fr-rating-option-' + value; |
83 | 83 | // Fix FF one-time jitter bug of changing an <option> |
84 | 84 | levels[0].selectedIndex = null; |
— | — | @@ -203,7 +203,7 @@ |
204 | 204 | } |
205 | 205 | } |
206 | 206 | // Send encoded function plus all arguments... |
207 | | - post_data = 'action=ajax&rs=RevisionReview::AjaxReview'; |
| 207 | + var post_data = 'action=ajax&rs=RevisionReview::AjaxReview'; |
208 | 208 | for( var i=0; i<requestArgs.length; i++ ) { |
209 | 209 | post_data += '&rsargs[]=' + encodeURIComponent( requestArgs[i] ); |
210 | 210 | } |
— | — | @@ -272,7 +272,7 @@ |
273 | 273 | requestArgs.push( diffUIParams.getElementsByTagName('input')[0].value ); |
274 | 274 | requestArgs.push( diffUIParams.getElementsByTagName('input')[1].value ); |
275 | 275 | // Send encoded function plus all arguments... |
276 | | - url_pars = '?action=ajax&rs=FlaggedPageView::AjaxBuildDiffHeaderItems'; |
| 276 | + var url_pars = '?action=ajax&rs=FlaggedPageView::AjaxBuildDiffHeaderItems'; |
277 | 277 | for( var i=0; i<requestArgs.length; i++ ) { |
278 | 278 | url_pars += '&rsargs[]=' + encodeURIComponent(requestArgs[i]); |
279 | 279 | } |
— | — | @@ -349,7 +349,7 @@ |
350 | 350 | // Build notice to say that user is advertising... |
351 | 351 | var msgkey = $('#mw-fr-input-refid').length |
352 | 352 | ? 'revreview-adv-reviewing-c' // diff |
353 | | - : 'revreview-adv-reviewing-p' // page |
| 353 | + : 'revreview-adv-reviewing-p'; // page |
354 | 354 | var $underReview = $( |
355 | 355 | '<span class="fr-under-review">' + mw.message( msgkey ).escaped() + '</span>' ); |
356 | 356 | // Update notice to say that user is advertising... |
— | — | @@ -375,7 +375,7 @@ |
376 | 376 | // Build notice to say that user is not advertising... |
377 | 377 | var msgkey = $('#mw-fr-input-refid').length |
378 | 378 | ? 'revreview-sadv-reviewing-c' // diff |
379 | | - : 'revreview-sadv-reviewing-p' // page |
| 379 | + : 'revreview-sadv-reviewing-p'; // page |
380 | 380 | var $underReview = $( |
381 | 381 | '<span class="fr-make-under-review">' + |
382 | 382 | mw.message( msgkey ) |