mirror of
https://github.com/moodle/moodle.git
synced 2025-04-14 13:02:07 +02:00
MDL-12505 do not leak separate groups info in advanced search user selection and other fixes; merged from MOODLE_19_STABLE
This commit is contained in:
parent
80775ff30c
commit
4692da473f
@ -171,7 +171,7 @@
|
||||
case 'datedesc' : usort($activities, 'compare_activities_by_time_desc'); break;
|
||||
case 'dateasc' : usort($activities, 'compare_activities_by_time_asc'); break;
|
||||
case 'default' :
|
||||
default : $detail = false; $sortby = 'default';
|
||||
default : $detail = false; $param->sortby = 'default';
|
||||
|
||||
}
|
||||
|
||||
@ -190,17 +190,18 @@
|
||||
|
||||
foreach ($activities as $key => $activity) {
|
||||
|
||||
// peak at next activity. If it's another section, don't print this one!
|
||||
// this means there are no activities in the current section
|
||||
if (($activity->type == 'section') &&
|
||||
(($activity_count == ($key + 1)) ||
|
||||
($activities[$key+1]->type == 'section'))) {
|
||||
|
||||
continue;
|
||||
|
||||
if ($activity->type == 'section') {
|
||||
if ($param->sortby != 'default') {
|
||||
continue; // no section if ordering by date
|
||||
}
|
||||
if ($activity_count == ($key + 1) or $activities[$key+1]->type == 'section') {
|
||||
// peak at next activity. If it's another section, don't print this one!
|
||||
// this means there are no activities in the current section
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (($activity->type == 'section') && ($sortby == 'default')) {
|
||||
if (($activity->type == 'section') && ($param->sortby == 'default')) {
|
||||
if ($inbox) {
|
||||
print_simple_box_end();
|
||||
print_spacer(30);
|
||||
@ -211,7 +212,7 @@
|
||||
|
||||
} else if ($activity->type == 'activity') {
|
||||
|
||||
if ($sortby == 'default') {
|
||||
if ($param->sortby == 'default') {
|
||||
$cm = $modinfo->cms[$activity->cmid];
|
||||
|
||||
if ($cm->visible) {
|
||||
|
@ -27,7 +27,14 @@ class recent_form extends moodleform {
|
||||
$options[$guest->id] = fullname($guest);
|
||||
}
|
||||
|
||||
if ($courseusers = get_users_by_capability($context, 'moodle/course:view', 'u.id, u.firstname, u.lastname', 'lastname ASC, firstname DESC')) {
|
||||
if (groups_get_course_groupmode($COURSE) == SEPARATEGROUPS) {
|
||||
$groups = groups_get_user_groups($COURSE->id);
|
||||
$groups = $groups[0];
|
||||
} else {
|
||||
$groups = '';
|
||||
}
|
||||
|
||||
if ($courseusers = get_users_by_capability($context, 'moodle/course:view', 'u.id, u.firstname, u.lastname', 'lastname ASC, firstname DESC', '', '', $groups)) {
|
||||
foreach ($courseusers as $courseuser) {
|
||||
$options[$courseuser->id] = fullname($courseuser, $viewfullnames);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user