Index: trunk/extensions/CodeReview/CodeReview.i18n.php |
— | — | @@ -17,13 +17,16 @@ |
18 | 18 | 'code-change-tags' => 'changed the \'\'\'tags\'\'\' for r$1', |
19 | 19 | 'code-change-removed' => 'removed:', |
20 | 20 | 'code-change-added' => 'added:', |
| 21 | + 'code-old-status' => 'Old status', |
| 22 | + 'code-new-status' => 'New status', |
21 | 23 | 'code-prop-changes' => 'Status & tagging log', |
22 | 24 | 'code-desc' => '[[Special:Code|Code review tool]] with [[Special:RepoAdmin|Subversion support]]', |
23 | 25 | 'code-no-repo' => 'No repository configured!', |
24 | 26 | 'code-load-diff' => 'Loading diff…', |
25 | 27 | 'code-notes' => 'recent comments', |
| 28 | + 'code-statuschanges' => 'status changes', |
26 | 29 | 'code-authors' => 'authors', |
27 | | - 'code-status' => 'status', |
| 30 | + 'code-status' => 'states', |
28 | 31 | 'code-tags' => 'tags', |
29 | 32 | 'code-authors-text' => 'Below is a list of repo authors in order of recent commits.', |
30 | 33 | 'code-author-haslink' => 'This author is linked to the wiki user $1', |
Index: trunk/extensions/CodeReview/SpecialCode.php |
— | — | @@ -42,6 +42,9 @@ |
43 | 43 | } elseif ( $params[1] === 'comments' ) { |
44 | 44 | $view = new CodeCommentsListView( $params[0] ); |
45 | 45 | break; |
| 46 | + } elseif ( $params[1] === 'statuschanges' ) { |
| 47 | + $view = new CodeStatusChangeListView( $params[0] ); |
| 48 | + break; |
46 | 49 | } elseif ( $params[1] === 'releasenotes' ) { |
47 | 50 | $view = new CodeReleaseNotes( $params[0] ); |
48 | 51 | break; |
Index: trunk/extensions/CodeReview/CodeStatusChangeListView.php |
— | — | @@ -0,0 +1,113 @@ |
| 2 | +<?php
|
| 3 | +
|
| 4 | +// Special:Code/MediaWiki
|
| 5 | +class CodeStatusChangeListView extends CodeView {
|
| 6 | + public $mRepo;
|
| 7 | +
|
| 8 | + function __construct( $repoName ) {
|
| 9 | + parent::__construct();
|
| 10 | + $this->mRepo = CodeRepository::newFromName( $repoName );
|
| 11 | + }
|
| 12 | +
|
| 13 | + function execute() {
|
| 14 | + global $wgOut;
|
| 15 | + $pager = $this->getPager();
|
| 16 | + $wgOut->addHTML(
|
| 17 | + $pager->getNavigationBar() .
|
| 18 | + $pager->getLimitForm() .
|
| 19 | + $pager->getBody() .
|
| 20 | + $pager->getNavigationBar()
|
| 21 | + );
|
| 22 | + }
|
| 23 | +
|
| 24 | + function getPager() {
|
| 25 | + return new CodeStatusChangeTablePager( $this );
|
| 26 | + }
|
| 27 | + function getRepo() {
|
| 28 | + return $this->mRepo;
|
| 29 | + }
|
| 30 | +}
|
| 31 | +
|
| 32 | +// Pager for CodeRevisionListView
|
| 33 | +class CodeStatusChangeTablePager extends TablePager {
|
| 34 | +
|
| 35 | + function __construct( CodeStatusChangeListView $view ) {
|
| 36 | + global $IP;
|
| 37 | + $this->mView = $view;
|
| 38 | + $this->mRepo = $view->mRepo;
|
| 39 | + $this->mDefaultDirection = true;
|
| 40 | + $this->mCurSVN = SpecialVersion::getSvnRevision( $IP );
|
| 41 | + parent::__construct();
|
| 42 | + }
|
| 43 | +
|
| 44 | + function isFieldSortable( $field ) {
|
| 45 | + return $field == 'cpc_timestamp';
|
| 46 | + }
|
| 47 | +
|
| 48 | + function getDefaultSort() { return 'cpc_timestamp'; }
|
| 49 | +
|
| 50 | + function getQueryInfo() {
|
| 51 | + return array(
|
| 52 | + 'tables' => array( 'code_prop_changes', 'code_rev' ),
|
| 53 | + 'fields' => array_keys( $this->getFieldNames() ),
|
| 54 | + 'conds' => array( 'cpc_repo_id' => $this->mRepo->getId() ),
|
| 55 | + 'join_conds' => array(
|
| 56 | + 'code_rev' => array( 'LEFT JOIN', 'cpc_repo_id = cr_repo_id AND cpc_rev_id = cr_id' )
|
| 57 | + )
|
| 58 | + );
|
| 59 | + }
|
| 60 | +
|
| 61 | + function getFieldNames() {
|
| 62 | + return array(
|
| 63 | + 'cpc_timestamp' => wfMsg( 'code-field-timestamp' ),
|
| 64 | + 'cpc_user_text' => wfMsg( 'code-field-user' ),
|
| 65 | + 'cpc_rev_id' => wfMsg( 'code-field-id' ),
|
| 66 | + 'cpc_removed' => wfMsg( 'code-field-text' ),
|
| 67 | + 'cpc_removed' => wfMsg( 'code-old-status' ),
|
| 68 | + 'cpc_added' => wfMsg( 'code-new-status' ),
|
| 69 | + 'cr_status' => wfMsg( 'code-field-status' ),
|
| 70 | + );
|
| 71 | + }
|
| 72 | +
|
| 73 | + function formatValue( $name, $value ) {
|
| 74 | + global $wgUser, $wgLang;
|
| 75 | + switch( $name ) {
|
| 76 | + case 'cpc_rev_id':
|
| 77 | + return $this->mView->mSkin->link(
|
| 78 | + SpecialPage::getTitleFor( 'Code', $this->mRepo->getName() . '/' . $value . '#code-changes' ),
|
| 79 | + htmlspecialchars( $value ) );
|
| 80 | + case 'cr_status':
|
| 81 | + return $this->mView->mSkin->link(
|
| 82 | + SpecialPage::getTitleFor( 'Code',
|
| 83 | + $this->mRepo->getName() . '/status/' . $value ),
|
| 84 | + htmlspecialchars( $this->mView->statusDesc( $value ) ) );
|
| 85 | + case 'cpc_user_text':
|
| 86 | + return $this->mView->mSkin->userLink( -1, $value );
|
| 87 | + case 'cpc_removed':
|
| 88 | + return wfMsgHtml( $value ? "code-status-$value" : "code-status-new" );
|
| 89 | + case 'cpc_added':
|
| 90 | + return wfMsgHtml( "code-status-$value" );
|
| 91 | + case 'cpc_timestamp':
|
| 92 | + global $wgLang;
|
| 93 | + return $wgLang->timeanddate( $value, true );
|
| 94 | + }
|
| 95 | + }
|
| 96 | +
|
| 97 | + // Note: this function is poorly factored in the parent class
|
| 98 | + function formatRow( $row ) {
|
| 99 | + global $wgWikiSVN;
|
| 100 | + $class = "mw-codereview-status-{$row->cr_status}";
|
| 101 | + if ( $this->mRepo->mName == $wgWikiSVN ) {
|
| 102 | + $class .= " mw-codereview-" . ( $row->cpc_rev_id <= $this->mCurSVN ? 'live' : 'notlive' );
|
| 103 | + }
|
| 104 | + return str_replace(
|
| 105 | + '<tr>',
|
| 106 | + Xml::openElement( 'tr',
|
| 107 | + array( 'class' => $class ) ),
|
| 108 | + parent::formatRow( $row ) );
|
| 109 | + }
|
| 110 | +
|
| 111 | + function getTitle() {
|
| 112 | + return SpecialPage::getTitleFor( 'Code', $this->mRepo->getName() . '/statuschanges' );
|
| 113 | + }
|
| 114 | +}
|
Index: trunk/extensions/CodeReview/CodeRepoListView.php |
— | — | @@ -22,9 +22,10 @@ |
23 | 23 | global $wgLang; |
24 | 24 | $text = "'''[[Special:Code/$name|$name]]''' ("; |
25 | 25 | $links[] = "[[Special:Code/$name/comments|" . wfMsgHtml( 'code-notes' ) . "]]"; |
26 | | - $links[] = "[[Special:Code/$name/status|" . wfMsgHtml( 'code-status' ) . "]]"; |
| 26 | + $links[] = "[[Special:Code/$name/statuschanges|" . wfMsgHtml( 'code-statuschanges' ) . "]]"; |
27 | 27 | $links[] = "[[Special:Code/$name/tag|" . wfMsgHtml( 'code-tags' ) . "]]"; |
28 | 28 | $links[] = "[[Special:Code/$name/author|" . wfMsgHtml( 'code-authors' ) . "]]"; |
| 29 | + $links[] = "[[Special:Code/$name/status|" . wfMsgHtml( 'code-status' ) . "]]"; |
29 | 30 | $links[] = "[[Special:Code/$name/releasenotes|" . wfMsgHtml( 'code-releasenotes' ) . "]]"; |
30 | 31 | $text .= $wgLang->pipeList( $links ); |
31 | 32 | $text .= ")"; |
Index: trunk/extensions/CodeReview/CodeReview.php |
— | — | @@ -40,10 +40,13 @@ |
41 | 41 | $wgAutoloadClasses['ApiCodeUpdate'] = $dir . 'ApiCodeUpdate.php'; |
42 | 42 | $wgAutoloadClasses['ApiCodeDiff'] = $dir . 'ApiCodeDiff.php'; |
43 | 43 | $wgAutoloadClasses['ApiCodeComments'] = $dir . 'ApiCodeComments.php'; |
| 44 | + |
44 | 45 | $wgAutoloadClasses['CodeDiffHighlighter'] = $dir . 'DiffHighlighter.php'; |
45 | 46 | $wgAutoloadClasses['CodeRepository'] = $dir . 'CodeRepository.php'; |
46 | 47 | $wgAutoloadClasses['CodeRepoListView'] = $dir . 'CodeRepoListView.php'; |
47 | 48 | $wgAutoloadClasses['CodeRevision'] = $dir . 'CodeRevision.php'; |
| 49 | +$wgAutoloadClasses['SubversionAdaptor'] = $dir . 'Subversion.php'; |
| 50 | + |
48 | 51 | $wgAutoloadClasses['CodeRevisionAuthorView'] = $dir . 'CodeRevisionAuthorView.php'; |
49 | 52 | $wgAutoloadClasses['CodeRevisionAuthorLink'] = $dir . 'CodeRevisionAuthorLink.php'; |
50 | 53 | $wgAutoloadClasses['CodeRevisionListView'] = $dir . 'CodeRevisionListView.php'; |
— | — | @@ -55,13 +58,13 @@ |
56 | 59 | $wgAutoloadClasses['CodeStatusListView'] = $dir . 'CodeStatusListView.php'; |
57 | 60 | $wgAutoloadClasses['CodeTagListView'] = $dir . 'CodeTagListView.php'; |
58 | 61 | $wgAutoloadClasses['CodeCommentsListView'] = $dir . 'CodeCommentsListView.php'; |
| 62 | +$wgAutoloadClasses['CodeStatusChangeListView'] = $dir . 'CodeStatusChangeListView.php'; |
59 | 63 | $wgAutoloadClasses['CodeReleaseNotes'] = $dir . 'CodeReleaseNotes.php'; |
60 | 64 | $wgAutoloadClasses['CodeComment'] = $dir . 'CodeComment.php'; |
61 | 65 | $wgAutoloadClasses['CodePropChange'] = $dir . 'CodePropChange.php'; |
62 | 66 | $wgAutoloadClasses['SpecialCode'] = $dir . 'SpecialCode.php'; |
63 | 67 | $wgAutoloadClasses['CodeView'] = $dir . 'SpecialCode.php'; |
64 | 68 | $wgAutoloadClasses['SpecialRepoAdmin'] = $dir . 'SpecialRepoAdmin.php'; |
65 | | -$wgAutoloadClasses['SubversionAdaptor'] = $dir . 'Subversion.php'; |
66 | 69 | |
67 | 70 | $wgSpecialPages['Code'] = 'SpecialCode'; |
68 | 71 | $wgSpecialPageGroups['Code'] = 'developer'; |