r88579 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r88578‎ | r88579 | r88580 >
Date:15:06, 22 May 2011
Author:reedy
Status:ok
Tags:
Comment:
* (bug 26754) Support for path and author on CR-specific pages (comments, statuschanges, tags etc.)

Make /statuschanges filterable by path
Modified paths:
  • /trunk/extensions/CodeReview/ui/CodeStatusChangeListView.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CodeReview/ui/CodeStatusChangeListView.php
@@ -1,35 +1,13 @@
22 <?php
33
44 // Special:Code/MediaWiki
5 -class CodeStatusChangeListView extends CodeView {
6 - public $mRepo;
7 -
8 - function __construct( $repo ) {
9 - parent::__construct( $repo );
10 -
11 - global $wgRequest;
12 - $this->mAuthor = $wgRequest->getText( 'author' );
13 - }
14 -
15 - function execute() {
16 - global $wgOut;
17 - $pager = $this->getPager();
18 - $limitForm = $pager->getLimitForm();
19 - $wgOut->addHTML(
20 - $pager->getNavigationBar() .
21 - $limitForm .
22 - $pager->getBody() .
23 - $limitForm .
24 - $pager->getNavigationBar()
25 - );
26 - }
27 -
 5+class CodeStatusChangeListView extends CodeRevisionListView {
286 function getPager() {
297 return new CodeStatusChangeTablePager( $this );
308 }
319
32 - function getRepo() {
33 - return $this->mRepo;
 10+ function getRevCount( $dbr ) {
 11+ return -1;
3412 }
3513 }
3614
@@ -40,7 +18,9 @@
4119 return $field == 'cpc_timestamp';
4220 }
4321
44 - function getDefaultSort() { return 'cpc_timestamp'; }
 22+ function getDefaultSort() {
 23+ return 'cpc_timestamp';
 24+ }
4525
4626 function getQueryInfo() {
4727 $query = array(
@@ -49,9 +29,15 @@
5030 'conds' => array( 'cpc_repo_id' => $this->mRepo->getId(), 'cpc_attrib' => 'status' ),
5131 'join_conds' => array(
5232 'code_rev' => array( 'LEFT JOIN', 'cpc_repo_id = cr_repo_id AND cpc_rev_id = cr_id' )
53 - )
 33+ ),
 34+ 'options' => array(),
5435 );
5536
 37+ if( count( $this->mView->mPath ) ) {
 38+ $query['tables'][] = 'code_paths';
 39+ $query['join_conds']['code_paths'] = array( 'INNER JOIN', 'cpc_repo_id = cp_repo_id AND cpc_rev_id = cp_rev_id' );
 40+ $query['conds']['cp_path'] = $this->mView->mPath;
 41+ }
5642 if ( $this->mView->mAuthor ) {
5743 $query['conds']['cpc_user_text'] = $this->mView->mAuthor;
5844 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r88578* (bug 26754) Support for path and author on CR-specific pages (comments, sta...reedy15:02, 22 May 2011

Status & tagging log