r57242 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r57241‎ | r57242 | r57243 >
Date:19:26, 1 October 2009
Author:aaron
Status:ok
Tags:
Comment:
bug 20861: add rev timestamp to review log
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/language/FlaggedRevs.i18n.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/RevisionReview_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/language/FlaggedRevs.i18n.php
@@ -49,8 +49,8 @@
5050 'review-diff2stable' => 'View changes between stable and current revisions',
5151 'review-logentry-app' => 'reviewed r$2 of [[$1]]',
5252 'review-logentry-dis' => 'deprecated r$2 of [[$1]]',
53 - 'review-logentry-id' => 'view',
54 - 'review-logentry-diff' => 'diff to stable',
 53+ 'review-logentry-id' => 'revision: $2',
 54+ 'review-logentry-diff' => 'changes to stable version',
5555 'review-logpage' => 'Review log',
5656 'review-logpagetext' => 'This is a log of changes to revisions\' [[{{MediaWiki:Validationpage}}|approval]] status for content pages.
5757 See the [[Special:ReviewedPages|reviewed pages list]] for a list of approved pages.',
Index: trunk/extensions/FlaggedRevs/specialpages/RevisionReview_body.php
@@ -913,6 +913,8 @@
914914 } else { // depreciated
915915 $action = FlaggedRevs::isQuality($oldDims) ? 'unapprove2' : 'unapprove';
916916 }
917 - $log->addEntry( $action, $title, $comment, array($revId,$stableId) );
 917+ $ts = Revision::getTimestampFromId( $title, $revId );
 918+ # Param format is <rev id,old stable id, rev timestamp>
 919+ $log->addEntry( $action, $title, $comment, array($revId,$stableId,$ts) );
918920 }
919921 }
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php
@@ -1421,21 +1421,29 @@
14221422 * @return bool true
14231423 */
14241424 public static function reviewLogLine( $type, $action, $title=null, $params=array(), &$comment, &$rv ) {
 1425+ if( $type != 'review' || !is_object($title) ) {
 1426+ return true; // for review log only
 1427+ }
14251428 $actionsValid = array('approve','approve2','approve-a','approve2-a','unapprove','unapprove2');
1426 - # Show link to page with oldid=x
1427 - if( $type == 'review' && is_object($title) && in_array($action,$actionsValid) && isset($params[0]) ) {
1428 - global $wgUser;
 1429+ # Show link to page with oldid=x as well as the diff to the former stable rev.
 1430+ # Param format is <rev id, last stable id, rev timestamp>.
 1431+ if( in_array($action,$actionsValid) && isset($params[0]) ) {
 1432+ global $wgUser, $wgLang;
 1433+ $revId = (int)$params[0]; // the reviewed revision
14291434 # Load required messages
14301435 wfLoadExtensionMessages( 'FlaggedRevs' );
14311436 # Don't show diff if param missing or rev IDs are the same
1432 - if( !empty($params[1]) && $params[0] != $params[1] ) {
 1437+ if( !empty($params[1]) && $revId != $params[1] ) {
14331438 $rv = '(' . $wgUser->getSkin()->makeKnownLinkObj( $title, wfMsgHtml('review-logentry-diff'),
1434 - "oldid={$params[1]}&diff={$params[0]}") . ') ';
 1439+ "oldid={$params[1]}&diff={$revId}") . ') ';
14351440 } else {
14361441 $rv = '(' . wfMsgHtml('review-logentry-diff') . ')';
14371442 }
 1443+ # Show diff from this revision
 1444+ $ts = empty($params[2]) ? Revision::getTimestampFromId($title,$revId) : $params[2];
 1445+ $time = $wgLang->timeanddate( $ts );
14381446 $rv .= ' (' . $wgUser->getSkin()->makeKnownLinkObj( $title,
1439 - wfMsgHtml('review-logentry-id',$params[0]),
 1447+ wfMsgHtml('review-logentry-id',$revId,$time),
14401448 "oldid={$params[0]}&diff=prev&diffonly=0") . ')';
14411449 }
14421450 return true;

Status & tagging log