Property changes on: branches/wmf/1.16wmf4/extensions/FlaggedRevs/language |
___________________________________________________________________ |
Name: svn:mergeinfo |
1 | 1 | - /branches/REL1_15/phase3/extensions/FlaggedRevs_alpha/language:51646 |
/trunk/extensions/FlaggedRevs/language:63264-67411,68032-68057 |
/trunk/extensions/FlaggedRevs_alpha/language:56207,56209,56296,56333,56355 |
/trunk/phase3/extensions/FlaggedRevs_alpha/language:56213,56215-56216,56218,56325,56334-56336,56338,56340,56343,56345,56347,56350,57154-57447,57541,57916,58151,58219,58633,58816 |
2 | 2 | + /branches/REL1_15/phase3/extensions/FlaggedRevs_alpha/language:51646 |
/trunk/extensions/FlaggedRevs/language:63264-67411,68032-68057,68067 |
/trunk/extensions/FlaggedRevs_alpha/language:56207,56209,56296,56333,56355 |
/trunk/phase3/extensions/FlaggedRevs_alpha/language:56213,56215-56216,56218,56325,56334-56336,56338,56340,56343,56345,56347,56350,57154-57447,57541,57916,58151,58219,58633,58816 |
Index: branches/wmf/1.16wmf4/extensions/FlaggedRevs/FlaggedRevision.php |
— | — | @@ -409,6 +409,7 @@ |
410 | 410 | } |
411 | 411 | |
412 | 412 | /** |
| 413 | + * Get original template versions at time of review |
413 | 414 | * @return Array template versions (ns -> dbKey -> rev id) |
414 | 415 | */ |
415 | 416 | public function getTemplateVersions() { |
— | — | @@ -430,6 +431,7 @@ |
431 | 432 | } |
432 | 433 | |
433 | 434 | /** |
| 435 | + * Get original template versions at time of review |
434 | 436 | * @return Array file versions (dbKey -> sha1) |
435 | 437 | */ |
436 | 438 | public function getFileVersions() { |
— | — | @@ -449,12 +451,18 @@ |
450 | 452 | |
451 | 453 | /* |
452 | 454 | * Fetch pending template changes for this reviewed page version. |
453 | | - * For each template, the version used is newest( stable rev, rev at time of review ). |
| 455 | + * For each template, the version used is: |
| 456 | + * (a) (the latest rev) if FR_INCLUDES_CURRENT |
| 457 | + * (b) newest( stable rev, rev at time of review ) if FR_INCLUDES_STABLE |
| 458 | + * (c) ( rev at time of review ) if FR_INCLUDES_FREEZE |
454 | 459 | * Pending changes exist if the latest version of the template is newer than this. |
455 | 460 | * |
456 | 461 | * @return Array of (template title, rev ID in reviewed version) tuples |
457 | 462 | */ |
458 | 463 | public function findPendingTemplateChanges() { |
| 464 | + if ( FlaggedRevs::inclusionSetting() == FR_INCLUDES_CURRENT ) { |
| 465 | + return array(); // short-circuit |
| 466 | + } |
459 | 467 | $dbr = wfGetDB( DB_SLAVE ); |
460 | 468 | $ret = $dbr->select( array( 'flaggedtemplates', 'page', 'flaggedpages' ), |
461 | 469 | array( 'ft_namespace', 'ft_title', 'fp_stable', 'ft_tmp_rev_id', 'page_latest' ), |
— | — | @@ -470,8 +478,12 @@ |
471 | 479 | while ( $row = $dbr->fetchObject( $ret ) ) { |
472 | 480 | $title = Title::makeTitleSafe( $row->ft_namespace, $row->ft_title ); |
473 | 481 | $revIdDraft = (int)$row->page_latest; // may be NULL |
474 | | - # Select newest of (stable rev, rev when reviewed) when parsing |
475 | | - $revIdStable = max( $row->fp_stable, $row->ft_tmp_rev_id ); |
| 482 | + if ( FlaggedRevs::inclusionSetting() == FR_INCLUDES_STABLE ) { |
| 483 | + # Select newest of (stable rev, rev when reviewed) when parsing |
| 484 | + $revIdStable = max( $row->fp_stable, $row->ft_tmp_rev_id ); |
| 485 | + } else { |
| 486 | + $revIdStable = (int)$row->ft_tmp_rev_id; |
| 487 | + } |
476 | 488 | # Compare to current... |
477 | 489 | $deleted = ( !$revIdDraft && $revIdStable ); // later deleted |
478 | 490 | $updated = ( $revIdDraft && $revIdDraft > $revIdStable ); // updated/created |
— | — | @@ -484,13 +496,19 @@ |
485 | 497 | |
486 | 498 | /* |
487 | 499 | * Fetch pending file changes for this reviewed page version. |
488 | | - * For each file, the version used is newest( stable rev, rev at time of review ). |
| 500 | + * For each file, the version used is: |
| 501 | + * (a) (the latest rev) if FR_INCLUDES_CURRENT |
| 502 | + * (b) newest( stable rev, rev at time of review ) if FR_INCLUDES_STABLE |
| 503 | + * (c) ( rev at time of review ) if FR_INCLUDES_FREEZE |
489 | 504 | * Pending changes exist if the latest version of the file is newer than this. |
490 | 505 | * @TODO: skip commons images, deliberately? (bug 15748). |
491 | 506 | * |
492 | 507 | * @return Array of (file title, MW file timestamp in reviewed version) tuples |
493 | 508 | */ |
494 | 509 | public function findPendingFileChanges() { |
| 510 | + if ( FlaggedRevs::inclusionSetting() == FR_INCLUDES_CURRENT ) { |
| 511 | + return array(); // short-circuit |
| 512 | + } |
495 | 513 | $dbr = wfGetDB( DB_SLAVE ); |
496 | 514 | $ret = $dbr->select( |
497 | 515 | array( 'flaggedimages', 'page', 'flaggedpages', 'flaggedrevs' ), |
— | — | @@ -509,10 +527,14 @@ |
510 | 528 | while ( $row = $dbr->fetchObject( $ret ) ) { |
511 | 529 | $title = Title::makeTitleSafe( NS_FILE, $row->fi_name ); |
512 | 530 | $reviewedTS = trim( $row->fi_img_timestamp ); // may be ''/NULL |
513 | | - # Select newest of (stable rev, rev when reviewed) when parsing |
514 | | - $tsStable = $row->fr_img_timestamp >= $reviewedTS |
515 | | - ? $row->fr_img_timestamp |
516 | | - : $reviewedTS; |
| 531 | + if ( FlaggedRevs::inclusionSetting() == FR_INCLUDES_STABLE ) { |
| 532 | + # Select newest of (stable rev, rev when reviewed) when parsing |
| 533 | + $tsStable = $row->fr_img_timestamp >= $reviewedTS |
| 534 | + ? $row->fr_img_timestamp |
| 535 | + : $reviewedTS; |
| 536 | + } else { |
| 537 | + $tsStable = $reviewedTS; |
| 538 | + } |
517 | 539 | # Compare to current... |
518 | 540 | $file = wfFindFile( $title ); // current file version |
519 | 541 | $deleted = ( !$file && $tsStable ); // later deleted |
Index: branches/wmf/1.16wmf4/extensions/FlaggedRevs/FlaggedRevs.hooks.php |
— | — | @@ -1976,13 +1976,14 @@ |
1977 | 1977 | public static function addToChangeListLine( &$list, &$articlelink, &$s, RecentChange &$rc ) { |
1978 | 1978 | $title = $rc->getTitle(); // convenience |
1979 | 1979 | if ( !FlaggedRevs::inReviewNamespace( $title ) |
1980 | | - || empty( $rc->mAttribs['rc_this_oldid'] ) ) |
| 1980 | + || empty( $rc->mAttribs['rc_this_oldid'] ) |
| 1981 | + || !array_key_exists( 'fp_stable', $rc->mAttribs ) ) |
1981 | 1982 | { |
1982 | 1983 | return true; // confirm that page is in reviewable namespace |
1983 | 1984 | } |
1984 | 1985 | $rlink = ''; |
1985 | 1986 | // page is not reviewed |
1986 | | - if ( empty( $rc->mAttribs['fp_stable'] ) ) { |
| 1987 | + if ( $rc->mAttribs['fp_stable'] == null ) { |
1987 | 1988 | // Is this a config were pages start off reviewable? |
1988 | 1989 | if ( !FlaggedRevs::stableOnlyIfConfigured() ) { |
1989 | 1990 | $rlink = wfMsgHtml( 'revreview-unreviewedpage' ); |
Index: branches/wmf/1.16wmf4/extensions/FlaggedRevs/FlaggedArticleView.php |
— | — | @@ -549,7 +549,7 @@ |
550 | 550 | $parserOut = null; |
551 | 551 | } |
552 | 552 | } |
553 | | - $synced = $this->article->stableVersionIsSynced( $parserOut, null ); |
| 553 | + $synced = $this->article->stableVersionIsSynced(); |
554 | 554 | # Construct some tagging |
555 | 555 | if ( !$wgOut->isPrintable() && !( $this->article->lowProfileUI() && $synced ) ) { |
556 | 556 | $revsSince = $this->article->getPendingRevCount(); |
— | — | @@ -1540,7 +1540,7 @@ |
1541 | 1541 | */ |
1542 | 1542 | public function addReviewCheck( EditPage $editPage, array &$checkboxes, &$tabindex ) { |
1543 | 1543 | global $wgUser, $wgRequest; |
1544 | | - if ( !$wgUser->isAllowed( 'review' ) |
| 1544 | + if ( !$this->article->getTitle()->userCan( 'review' ) |
1545 | 1545 | || !$this->article->isReviewable() |
1546 | 1546 | || !$this->article->revsArePending() ) |
1547 | 1547 | { |
— | — | @@ -1548,25 +1548,22 @@ |
1549 | 1549 | } |
1550 | 1550 | $oldid = $wgRequest->getInt( 'baseRevId', $this->article->getLatest() ); |
1551 | 1551 | if ( $oldid == $this->article->getLatest() ) { |
1552 | | - $srev = $this->article->getStableRev(); |
1553 | 1552 | # For pages with either no stable version, or an outdated one, let |
1554 | 1553 | # the user decide if he/she wants it reviewed on the spot. One might |
1555 | 1554 | # do this if he/she just saw the diff-to-stable and *then* decided to edit. |
1556 | 1555 | # Note: check not shown when editing old revisions, which is confusing. |
1557 | | - if ( !$srev || $this->article->revsArePending() ) { |
1558 | | - $checkbox = Xml::check( |
1559 | | - 'wpReviewEdit', |
1560 | | - $wgRequest->getCheck( 'wpReviewEdit' ), |
1561 | | - array( 'tabindex' => ++$tabindex, 'id' => 'wpReviewEdit' ) |
1562 | | - ); |
1563 | | - $attribs = array( |
1564 | | - 'for' => 'wpReviewEdit', |
1565 | | - 'title' => wfMsg( 'revreview-check-flag-title' ) |
1566 | | - ); |
1567 | | - $label = Xml::element( 'label', $attribs, |
1568 | | - wfMsgExt( 'revreview-check-flag', 'parseinline' ) ); |
1569 | | - $checkboxes['reviewed'] = $checkbox . ' ' . $label; |
1570 | | - } |
| 1556 | + $checkbox = Xml::check( |
| 1557 | + 'wpReviewEdit', |
| 1558 | + $wgRequest->getCheck( 'wpReviewEdit' ), |
| 1559 | + array( 'tabindex' => ++$tabindex, 'id' => 'wpReviewEdit' ) |
| 1560 | + ); |
| 1561 | + $attribs = array( |
| 1562 | + 'for' => 'wpReviewEdit', |
| 1563 | + 'title' => wfMsg( 'revreview-check-flag-title' ) |
| 1564 | + ); |
| 1565 | + $label = Xml::element( 'label', $attribs, |
| 1566 | + wfMsgExt( 'revreview-check-flag', 'parseinline' ) ); |
| 1567 | + $checkboxes['reviewed'] = $checkbox . ' ' . $label; |
1571 | 1568 | } |
1572 | 1569 | return true; |
1573 | 1570 | } |
Property changes on: branches/wmf/1.16wmf4/extensions/FlaggedRevs |
___________________________________________________________________ |
Name: svn:mergeinfo |
1574 | 1571 | - /branches/REL1_15/phase3/extensions/FlaggedRevs_alpha:51646 |
/trunk/extensions/FlaggedRevs:63266-63443,63460-63926,63929,63938,63940-64497,64515-64768,64916-65417,65459-65601,65668-65727,65995,66185-66309,66345,66384-66669,66715-66978,67060-67291,68032-68057 |
/trunk/extensions/FlaggedRevs_alpha:56207,56209,56296,56333,56355 |
/trunk/phase3/extensions/FlaggedRevs_alpha:56213,56215-56216,56218,56325,56334-56336,56338,56340,56343,56345,56347,56350,57154-57447,57541,57916,58151,58219,58633,58816 |
1575 | 1572 | + /branches/REL1_15/phase3/extensions/FlaggedRevs_alpha:51646 |
/trunk/extensions/FlaggedRevs:63266-63443,63460-63926,63929,63938,63940-64497,64515-64768,64916-65417,65459-65601,65668-65727,65995,66185-66309,66345,66384-66669,66715-66978,67060-67291,68032-68057,68067 |
/trunk/extensions/FlaggedRevs_alpha:56207,56209,56296,56333,56355 |
/trunk/phase3/extensions/FlaggedRevs_alpha:56213,56215-56216,56218,56325,56334-56336,56338,56340,56343,56345,56347,56350,57154-57447,57541,57916,58151,58219,58633,58816 |