Revision: 46171
Author: aaron
Date: 2009-01-24 22:50:28 +0000 (Sat, 24 Jan 2009)
Log Message:
-----------
(bug 17104) Remove [Mark as patrolled] link for already patrolled revisions
Modified Paths:
--------------
trunk/phase3/includes/Article.php
trunk/phase3/includes/diff/DifferenceEngine.php
Modified: trunk/phase3/includes/Article.php
===================================================================
--- trunk/phase3/includes/Article.php 2009-01-24 21:51:19 UTC (rev 46170)
+++ trunk/phase3/includes/Article.php 2009-01-24 22:50:28 UTC (rev 46171)
@@ -974,9 +974,15 @@
# Only diffs and new page links from RC give rcid params, so if
# we are just viewing the page normally with no rcid, try to
find it.
# This is more convenient for users.
- if( empty($rcid) && $this->mTitle->exists() &&
$this->mTitle->userCan('patrol') ) {
- $firstRev = $this->mTitle->getFirstRevision();
- $rcid = $firstRev ? $firstRev->isUnpatrolled() : 0;
+ if( $this->mTitle->exists() && $this->mTitle->userCan('patrol')
) {
+ if( empty($rcid) ) {
+ $firstRev = $this->mTitle->getFirstRevision();
+ $rcid = $firstRev ? $firstRev->isUnpatrolled()
: 0;
+ } else {
+ $rc = RecentChange::newFromId( $rcid );
+ // Already patrolled?
+ $rcid = is_object($rc) &&
!$rc->getAttribute('rc_patrolled') ? $rcid : 0;
+ }
}
# If we have been passed an &rcid= parameter, we want to give
the user a
# chance to mark this new article as patrolled.
Modified: trunk/phase3/includes/diff/DifferenceEngine.php
===================================================================
--- trunk/phase3/includes/diff/DifferenceEngine.php 2009-01-24 21:51:19 UTC
(rev 46170)
+++ trunk/phase3/includes/diff/DifferenceEngine.php 2009-01-24 22:50:28 UTC
(rev 46171)
@@ -168,6 +168,9 @@
// If we've been given an explicit change identifier,
use it; saves time
if( $this->mRcidMarkPatrolled ) {
$rcid = $this->mRcidMarkPatrolled;
+ $rc = RecentChange::newFromId( $rcid );
+ // Already patrolled?
+ $rcid = is_object($rc) &&
!$rc->getAttribute('rc_patrolled') ? $rcid : 0;
} else {
// Look for an unpatrolled change corresponding
to this diff
$db = wfGetDB( DB_SLAVE );
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs