r82975 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r82974‎ | r82975 | r82976 >
Date:22:55, 28 February 2011
Author:reedy
Status:resolved
Tags:
Comment:
* (bug 27799) Allow filtering status changes by author

Rest of this bug, create sub view, make it accessible

Few minor related tweaks
Modified paths:
  • /trunk/extensions/CodeReview/ui/CodeStatusChangeAuthorListView.php (added) (history)
  • /trunk/extensions/CodeReview/ui/CodeStatusChangeListView.php (modified) (history)
  • /trunk/extensions/CodeReview/ui/SpecialCode.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CodeReview/ui/CodeStatusChangeAuthorListView.php
@@ -0,0 +1,10 @@
 2+<?php
 3+
 4+class CodeStatusChangeAuthorListView extends CodeStatusChangeListView {
 5+
 6+ function __construct( $repo, $author ) {
 7+ parent::__construct( $repo );
 8+
 9+ $this->mAuthor = $author;
 10+ }
 11+}
Property changes on: trunk/extensions/CodeReview/ui/CodeStatusChangeAuthorListView.php
___________________________________________________________________
Added: svn:eol-style
112 + native
Index: trunk/extensions/CodeReview/ui/SpecialCode.php
@@ -112,12 +112,15 @@
113113 break;
114114 }
115115 case 4:
116 - if ( $params[1] == 'author' && $params[3] == 'link' ) {
 116+ if ( $params[1] === 'author' && $params[3] === 'link' ) {
117117 $view = new CodeRevisionAuthorLink( $params[0], $params[2] );
118118 break;
119119 } elseif ( $params[1] === 'comments' ) {
120120 $view = new CodeCommentsAuthorListView( $params[0], $params[3] );
121121 break;
 122+ } elseif ( $params[1] === 'status' ) {
 123+ $view = new CodeStatusChangeAuthorListView( $params[0], $params[3] );
 124+ break;
122125 }
123126 default:
124127 if ( $params[2] == 'reply' ) {
Index: trunk/extensions/CodeReview/ui/CodeStatusChangeListView.php
@@ -4,9 +4,14 @@
55 class CodeStatusChangeListView extends CodeView {
66 public $mRepo;
77
8 - function __construct( $repoName ) {
 8+ function __construct( $repo ) {
99 parent::__construct();
10 - $this->mRepo = CodeRepository::newFromName( $repoName );
 10+ $this->mRepo = ( $repo instanceof CodeRepository )
 11+ ? $repo
 12+ : CodeRepository::newFromName( $repo );
 13+
 14+ global $wgRequest;
 15+ $this->mAuthor = $wgRequest->getText( 'author' );
1116 }
1217
1318 function execute() {
@@ -41,7 +46,7 @@
4247 function getDefaultSort() { return 'cpc_timestamp'; }
4348
4449 function getQueryInfo() {
45 - return array(
 50+ $query = array(
4651 'tables' => array( 'code_prop_changes', 'code_rev' ),
4752 'fields' => array_keys( $this->getFieldNames() ),
4853 'conds' => array( 'cpc_repo_id' => $this->mRepo->getId(), 'cpc_attrib' => 'status' ),
@@ -49,6 +54,12 @@
5055 'code_rev' => array( 'LEFT JOIN', 'cpc_repo_id = cr_repo_id AND cpc_rev_id = cr_id' )
5156 )
5257 );
 58+
 59+ if ( $this->mView->mAuthor ) {
 60+ $query['conds']['cpc_user_text'] = $this->mView->mAuthor;
 61+ }
 62+
 63+ return $query;
5364 }
5465
5566 function getFieldNames() {

Follow-up revisions

RevisionCommit summaryAuthorDate
r82976Followup r82975...reedy22:59, 28 February 2011
r82977Followup r82975...reedy23:01, 28 February 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r82971* (bug 27799) Allow filtering status changes by author...reedy22:11, 28 February 2011

Status & tagging log