Index: trunk/extensions/Contest/Contest.i18n.php |
— | — | @@ -154,6 +154,7 @@ |
155 | 155 | 'contest-contestant-title' => 'Contestant $1 ($2)', |
156 | 156 | 'contest-contestant-header-id' => 'Contestant ID', |
157 | 157 | 'contest-contestant-header-contest' => 'Contest name', |
| 158 | + 'contest-contestant-header-challenge' => 'Challenge name', |
158 | 159 | 'contest-contestant-header-submission' => 'Submission link', |
159 | 160 | 'contest-contestant-header-country' => 'Contestant country', |
160 | 161 | 'contest-contestant-header-wmf' => 'Interested in WMF job', |
Index: trunk/extensions/Contest/specials/SpecialContestant.php |
— | — | @@ -105,6 +105,9 @@ |
106 | 106 | $stats['id'] = htmlspecialchars( $contestant->getField( 'id' ) ); |
107 | 107 | $stats['contest'] = htmlspecialchars( $contestant->getContest()->getField( 'name' ) ); |
108 | 108 | |
| 109 | + $challengeTitles = ContestChallenge::getTitlesForIds( $contestant->getField( 'challenge_id' ) ); |
| 110 | + $stats['challenge'] = htmlspecialchars( $challengeTitles[$contestant->getField( 'challenge_id' )] ); |
| 111 | + |
109 | 112 | if ( $contestant->getField( 'submission' ) === '' ) { |
110 | 113 | $stats['submission'] = wfMsg( 'contest-contestant-notsubmitted' ); |
111 | 114 | } |
Index: trunk/extensions/Contest/includes/ContestChallenge.php |
— | — | @@ -104,4 +104,23 @@ |
105 | 105 | ); |
106 | 106 | } |
107 | 107 | |
| 108 | + /** |
| 109 | + * Returns an array with challenge IDs (keys) and their associated titles (values) |
| 110 | + * for the provided list of IDs. |
| 111 | + * |
| 112 | + * @param array|integer $ids |
| 113 | + * |
| 114 | + * @return array( id => title ) |
| 115 | + */ |
| 116 | + public static function getTitlesForIds( $ids ) { |
| 117 | + $challenges = self::s()->select( array( 'id', 'title' ), array( 'id' => $ids ) ); |
| 118 | + $results = array(); |
| 119 | + |
| 120 | + foreach ( $challenges as /* ContestChallenge */ $challenge ) { |
| 121 | + $results[$challenge->getId()] = $challenge->getField( 'title' ); |
| 122 | + } |
| 123 | + |
| 124 | + return $results; |
| 125 | + } |
| 126 | + |
108 | 127 | } |