Index: trunk/extensions/CodeReview/CodeReview.php |
— | — | @@ -70,6 +70,7 @@ |
71 | 71 | $wgAutoloadClasses['CodeStatusListView'] = $dir . 'ui/CodeStatusListView.php'; |
72 | 72 | $wgAutoloadClasses['CodeTagListView'] = $dir . 'ui/CodeTagListView.php'; |
73 | 73 | $wgAutoloadClasses['CodeCommentsListView'] = $dir . 'ui/CodeCommentsListView.php'; |
| 74 | +$wgAutoloadClasses['CodeCommentAuthorListView'] = $dir . 'ui/CodeCommentAuthorListView.php'; |
74 | 75 | $wgAutoloadClasses['CodeReleaseNotes'] = $dir . 'ui/CodeReleaseNotes.php'; |
75 | 76 | $wgAutoloadClasses['CodeStatusChangeListView'] = $dir . 'ui/CodeStatusChangeListView.php'; |
76 | 77 | $wgAutoloadClasses['SpecialCode'] = $dir . 'ui/SpecialCode.php'; |
Index: trunk/extensions/CodeReview/ui/CodeCommentsAuthorListView.php |
— | — | @@ -0,0 +1,8 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +class CodeCommentAuthorListView extends CodeCommentsListView { |
| 5 | + function __construct( $repo, $author ) { |
| 6 | + parent::__construct( $repo ); |
| 7 | + $this->mAuthor = $author; |
| 8 | + } |
| 9 | +} |
Property changes on: trunk/extensions/CodeReview/ui/CodeCommentsAuthorListView.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 10 | + native |
Index: trunk/extensions/CodeReview/ui/CodeCommentsListView.php |
— | — | @@ -4,9 +4,15 @@ |
5 | 5 | class CodeCommentsListView extends CodeView { |
6 | 6 | public $mRepo; |
7 | 7 | |
8 | | - function __construct( $repoName ) { |
| 8 | + function __construct( $repo ) { |
9 | 9 | parent::__construct(); |
10 | | - $this->mRepo = CodeRepository::newFromName( $repoName ); |
| 10 | + |
| 11 | + $this->mRepo = ( $repo instanceof CodeRepository ) |
| 12 | + ? $repo |
| 13 | + : CodeRepository::newFromName( $repo ); |
| 14 | + |
| 15 | + global $wgRequest; |
| 16 | + $this->mAuthor = $wgRequest->getText( 'author' ); |
11 | 17 | } |
12 | 18 | |
13 | 19 | function execute() { |
— | — | @@ -54,7 +60,7 @@ |
55 | 61 | } |
56 | 62 | |
57 | 63 | function getFieldNames() { |
58 | | - return array( |
| 64 | + $query = array( |
59 | 65 | 'cc_timestamp' => wfMsg( 'code-field-timestamp' ), |
60 | 66 | 'cc_user_text' => wfMsg( 'code-field-user' ), |
61 | 67 | 'cc_rev_id' => wfMsg( 'code-field-id' ), |
— | — | @@ -62,6 +68,12 @@ |
63 | 69 | 'cr_message' => wfMsg( 'code-field-message' ), |
64 | 70 | 'cc_text' => wfMsg( 'code-field-text' ), |
65 | 71 | ); |
| 72 | + |
| 73 | + if( $this->mView->mAuthor ) { |
| 74 | + $query['conds']['cc_user_text'] = $this->mView->mAuthor; |
| 75 | + } |
| 76 | + |
| 77 | + return $query; |
66 | 78 | } |
67 | 79 | |
68 | 80 | function formatValue( $name, $value ) { |
Index: trunk/extensions/CodeReview/ui/SpecialCode.php |
— | — | @@ -99,7 +99,7 @@ |
100 | 100 | $view = new CodeRevisionStatusView( $params[0], $params[2] ); |
101 | 101 | break; |
102 | 102 | } elseif ( $params[1] === 'comments' ) { |
103 | | - $view = new CodeCommentsListView( $params[0] ); |
| 103 | + $view = new CodeCommentAuthorListView( $params[0], $params[2] ); |
104 | 104 | break; |
105 | 105 | } else { |
106 | 106 | # Nonsense parameters, back out |