r47184 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r47183‎ | r47184 | r47185 >
Date:15:31, 12 February 2009
Author:aaron
Status:deferred
Tags:
Comment:
(bug 17447) Added user field to QualityOversight
Modified paths:
  • /trunk/extensions/FlaggedRevs/language/FlaggedRevs.i18n.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/QualityOversight_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/language/FlaggedRevs.i18n.php
@@ -198,9 +198,9 @@
199199 'revreview-filter-unapproved' => 'Unapproved',
200200 'revreview-filter-auto' => 'Automatic',
201201 'revreview-filter-manual' => 'Manual',
202 - 'revreview-filter-level-0' => 'Sighted versions',
203 - 'revreview-filter-level-1' => 'Quality versions',
204 - 'revreview-filter-level-2' => 'Pristine versions',
 202+ 'revreview-filter-level-0' => 'Sighted',
 203+ 'revreview-filter-level-1' => 'Quality',
 204+ 'revreview-filter-level-2' => 'Pristine',
205205 'revreview-statusfilter' => 'Status:',
206206 'revreview-typefilter' => 'Type:',
207207 'revreview-tagfilter' => 'Tag:',
Index: trunk/extensions/FlaggedRevs/specialpages/QualityOversight_body.php
@@ -22,6 +22,10 @@
2323 $this->level = $wgRequest->getInt( 'level' );
2424 $this->status = $wgRequest->getIntOrNull( 'status' );
2525 $this->automatic = $wgRequest->getIntOrNull( 'automatic' );
 26+ $this->user = $wgRequest->getVal( 'user' );
 27+ # Check if the user exists
 28+ $usertitle = Title::makeTitleSafe( NS_USER, $this->user );
 29+ $u = $usertitle ? User::idFromName( $this->user ) : false;
2630
2731 # Show options
2832 $this->showForm();
@@ -32,15 +36,18 @@
3337 return;
3438 }
3539
36 - # Get cutoff time
3740 $dbr = wfGetDB( DB_SLAVE );
38 - $cutoff_unixtime = time() - $wgFlaggedRevsOversightAge;
39 - $cutoff_unixtime = $cutoff_unixtime - ($cutoff_unixtime % 86400);
40 - $cutoff = $dbr->addQuotes( $dbr->timestamp( $cutoff_unixtime ) );
 41+ # Get extra query conds
 42+ $conds = array( 'log_namespace' => $this->namespace, 'log_action' => $actions );
 43+ # Get cutoff time (mainly for performance)
 44+ if( !$u ) {
 45+ $cutoff_unixtime = time() - $wgFlaggedRevsOversightAge;
 46+ $cutoff = $dbr->addQuotes( $dbr->timestamp( $cutoff_unixtime ) );
 47+ $conds[] = "log_timestamp >= $cutoff";
 48+ }
4149 # Create a LogPager item to get the results and a LogEventsList item to format them...
4250 $loglist = new LogEventsList( $wgUser->getSkin(), $wgOut, 0 );
43 - $pager = new LogPager( $loglist, 'review', '', '', '',
44 - array( 'log_namespace' => $this->namespace, 'log_action' => $actions, "log_timestamp >= $cutoff" ) );
 51+ $pager = new LogPager( $loglist, 'review', $this->user, '', '', $conds );
4552 # Insert list
4653 $logBody = $pager->getBody();
4754 if( $logBody ) {
@@ -64,6 +71,7 @@
6572 Xml::hidden( 'title', $wgTitle->getPrefixedDBKey() ) .
6673 FlaggedRevsXML::getNamespaceMenu( $this->namespace ) . ' ' .
6774 FlaggedRevsXML::getLevelMenu( $this->level ) . ' ' .
 75+ Xml::inputLabel( wfMsg( 'specialloguserlabel' ), 'user', 'user', 15, $this->user ) . ' ' .
6876 FlaggedRevsXML::getStatusFilterMenu( $this->status ) . ' ' .
6977 FlaggedRevsXML::getAutoFilterMenu( $this->automatic ) . ' ' .
7078 Xml::submitButton( wfMsg( 'go' ) ) .

Status & tagging log