MDL-9059, fixing students can't view group entries in calendar
This commit is contained in:
+3
-2
@@ -1198,11 +1198,12 @@ function calendar_set_filters(&$courses, &$group, &$user, $courseeventsfrom = NU
|
||||
else if(isset($USER->groupmember[$courseid])) {
|
||||
//changed to 2D array
|
||||
foreach ($USER->groupmember[$courseid] as $groupid){
|
||||
$grouparray[] = $groupid;
|
||||
$rec = get_record('groups_courses_groups', 'courseid', $courseid, 'groupid', $groupid);
|
||||
//$grouparray[] = $groupid;
|
||||
$grouparray[] = $rec->id;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($groupids)) {
|
||||
$sql = "SELECT id, groupid
|
||||
FROM {$CFG->prefix}groups_courses_groups
|
||||
|
||||
@@ -94,7 +94,7 @@ function groups_get_all_groups_for_user($userid) {
|
||||
// Put the results into an array. TODO: check.
|
||||
$groupids = array();
|
||||
foreach ($groups as $group) {
|
||||
array_push($groupids, $group->id);
|
||||
array_push($groupids, $group->groupid);
|
||||
}
|
||||
return $groupids;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user