Index: trunk/extensions/CodeReview/CodeRevisionListView.php |
— | — | @@ -82,7 +82,7 @@ |
83 | 83 | if( $this->getDefaultSort() === 'cp_rev_id' ) { |
84 | 84 | return array( |
85 | 85 | 'tables' => array( 'code_paths', 'code_rev', 'code_comment' ), |
86 | | - 'fields' => array_keys( $this->getFieldNames() ), |
| 86 | + 'fields' => $this->getSelectFields(), |
87 | 87 | 'conds' => array( |
88 | 88 | 'cp_repo_id' => $this->mRepo->getId(), |
89 | 89 | 'cp_path LIKE '.$this->mDb->addQuotes($this->mDb->escapeLike( $this->getSVNPath() ).'%'), |
— | — | @@ -99,7 +99,7 @@ |
100 | 100 | } else { |
101 | 101 | return array( |
102 | 102 | 'tables' => array( 'code_rev', 'code_comment' ), |
103 | | - 'fields' => array_keys( $this->getFieldNames() ), |
| 103 | + 'fields' => $this->getSelectFields(), |
104 | 104 | 'conds' => array( 'cr_repo_id' => $this->mRepo->getId() ), |
105 | 105 | 'options' => array( 'GROUP BY' => 'cr_id' ), |
106 | 106 | 'join_conds' => array( |
— | — | @@ -109,12 +109,17 @@ |
110 | 110 | } |
111 | 111 | return false; |
112 | 112 | } |
| 113 | + |
| 114 | + function getSelectFields() { |
| 115 | + return array( $this->getDefaultSort(), 'cr_status', 'COUNT( DISTINCT cc_id ) AS comments', |
| 116 | + 'cr_path', 'cr_message', 'cr_author', 'cr_timestamp' ); |
| 117 | + } |
113 | 118 | |
114 | 119 | function getFieldNames() { |
115 | 120 | return array( |
116 | 121 | $this->getDefaultSort() => wfMsg( 'code-field-id' ), |
117 | 122 | 'cr_status' => wfMsg( 'code-field-status' ), |
118 | | - 'COUNT( DISTINCT cc_id)' => wfMsg( 'code-field-comments' ), |
| 123 | + 'comments' => wfMsg( 'code-field-comments' ), |
119 | 124 | 'cr_path' => wfMsg( 'code-field-path' ), |
120 | 125 | 'cr_message' => wfMsg( 'code-field-message' ), |
121 | 126 | 'cr_author' => wfMsg( 'code-field-author' ), |
— | — | @@ -142,7 +147,7 @@ |
143 | 148 | case 'cr_timestamp': |
144 | 149 | global $wgLang; |
145 | 150 | return $wgLang->timeanddate( $value, true ); |
146 | | - case 'COUNT( DISTINCT cc_id)': |
| 151 | + case 'comments': |
147 | 152 | return intval( $value ); |
148 | 153 | case 'cr_path': |
149 | 154 | return Xml::element('div', array( 'title' => (string)$value ), |