Merge branch 'w02_MDL-35899_m25_cohortsort' of git://github.com/skodak/moodle

This commit is contained in:
Dan Poltawski 2013-01-16 11:09:21 +08:00
commit 47ee9f9100
2 changed files with 3 additions and 1 deletions

View File

@ -77,6 +77,8 @@ switch ($action) {
$offset = optional_param('offset', 0, PARAM_INT);
$search = optional_param('search', '', PARAM_RAW);
$outcome->response = enrol_cohort_search_cohorts($manager, $offset, 25, $search);
// Some browsers reorder collections by key.
$outcome->response['cohorts'] = array_values($outcome->response['cohorts']);
break;
case 'enrolcohort':
require_capability('moodle/course:enrolconfig', $context);

View File

@ -229,7 +229,7 @@ YUI.add('moodle-enrol_cohort-quickenrolment', function(Y) {
var rawcohorts = response.cohorts;
var cohorts = [], i=0;
for (i in rawcohorts) {
cohorts[rawcohorts[i].cohortid] = new COHORT(rawcohorts[i]);
cohorts[i] = new COHORT(rawcohorts[i]);
}
this.set(COHORTS, cohorts);
},