MDL-48248 enrol_manual: Ensure that the default value is always selected
This commit is contained in:
@@ -89,6 +89,9 @@ if ($extendperiod) {
|
||||
} else {
|
||||
$defaultperiod = $instance->enrolperiod;
|
||||
}
|
||||
if (!isset($periodmenu[$defaultperiod])) {
|
||||
$periodmenu[$defaultperiod] = get_string('numdays', '', floor($defaultperiod / DAYSECS));
|
||||
}
|
||||
if (empty($extendbase)) {
|
||||
if (!$extendbase = get_config('enrol_manual', 'enrolstart')) {
|
||||
// Default to now if there is no system setting.
|
||||
|
||||
@@ -237,6 +237,10 @@ YUI.add('moodle-enrol_manual-quickenrolment', function(Y) {
|
||||
}
|
||||
select.append(option);
|
||||
}
|
||||
if (!index) {
|
||||
select.append(create('<option value="'+defaultvalue+'">'+durationdays.replace('{a}', defaultvalue)+'</option>'));
|
||||
index = ++count;
|
||||
}
|
||||
select.set('selectedIndex', index);
|
||||
},
|
||||
getAssignableRoles : function(){
|
||||
|
||||
Reference in New Issue
Block a user