From aa8909f479cea7f26580179342d924f3bad5f232 Mon Sep 17 00:00:00 2001 From: Damyon Wiese Date: Wed, 28 Jun 2017 10:11:06 +0800 Subject: [PATCH] MDL-59365 enrol: Make select users first This is the most important element in the form - make it first. --- enrol/manual/classes/enrol_users_form.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/enrol/manual/classes/enrol_users_form.php b/enrol/manual/classes/enrol_users_form.php index f5e9c8fca56..f7c9ee85f89 100644 --- a/enrol/manual/classes/enrol_users_form.php +++ b/enrol/manual/classes/enrol_users_form.php @@ -94,12 +94,6 @@ class enrol_manual_enrol_users_form extends moodleform { $basemenu[4] = get_string('now', 'enrol_manual') . ' (' . userdate($now, get_string('strftimedatetimeshort')) . ')'; $mform->addElement('header', 'main', get_string('enrolmentoptions', 'enrol')); - $roles = get_assignable_roles($context); - $mform->addElement('select', 'role', get_string('assignrole', 'enrol_manual'), $roles); - $keys = array_keys($roles); - $defaultrole = end($keys); - $mform->setDefault('role', $defaultrole); - $options = array( 'ajax' => 'enrol_manual/form-potential-user-selector', 'multiple' => true, @@ -111,6 +105,12 @@ class enrol_manual_enrol_users_form extends moodleform { $options = ['contextid' => $context->id, 'multiple' => true]; $mform->addElement('cohort', 'cohortlist', get_string('selectcohorts', 'enrol_manual'), $options); + $roles = get_assignable_roles($context); + $mform->addElement('select', 'role', get_string('assignrole', 'enrol_manual'), $roles); + $keys = array_keys($roles); + $defaultrole = end($keys); + $mform->setDefault('role', $defaultrole); + $mform->addAdvancedStatusElement('main'); $mform->addElement('checkbox', 'recovergrades', get_string('recovergrades', 'enrol'));