From: Sam Reed Date: Sat, 30 Jan 2010 22:48:54 +0000 (+0000) Subject: Start of implementation of bug 18758 - Get value of wl_notificationtimestamp X-Git-Tag: 1.31.0-rc.0~38026 X-Git-Url: http://git.cyclocoop.org/%22%2C%20generer_url_ecrire%28?a=commitdiff_plain;h=211f9a8689d76b61c26963f34b0f34268fb5e291;p=lhc%2Fweb%2Fwiklou.git Start of implementation of bug 18758 - Get value of wl_notificationtimestamp --- diff --git a/includes/api/ApiQueryWatchlist.php b/includes/api/ApiQueryWatchlist.php index 9a13107d17..ddfcf75b85 100644 --- a/includes/api/ApiQueryWatchlist.php +++ b/includes/api/ApiQueryWatchlist.php @@ -49,7 +49,8 @@ class ApiQueryWatchlist extends ApiQueryGeneratorBase { } private $fld_ids = false, $fld_title = false, $fld_patrol = false, $fld_flags = false, - $fld_timestamp = false, $fld_user = false, $fld_comment = false, $fld_sizes = false; + $fld_timestamp = false, $fld_user = false, $fld_comment = false, $fld_sizes = false, + $fld_notificationtimestamp = false; private function run( $resultPageSet = null ) { global $wgUser; @@ -85,6 +86,7 @@ class ApiQueryWatchlist extends ApiQueryGeneratorBase { $this->fld_timestamp = isset( $prop['timestamp'] ); $this->fld_sizes = isset( $prop['sizes'] ); $this->fld_patrol = isset( $prop['patrol'] ); + $this->fld_notificationtimestamp = isset( $prop['notificationtimestamp'] ); if ( $this->fld_patrol ) { if ( !$user->useRCPatrol() && !$user->useNPPatrol() ) @@ -113,6 +115,7 @@ class ApiQueryWatchlist extends ApiQueryGeneratorBase { $this->addFieldsIf( 'rc_patrolled', $this->fld_patrol ); $this->addFieldsIf( 'rc_old_len', $this->fld_sizes ); $this->addFieldsIf( 'rc_new_len', $this->fld_sizes ); + $this->addFieldsIf( 'wl_notificationtimestamp', $this->fld_notificationtimestamp ); } elseif ( $params['allrev'] ) { $this->addFields( 'rc_this_oldid' ); } else { @@ -257,6 +260,9 @@ class ApiQueryWatchlist extends ApiQueryGeneratorBase { $vals['oldlen'] = intval( $row->rc_old_len ); $vals['newlen'] = intval( $row->rc_new_len ); } + + if ( $this->fld_notificationtimestamp ) + $vals['notificationtimestamp'] = ( $row->wl_notificationtimestamp == null ) ? '' : wfTimestamp( TS_ISO_8601, $row->wl_notificationtimestamp); if ( $this->fld_comment && isset( $row->rc_comment ) ) $vals['comment'] = $row->rc_comment; @@ -309,6 +315,7 @@ class ApiQueryWatchlist extends ApiQueryGeneratorBase { 'timestamp', 'patrol', 'sizes', + 'notificationtimestamp' ) ), 'show' => array (