Index: trunk/extensions/EducationProgram/maintenance/importWEPData.php |
— | — | @@ -72,9 +72,9 @@ |
73 | 73 | $courseIds = $this->insertCourses( $courses, $orgs ); |
74 | 74 | echo "Inserted courses\n"; |
75 | 75 | |
76 | | - echo "Inserting students ...\n"; |
77 | | - $this->insertStudents( $students, $courseIds ); |
78 | | - echo "Inserted students\n"; |
| 76 | +// echo "Inserting students ...\n"; |
| 77 | +// $this->insertStudents( $students, $courseIds ); |
| 78 | +// echo "Inserted students\n"; |
79 | 79 | |
80 | 80 | echo "Import completed!\n\n"; |
81 | 81 | } |
Index: trunk/extensions/EducationProgram/includes/EPPager.php |
— | — | @@ -309,6 +309,19 @@ |
310 | 310 | } |
311 | 311 | |
312 | 312 | $this->addFilterValues( $filterOptions ); |
| 313 | + |
| 314 | + foreach ( $filterOptions as $key => $optionData ) { |
| 315 | + if ( array_key_exists( 'datatype', $optionData ) ) { |
| 316 | + switch ( $optionData['datatype'] ) { |
| 317 | + case 'int': |
| 318 | + $filterOptions[$key]['value'] = (int)$optionData['value']; |
| 319 | + break; |
| 320 | + case 'float': |
| 321 | + $filterOptions[$key]['value'] = (float)$optionData['value']; |
| 322 | + break; |
| 323 | + } |
| 324 | + } |
| 325 | + } |
313 | 326 | |
314 | 327 | if ( $hideWhenNoResults && $this->getNumRows() < 1 ) { |
315 | 328 | $noFiltersSet = array_reduce( $filterOptions, function( $current, array $data ) { |
— | — | @@ -364,30 +377,18 @@ |
365 | 378 | * @since 0.1 |
366 | 379 | * |
367 | 380 | * @param array $filterOptions |
368 | | - * @param boolean $cast Should values with non-string type be casted (ie to have a select with int values have the correct val selected). |
369 | 381 | * |
370 | 382 | * @return boolean If anything was changed from the default |
371 | 383 | */ |
372 | | - protected function addFilterValues( array &$filterOptions, $cast = true ) { |
| 384 | + protected function addFilterValues( array &$filterOptions ) { |
373 | 385 | $req = $this->getRequest(); |
374 | 386 | $changed = false; |
375 | 387 | |
376 | 388 | foreach ( $filterOptions as $optionName => &$optionData ) { |
377 | 389 | if ( $req->getCheck( $this->filterPrefix . $optionName ) ) { |
378 | 390 | $optionData['value'] = $req->getVal( $this->filterPrefix . $optionName ); |
379 | | - |
380 | | - if ( $cast && array_key_exists( 'datatype', $optionData ) ) { |
381 | | - switch ( $optionData['datatype'] ) { |
382 | | - case 'int': |
383 | | - $optionData['value'] = (int)$optionData['value']; |
384 | | - break; |
385 | | - case 'float': |
386 | | - $optionData['value'] = (float)$optionData['value']; |
387 | | - break; |
388 | | - } |
389 | | - } |
390 | | - |
391 | | - if ( array_key_exists( $optionName, $_POST ) && $optionData['value'] !== '' ) { |
| 391 | + |
| 392 | + if ( array_key_exists( $optionName, $_POST ) ) { |
392 | 393 | $req->setSessionData( $this->getNameForSession( $optionName ), $optionData['value'] ); |
393 | 394 | } |
394 | 395 | |