Index: trunk/extensions/FlaggedRevs/language/FlaggedRevs.i18n.php |
— | — | @@ -49,8 +49,8 @@ |
50 | 50 | 'review-diff2stable' => 'View changes between stable and current revisions', |
51 | 51 | 'review-logentry-app' => 'reviewed r$2 of [[$1]]', |
52 | 52 | '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', |
55 | 55 | 'review-logpage' => 'Review log', |
56 | 56 | 'review-logpagetext' => 'This is a log of changes to revisions\' [[{{MediaWiki:Validationpage}}|approval]] status for content pages. |
57 | 57 | 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 @@ |
914 | 914 | } else { // depreciated |
915 | 915 | $action = FlaggedRevs::isQuality($oldDims) ? 'unapprove2' : 'unapprove'; |
916 | 916 | } |
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) ); |
918 | 920 | } |
919 | 921 | } |
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php |
— | — | @@ -1421,21 +1421,29 @@ |
1422 | 1422 | * @return bool true |
1423 | 1423 | */ |
1424 | 1424 | 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 | + } |
1425 | 1428 | $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 |
1429 | 1434 | # Load required messages |
1430 | 1435 | wfLoadExtensionMessages( 'FlaggedRevs' ); |
1431 | 1436 | # 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] ) { |
1433 | 1438 | $rv = '(' . $wgUser->getSkin()->makeKnownLinkObj( $title, wfMsgHtml('review-logentry-diff'), |
1434 | | - "oldid={$params[1]}&diff={$params[0]}") . ') '; |
| 1439 | + "oldid={$params[1]}&diff={$revId}") . ') '; |
1435 | 1440 | } else { |
1436 | 1441 | $rv = '(' . wfMsgHtml('review-logentry-diff') . ')'; |
1437 | 1442 | } |
| 1443 | + # Show diff from this revision |
| 1444 | + $ts = empty($params[2]) ? Revision::getTimestampFromId($title,$revId) : $params[2]; |
| 1445 | + $time = $wgLang->timeanddate( $ts ); |
1438 | 1446 | $rv .= ' (' . $wgUser->getSkin()->makeKnownLinkObj( $title, |
1439 | | - wfMsgHtml('review-logentry-id',$params[0]), |
| 1447 | + wfMsgHtml('review-logentry-id',$revId,$time), |
1440 | 1448 | "oldid={$params[0]}&diff=prev&diffonly=0") . ')'; |
1441 | 1449 | } |
1442 | 1450 | return true; |