Index: trunk/extensions/CodeReview/CodeReview.php |
— | — | @@ -175,16 +175,24 @@ |
176 | 176 | $base = dirname( __FILE__ ); |
177 | 177 | switch ( $updater->getDB()->getType() ) { |
178 | 178 | case 'mysql': |
179 | | - $updater->addExtensionUpdate( array( 'addTable', 'code_rev', "$base/codereview.sql", true ) ); // Initial install tables |
180 | | - $updater->addExtensionUpdate( array( 'addField', 'code_rev', 'cr_diff', "$base/archives/codereview-cr_diff.sql", true ) ); |
181 | | - $updater->addExtensionUpdate( array( 'addIndex', 'code_relations', 'repo_to_from', "$base/archives/code_relations_index.sql", true ) ); |
| 179 | + $updater->addExtensionUpdate( array( 'addTable', 'code_rev', |
| 180 | + "$base/codereview.sql", true ) ); // Initial install tables |
| 181 | + $updater->addExtensionUpdate( array( 'addField', 'code_rev', 'cr_diff', |
| 182 | + "$base/archives/codereview-cr_diff.sql", true ) ); |
| 183 | + $updater->addExtensionUpdate( array( 'addIndex', 'code_relations', 'repo_to_from', |
| 184 | + "$base/archives/code_relations_index.sql", true ) ); |
182 | 185 | |
183 | 186 | if ( !$updater->updateRowExists( 'make cr_status varchar' ) ) { |
184 | | - $updater->addExtensionUpdate( array( 'modifyField', 'code_rev', 'cr_status', "$base/archives/codereview-cr_status_varchar.sql", true ) ); |
| 187 | + $updater->addExtensionUpdate( array( 'modifyField', 'code_rev', 'cr_status', |
| 188 | + "$base/archives/codereview-cr_status_varchar.sql", true ) ); |
185 | 189 | } |
186 | 190 | |
187 | 191 | $updater->addExtensionUpdate( array( 'addTable', 'code_bugs', "$base/archives/code_bugs.sql", true ) ); |
| 192 | + |
188 | 193 | $updater->addExtensionUpdate( array( 'addTable', 'code_signoffs', "$base/archives/code_signoffs.sql", true ) ); |
| 194 | + |
| 195 | + $updater->addExtensionUpdate( array( 'addField', 'code_signoffs', 'cs_user', |
| 196 | + "$base/archives/code_signoffs_userid.sql", true ) ); |
189 | 197 | break; |
190 | 198 | case 'sqlite': |
191 | 199 | $updater->addExtensionUpdate( array( 'addTable', 'code_rev', "$base/codereview.sql", true ) ); |
Index: trunk/extensions/CodeReview/archives/code_signoffs_userid.sql |
— | — | @@ -0,0 +1,2 @@ |
| 2 | +ALTER TABLE /*_*/code_signoffs |
| 3 | + ADD COLUMN cs_user int not null AFTER cs_rev_id; |
\ No newline at end of file |
Property changes on: trunk/extensions/CodeReview/archives/code_signoffs_userid.sql |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 4 | + native |
Index: trunk/extensions/CodeReview/archives/code_signoffs.sql |
— | — | @@ -4,6 +4,7 @@ |
5 | 5 | cs_rev_id int not null, |
6 | 6 | |
7 | 7 | -- User that signed off |
| 8 | + cs_user int not null, |
8 | 9 | cs_user_text varchar(255) not null, |
9 | 10 | |
10 | 11 | -- Type of signoff. Current values: 'inspected', 'tested' |
Index: trunk/extensions/CodeReview/backend/CodeRevision.php |
— | — | @@ -648,7 +648,7 @@ |
649 | 649 | public function getSignoffs( $from = DB_SLAVE ) { |
650 | 650 | $db = wfGetDB( $from ); |
651 | 651 | $result = $db->select( 'code_signoffs', |
652 | | - array( 'cs_user_text', 'cs_flag', 'cs_timestamp' ), |
| 652 | + array( 'cs_user', 'cs_user_text', 'cs_flag', 'cs_timestamp' ), |
653 | 653 | array( |
654 | 654 | 'cs_repo_id' => $this->mRepoId, |
655 | 655 | 'cs_rev_id' => $this->mId, |
— | — | @@ -664,6 +664,11 @@ |
665 | 665 | return $signoffs; |
666 | 666 | } |
667 | 667 | |
| 668 | + /** |
| 669 | + * @param $user User |
| 670 | + * @param $flags |
| 671 | + * @return void |
| 672 | + */ |
668 | 673 | public function addSignoff( $user, $flags ) { |
669 | 674 | $dbw = wfGetDB( DB_MASTER ); |
670 | 675 | $rows = array(); |
— | — | @@ -671,6 +676,7 @@ |
672 | 677 | $rows[] = array( |
673 | 678 | 'cs_repo_id' => $this->mRepoId, |
674 | 679 | 'cs_rev_id' => $this->mId, |
| 680 | + 'cs_user' => $user->getID(), |
675 | 681 | 'cs_user_text' => $user->getName(), |
676 | 682 | 'cs_flag' => $flag, |
677 | 683 | 'cs_timestamp' => $dbw->timestamp(), |
Index: trunk/extensions/CodeReview/backend/CodeSignoff.php |
— | — | @@ -1,10 +1,11 @@ |
2 | 2 | <?php |
3 | 3 | class CodeSignoff { |
4 | | - public $rev, $user, $flag, $timestamp; |
| 4 | + public $rev, $user, $flag, $timestamp, $userText; |
5 | 5 | |
6 | | - public function __construct( $rev, $user, $flag, $timestamp ) { |
| 6 | + public function __construct( $rev, $user, $userText, $flag, $timestamp ) { |
7 | 7 | $this->rev = $rev; |
8 | 8 | $this->user = $user; |
| 9 | + $this->userText = $userText; |
9 | 10 | $this->flag = $flag; |
10 | 11 | $this->timestamp = $timestamp; |
11 | 12 | } |
— | — | @@ -14,7 +15,7 @@ |
15 | 16 | } |
16 | 17 | |
17 | 18 | public static function newFromData( $rev, $data ) { |
18 | | - return new self( $rev, $data['cs_user_text'], $data['cs_flag'], |
| 19 | + return new self( $rev, $data['cs_user'], $data['cs_user_text'], $data['cs_flag'], |
19 | 20 | wfTimestamp( TS_MW, $data['cs_timestamp'] ) |
20 | 21 | ); |
21 | 22 | } |
Index: trunk/extensions/CodeReview/codereview.sql |
— | — | @@ -228,6 +228,7 @@ |
229 | 229 | cs_rev_id int not null, |
230 | 230 | |
231 | 231 | -- User that signed off |
| 232 | + cs_user int not null, |
232 | 233 | cs_user_text varchar(255) not null, |
233 | 234 | |
234 | 235 | -- Type of signoff. Current values: 'inspected', 'tested' |
Index: trunk/extensions/CodeReview/ui/CodeRevisionView.php |
— | — | @@ -481,9 +481,14 @@ |
482 | 482 | return "<table border='1' class='TablePager'><tr>{$header}</tr>{$refs}</table>"; |
483 | 483 | } |
484 | 484 | |
| 485 | + /** |
| 486 | + * @param $signoff CodeSignoff |
| 487 | + * @return string |
| 488 | + */ |
485 | 489 | protected function formatSignoffInline( $signoff ) { |
486 | 490 | global $wgLang; |
487 | | - $user = htmlspecialchars( $signoff->user ); |
| 491 | + $user = $this->skin->userLink( $signoff->user, $signoff->userText ); |
| 492 | + |
488 | 493 | $flag = htmlspecialchars( $signoff->flag ); |
489 | 494 | $date = $wgLang->timeanddate( $signoff->timestamp, true ); |
490 | 495 | $class = "mw-codereview-signoff-$flag"; |