mirror of
https://github.com/moodle/moodle.git
synced 2025-03-09 10:19:56 +01:00
Merge branch 'w07_MDL-25998_20_enrolrole' of git://github.com/skodak/moodle
This commit is contained in:
commit
0db846acda
@ -632,12 +632,14 @@ class course_enrolment_users_table extends course_enrolment_table {
|
||||
|
||||
$instances = $this->manager->get_enrolment_instances();
|
||||
$plugins = $this->manager->get_enrolment_plugins();
|
||||
$manuals = array();
|
||||
// print enrol link or selection
|
||||
$links = array();
|
||||
foreach($instances as $instance) {
|
||||
$plugin = $plugins[$instance->enrol];
|
||||
if ($link = $plugin->get_manual_enrol_link($instance)) {
|
||||
$links[$instance->id] = $link;
|
||||
$manuals[$instance->id] = $instance;
|
||||
}
|
||||
}
|
||||
if (!empty($links)) {
|
||||
@ -671,6 +673,7 @@ class course_enrolment_users_table extends course_enrolment_table {
|
||||
$startdateoptions[3] = get_string('today') . ' (' . userdate($today, $timeformat) . ')' ;
|
||||
|
||||
if ($count == 1) {
|
||||
$instance = reset($manuals);
|
||||
$page->requires->strings_for_js(array(
|
||||
'ajaxoneuserfound',
|
||||
'ajaxxusersfound',
|
||||
@ -697,7 +700,7 @@ class course_enrolment_users_table extends course_enrolment_table {
|
||||
'ajaxurl'=>'/enrol/ajax.php',
|
||||
'url'=>$url->out(false),
|
||||
'optionsStartDate'=>$startdateoptions,
|
||||
'defaultRole'=>get_config('enrol_manual', 'roleid'));
|
||||
'defaultRole'=>$instance->roleid);
|
||||
$page->requires->yui_module($modules, $function, array($arguments));
|
||||
}
|
||||
return $control;
|
||||
|
Loading…
x
Reference in New Issue
Block a user