Index: trunk/extensions/CodeReview/ui/CodeStatusChangeListView.php |
— | — | @@ -1,35 +1,13 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | 4 | // 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 { |
28 | 6 | function getPager() { |
29 | 7 | return new CodeStatusChangeTablePager( $this ); |
30 | 8 | } |
31 | 9 | |
32 | | - function getRepo() { |
33 | | - return $this->mRepo; |
| 10 | + function getRevCount( $dbr ) { |
| 11 | + return -1; |
34 | 12 | } |
35 | 13 | } |
36 | 14 | |
— | — | @@ -40,7 +18,9 @@ |
41 | 19 | return $field == 'cpc_timestamp'; |
42 | 20 | } |
43 | 21 | |
44 | | - function getDefaultSort() { return 'cpc_timestamp'; } |
| 22 | + function getDefaultSort() { |
| 23 | + return 'cpc_timestamp'; |
| 24 | + } |
45 | 25 | |
46 | 26 | function getQueryInfo() { |
47 | 27 | $query = array( |
— | — | @@ -49,9 +29,15 @@ |
50 | 30 | 'conds' => array( 'cpc_repo_id' => $this->mRepo->getId(), 'cpc_attrib' => 'status' ), |
51 | 31 | 'join_conds' => array( |
52 | 32 | 'code_rev' => array( 'LEFT JOIN', 'cpc_repo_id = cr_repo_id AND cpc_rev_id = cr_id' ) |
53 | | - ) |
| 33 | + ), |
| 34 | + 'options' => array(), |
54 | 35 | ); |
55 | 36 | |
| 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 | + } |
56 | 42 | if ( $this->mView->mAuthor ) { |
57 | 43 | $query['conds']['cpc_user_text'] = $this->mView->mAuthor; |
58 | 44 | } |