Merge branch 'MDL-63683-master' of https://github.com/dravek/moodle

This commit is contained in:
Víctor Déniz 2020-12-09 12:48:34 +00:00
commit 8027c25085
7 changed files with 17 additions and 7 deletions

View File

@ -36,7 +36,7 @@ if ($ADMIN->fulltree) {
$student = get_archetype_roles('student');
$student = reset($student);
$settings->add(new admin_setting_configselect('enrol_cohort/roleid',
get_string('defaultrole', 'role'), '', $student->id, $options));
get_string('defaultrole', 'role'), '', $student->id ?? null, $options));
$options = array(
ENROL_EXT_REMOVED_UNENROL => get_string('extremovedunenrol', 'enrol'),

View File

@ -86,7 +86,11 @@ if ($ADMIN->fulltree) {
$options = get_default_enrol_roles(context_system::instance());
$student = get_archetype_roles('student');
$student = reset($student);
$settings->add(new admin_setting_configselect('enrol_database/defaultrole', get_string('defaultrole', 'enrol_database'), get_string('defaultrole_desc', 'enrol_database'), $student->id, $options));
$settings->add(new admin_setting_configselect('enrol_database/defaultrole',
get_string('defaultrole', 'enrol_database'),
get_string('defaultrole_desc', 'enrol_database'),
$student->id ?? null,
$options));
}
$settings->add(new admin_setting_configcheckbox('enrol_database/ignorehiddencourses', get_string('ignorehiddencourses', 'enrol_database'), get_string('ignorehiddencourses_desc', 'enrol_database'), 0));

View File

@ -71,7 +71,7 @@ if ($ADMIN->fulltree) {
$student = get_archetype_roles('student');
$student = reset($student);
$settings->add(new admin_setting_configselect('enrol_fee/roleid',
get_string('defaultrole', 'enrol_fee'), get_string('defaultrole_desc', 'enrol_fee'), $student->id, $options));
get_string('defaultrole', 'enrol_fee'), get_string('defaultrole_desc', 'enrol_fee'), $student->id ?? null, $options));
}
$settings->add(new admin_setting_configduration('enrol_fee/enrolperiod',

View File

@ -63,7 +63,7 @@ if ($ADMIN->fulltree) {
$student = get_archetype_roles('student');
$student = reset($student);
$settings->add(new admin_setting_configselect('enrol_manual/roleid',
get_string('defaultrole', 'role'), '', $student->id, $options));
get_string('defaultrole', 'role'), '', $student->id ?? null, $options));
}
$options = array(2 => get_string('coursestart'), 3 => get_string('today'), 4 => get_string('now', 'enrol_manual'));

View File

@ -36,6 +36,6 @@ if ($ADMIN->fulltree) {
$student = reset($student);
$settings->add(new admin_setting_configselect_with_advanced('enrol_mnet/roleid',
get_string('defaultrole', 'role'), '',
array('value'=>$student->id, 'adv'=>true), $options));
array('value' => $student->id ?? null, 'adv' => true), $options));
}
}

View File

@ -66,7 +66,10 @@ if ($ADMIN->fulltree) {
$student = get_archetype_roles('student');
$student = reset($student);
$settings->add(new admin_setting_configselect('enrol_paypal/roleid',
get_string('defaultrole', 'enrol_paypal'), get_string('defaultrole_desc', 'enrol_paypal'), $student->id, $options));
get_string('defaultrole', 'enrol_paypal'),
get_string('defaultrole_desc', 'enrol_paypal'),
$student->id ?? null,
$options));
}
$settings->add(new admin_setting_configduration('enrol_paypal/enrolperiod',

View File

@ -79,7 +79,10 @@ if ($ADMIN->fulltree) {
$student = get_archetype_roles('student');
$student = reset($student);
$settings->add(new admin_setting_configselect('enrol_self/roleid',
get_string('defaultrole', 'enrol_self'), get_string('defaultrole_desc', 'enrol_self'), $student->id, $options));
get_string('defaultrole', 'enrol_self'),
get_string('defaultrole_desc', 'enrol_self'),
$student->id ?? null,
$options));
}
$settings->add(new admin_setting_configduration('enrol_self/enrolperiod',