Index: trunk/extensions/EducationProgram/specials/SpecialEducationProgram.php |
— | — | @@ -197,10 +197,8 @@ |
198 | 198 | protected function getByTermTable( $terms ) { |
199 | 199 | $html = Html::openElement( 'table', array( 'class' => 'wikitable ep-termbreakdown' ) ); |
200 | 200 | |
201 | | - $term = array_shift( $terms ); |
202 | | - $rows = array_keys( $term ); |
203 | | - array_unshift( $terms, $term ); |
204 | | - |
| 201 | + reset( $terms ); |
| 202 | + $rows = array_keys( $terms[key( $terms )] ); |
205 | 203 | array_unshift( $rows, 'header' ); |
206 | 204 | |
207 | 205 | foreach ( $rows as $row ) { |
— | — | @@ -288,19 +286,19 @@ |
289 | 287 | } |
290 | 288 | |
291 | 289 | protected function getGenderDistribution( array $users, array $genders ) { |
292 | | - $distibution = array( 'unknown' => 0, 'male' => 0, 'female' => 0 ); |
| 290 | + $distribution = array( 'unknown' => 0, 'male' => 0, 'female' => 0 ); |
293 | 291 | |
294 | 292 | foreach ( $users as $userId ) { |
295 | | - $distibution[$genders[$userId]]++; |
| 293 | + $distribution[$genders[$userId]]++; |
296 | 294 | } |
297 | 295 | |
298 | 296 | $userCount = count( $users ); |
299 | 297 | |
300 | | - foreach ( $distibution as &$amount ) { |
| 298 | + foreach ( $distribution as &$amount ) { |
301 | 299 | $amount = $userCount === 0 ? 1 : $amount / $userCount; |
302 | 300 | } |
303 | 301 | |
304 | | - return $distibution; |
| 302 | + return $distribution; |
305 | 303 | } |
306 | 304 | |
307 | 305 | protected function getGenders( $userIds ) { |