Index: trunk/extensions/CodeReview/CodeRevision.php |
— | — | @@ -324,20 +324,22 @@ |
325 | 325 | |
326 | 326 | public function getPropChanges() { |
327 | 327 | $dbr = wfGetDB( DB_SLAVE ); |
328 | | - $result = $dbr->select( 'code_prop_changes', |
| 328 | + $result = $dbr->select( array('code_prop_changes','user'), |
329 | 329 | array( |
330 | 330 | 'cpc_attrib', |
331 | 331 | 'cpc_removed', |
332 | 332 | 'cpc_added', |
333 | 333 | 'cpc_timestamp', |
334 | 334 | 'cpc_user', |
335 | | - 'cpc_user_text' |
| 335 | + 'cpc_user_text', |
| 336 | + 'user_name' |
336 | 337 | ), array( |
337 | 338 | 'cpc_repo_id' => $this->mRepoId, |
338 | | - 'cpc_rev_id' => $this->mId ), |
| 339 | + 'cpc_rev_id' => $this->mId, |
| 340 | + ), |
339 | 341 | __METHOD__, |
340 | | - array( |
341 | | - 'ORDER BY' => 'cpc_timestamp DESC' ) |
| 342 | + array( 'ORDER BY' => 'cpc_timestamp DESC' ), |
| 343 | + array( 'user' => array('LEFT JOIN','cpc_user = user_id') ) |
342 | 344 | ); |
343 | 345 | $changes = array(); |
344 | 346 | foreach( $result as $row ) { |
Index: trunk/extensions/CodeReview/CodeReview.php |
— | — | @@ -58,6 +58,7 @@ |
59 | 59 | $wgAutoloadClasses['CodeTagListView'] = $dir . 'CodeTagListView.php'; |
60 | 60 | $wgAutoloadClasses['CodeCommentsListView'] = $dir . 'CodeCommentsListView.php'; |
61 | 61 | $wgAutoloadClasses['CodeComment'] = $dir . 'CodeComment.php'; |
| 62 | +$wgAutoloadClasses['CodePropChange'] = $dir . 'CodePropChange.php'; |
62 | 63 | $wgAutoloadClasses['SpecialCode'] = $dir . 'SpecialCode.php'; |
63 | 64 | $wgAutoloadClasses['CodeView'] = $dir . 'SpecialCode.php'; |
64 | 65 | $wgAutoloadClasses['SpecialRepoAdmin'] = $dir . 'SpecialRepoAdmin.php'; |
Index: trunk/extensions/CodeReview/CodePropChange.php |
— | — | @@ -0,0 +1,24 @@ |
| 2 | +<?php |
| 3 | +if (!defined('MEDIAWIKI')) die(); |
| 4 | + |
| 5 | +class CodePropChange { |
| 6 | + function __construct( $rev ) { |
| 7 | + $this->rev = $rev; |
| 8 | + } |
| 9 | + |
| 10 | + static function newFromRow( $rev, $row ) { |
| 11 | + return self::newFromData( $rev, get_object_vars( $row ) ); |
| 12 | + } |
| 13 | + |
| 14 | + static function newFromData( $rev, $data ) { |
| 15 | + $change = new CodeComment( $rev ); |
| 16 | + $change->attrib = $data['cpc_attrib']; |
| 17 | + $change->removed = $data['cpc_removed']; |
| 18 | + $change->added = $data['cpc_added']; |
| 19 | + $change->user = $data['cpc_user']; |
| 20 | + // We'd prefer the up to date user table name |
| 21 | + $change->userText = isset($data['user_name']) ? $data['user_name'] : $data['cpc_user_text']; |
| 22 | + $change->timestamp = wfTimestamp( TS_MW, $data['cpc_timestamp'] ); |
| 23 | + return $change; |
| 24 | + } |
| 25 | +} |
Property changes on: trunk/extensions/CodeReview/CodePropChange.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 26 | + native |