mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 17:36:38 +02:00
Merge branch 'MDL-31973-master-6' of git://git.luns.net.uk/moodle
Conflicts: lib/db/upgrade.php
This commit is contained in:
commit
238f7761af
14 changed files with 161 additions and 7 deletions
|
@ -578,6 +578,12 @@ abstract class user_selector_base {
|
|||
unset($this->selected[$user->id]);
|
||||
$output .= ' <option' . $attributes . ' value="' . $user->id . '">' .
|
||||
$this->output_user($user) . "</option>\n";
|
||||
if (!empty($user->infobelow)) {
|
||||
// 'Poor man's indent' here is because CSS styles do not work
|
||||
// in select options, except in Firefox.
|
||||
$output .= ' <option disabled="disabled" class="userselector-infobelow">' .
|
||||
' ' . s($user->infobelow) . '</option>';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$output = ' <optgroup label="' . htmlspecialchars($groupname) . '">' . "\n";
|
||||
|
@ -712,6 +718,10 @@ abstract class groups_user_selector_base extends user_selector_base {
|
|||
foreach ($groupedusers[$groupname] as &$user) {
|
||||
unset($user->roles);
|
||||
$user->fullname = fullname($user);
|
||||
if (!empty($user->component)) {
|
||||
$user->infobelow = get_string('addedby', 'group',
|
||||
get_string('pluginname', $user->component));
|
||||
}
|
||||
}
|
||||
}
|
||||
return $groupedusers;
|
||||
|
@ -726,8 +736,8 @@ class group_members_selector extends groups_user_selector_base {
|
|||
public function find_users($search) {
|
||||
list($wherecondition, $params) = $this->search_sql($search, 'u');
|
||||
$roles = groups_get_members_by_role($this->groupid, $this->courseid,
|
||||
$this->required_fields_sql('u'), 'u.lastname, u.firstname',
|
||||
$wherecondition, $params);
|
||||
$this->required_fields_sql('u') . ', gm.component',
|
||||
'u.lastname, u.firstname', $wherecondition, $params);
|
||||
return $this->convert_array_format($roles, $search);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -240,6 +240,11 @@ M.core_user.init_user_selector = function (Y, name, hash, extrafields, lastsearc
|
|||
option.set('selected', false);
|
||||
}
|
||||
optgroup.append(option);
|
||||
if (user.infobelow) {
|
||||
extraoption = Y.Node.create('<option disabled="disabled" class="userselector-infobelow"/>');
|
||||
extraoption.appendChild(document.createTextNode(user.infobelow));
|
||||
optgroup.append(extraoption);
|
||||
}
|
||||
count++;
|
||||
}
|
||||
|
||||
|
|
|
@ -87,6 +87,9 @@ foreach ($users as &$group) {
|
|||
if (!empty($user->disabled)) {
|
||||
$output->disabled = true;
|
||||
}
|
||||
if (!empty($user->infobelow)) {
|
||||
$output->infobelow = $user->infobelow;
|
||||
}
|
||||
$group[$user->id] = $output;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue