Revision: 43464
Author:   aaron
Date:     2008-11-13 23:10:34 +0000 (Thu, 13 Nov 2008)

Log Message:
-----------
* Add getPropChanges()
* Fix prop changes insert query to include usertext

Modified Paths:
--------------
    trunk/extensions/CodeReview/CodeRevision.php

Modified: trunk/extensions/CodeReview/CodeRevision.php
===================================================================
--- trunk/extensions/CodeReview/CodeRevision.php        2008-11-13 22:48:54 UTC 
(rev 43463)
+++ trunk/extensions/CodeReview/CodeRevision.php        2008-11-13 23:10:34 UTC 
(rev 43464)
@@ -133,7 +133,8 @@
                                        'cpc_removed'   => $oldStatus,
                                        'cpc_added'     => $status,
                                        'cpc_timestamp' => $dbw->timestamp(),
-                                       'cpc_user'      => $user->getId()
+                                       'cpc_user'      => $user->getId(),
+                                       'cpc_user_text' => $user->getName()
                                ),
                                __METHOD__
                        );
@@ -311,8 +312,8 @@
                                'cc_rev_id' => $this->mId ),
                        __METHOD__,
                        array(
-                               'ORDER BY' => 'cc_sortkey' ) );
-
+                               'ORDER BY' => 'cc_sortkey' )
+               );
                $comments = array();
                foreach( $result as $row ) {
                        $comments[] = CodeComment::newFromRow( $this, $row );
@@ -321,6 +322,31 @@
                return $comments;
        }
        
+       public function getPropChanges() {
+               $dbr = wfGetDB( DB_SLAVE );
+               $result = $dbr->select( 'code_prop_changes',
+                       array(
+                               'cpc_attrib',
+                               'cpc_removed',
+                               'cpc_added',
+                               'cpc_timestamp',
+                               'cpc_user',
+                               'cpc_user_text'
+                       ), array(
+                               'cpc_repo_id' => $this->mRepoId,
+                               'cpc_rev_id' => $this->mId ),
+                       __METHOD__,
+                       array(
+                               'ORDER BY' => 'cpc_timestamp DESC' )
+               );
+               $changes = array();
+               foreach( $result as $row ) {
+                       $changes[] = CodePropChange::newFromRow( $this, $row );
+               }
+               $result->free();
+               return $changes;
+       }
+       
        protected function getCommentingUsers() {
                $dbr = wfGetDB( DB_SLAVE );
                $res = $dbr->select( 'code_comment',
@@ -391,7 +417,8 @@
                                        'cpc_removed'   => 
implode(',',$removeTags),
                                        'cpc_added'     => 
implode(',',$addTags),
                                        'cpc_timestamp' => $dbw->timestamp(),
-                                       'cpc_user'      => $user->getId()
+                                       'cpc_user'      => $user->getId(),
+                                       'cpc_user_text' => $user->getName()
                                ),
                                __METHOD__
                        );



_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to