r108535 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r108534‎ | r108535 | r108536 >
Date:19:33, 10 January 2012
Author:bsitu
Status:ok
Tags:
Comment:
followup to -r108187 - move checkbox outside of label, remove INNER JOIN and rearrange table order
Modified paths:
  • /trunk/extensions/MoodBar/ApiQueryMoodBarComments.php (modified) (history)
  • /trunk/extensions/MoodBar/SpecialFeedbackDashboard.php (modified) (history)
  • /trunk/extensions/MoodBar/modules/ext.moodBar.dashboard/ext.moodBar.dashboard.css (modified) (history)

Diff [purge]

Index: trunk/extensions/MoodBar/SpecialFeedbackDashboard.php
@@ -111,8 +111,8 @@
112112 $myResponseCheckbox = Xml::check( 'myresponse', $wgRequest->getCheck( 'myresponse' ),
113113 array( 'id' => 'fbd-filters-my-response', 'value' => '1', 'class' => 'fbd-filters-check' ) );
114114
115 - $myResponseFilter = '<label for="fbd-filters-my-response" id="fbd-filters-type-my-response-label" class="fbd-filters-label">' .
116 - $myResponseCheckbox . $myResponseMsg . '</label>';
 115+ $myResponseFilter = $myResponseCheckbox. '<label for="fbd-filters-my-response" id="fbd-filters-type-my-response-label" class="fbd-filters-label">' .
 116+ $myResponseMsg . '</label>';
117117 }
118118
119119 // Show unanswered filter
@@ -120,8 +120,8 @@
121121 $showUnansweredCheckbox = Xml::check( 'showunanswered', $wgRequest->getCheck( 'showunanswered' ),
122122 array( 'id' => 'fbd-filters-show-unanswered', 'value' => '1', 'class' => 'fbd-filters-check' ) );
123123
124 - $showUnansweredFilter = '<label for="fbd-filters-show-unanswered" id="fbd-filters-type-show-unanswered-label" class="fbd-filters-label">' .
125 - $showUnansweredCheckbox . $showUnansweredMsg . '</label>';
 124+ $showUnansweredFilter = $showUnansweredCheckbox . '<label for="fbd-filters-show-unanswered" id="fbd-filters-type-show-unanswered-label" class="fbd-filters-label">' .
 125+ $showUnansweredMsg . '</label>';
126126
127127 $leaderBoardElement = self::buildLeaderBoardElement();
128128
@@ -599,7 +599,7 @@
600600 // Do the actual query
601601 $desc = $backwards ? '' : ' DESC';
602602
603 - $table = array( 'moodbar_feedback', 'user' );
 603+ $table = array( );
604604 $option = array( 'LIMIT' => $limit + 2, 'ORDER BY' => "mbf_timestamp$desc, mbf_id$desc" );
605605 $tableJoin = array( 'user' => array( 'LEFT JOIN', 'user_id=mbf_user_id' ) );
606606
@@ -611,7 +611,7 @@
612612 if ( !$wgUser->isAnon() ) {
613613 $table[] = 'moodbar_feedback_response';
614614 $option['GROUP BY'] = 'mbf_id';
615 - $tableJoin['moodbar_feedback_response'] = array( 'INNER JOIN', 'mbf_id=mbfr_mbf_id' );
 615+ $conds[] = 'mbf_id=mbfr_mbf_id';
616616 $conds['mbfr_user_id'] = $wgUser->getId();
617617 }
618618 break;
@@ -624,6 +624,9 @@
625625 }
626626 }
627627
 628+ $table[] = 'moodbar_feedback';
 629+ $table[] = 'user';
 630+
628631 $res = $dbr->select( $table, array(
629632 'user_name', 'mbf_id', 'mbf_type',
630633 'mbf_timestamp', 'mbf_user_id', 'mbf_user_ip', 'mbf_comment',
Index: trunk/extensions/MoodBar/ApiQueryMoodBarComments.php
@@ -11,7 +11,6 @@
1212 $prop = array_flip( $params['prop'] );
1313
1414 // Build the query
15 - $this->addTables( array( 'moodbar_feedback', 'user' ) );
1615 $this->addJoinConds( array( 'user' => array( 'LEFT JOIN', 'user_id=mbf_user_id' ) ) );
1716 $this->addFields( array( 'user_name', 'mbf_id', 'mbf_type', 'mbf_timestamp', 'mbf_user_id', 'mbf_user_ip',
1817 'mbf_comment', 'mbf_hidden_state' ) );
@@ -42,7 +41,7 @@
4342 if ( isset( $params['myresponse'] ) ) {
4443 if ( !$wgUser->isAnon() ) {
4544 $this->addTables( array( 'moodbar_feedback_response' ) );
46 - $this->addJoinConds( array( 'moodbar_feedback_response' => array( 'INNER JOIN', 'mbf_id=mbfr_mbf_id' ) ) );
 45+ $this->addWhere( 'mbf_id=mbfr_mbf_id' );
4746 $this->addWhereFld( 'mbfr_user_id', $wgUser->getId() );
4847 $this->addOption( 'GROUP BY', 'mbf_id' );
4948 }
@@ -52,6 +51,8 @@
5352 $this->addWhere( array( 'mbfr_id' => null ) );
5453 }
5554
 55+ $this->addTables( array( 'moodbar_feedback', 'user' ) );
 56+
5657 if ( ! $wgUser->isAllowed( 'moodbar-admin' ) ) {
5758 $this->addWhereFld( 'mbf_hidden_state', 0 );
5859 }
Index: trunk/extensions/MoodBar/modules/ext.moodBar.dashboard/ext.moodBar.dashboard.css
@@ -37,7 +37,7 @@
3838 }
3939
4040 .fbd-filters-label {
41 - display: block;
 41+ display: inline;
4242 margin: 0.5em 0 0 0;
4343 padding: 0;
4444 font-weight: bold;

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r108187Adding "Show unanswered" filter to feedback dashboardbsitu00:05, 6 January 2012

Status & tagging log