MDL-9059, fixing students can't view group entries in calendar

This commit is contained in:
toyomoyo
2007-10-11 07:59:23 +00:00
parent 3dda8f3cf3
commit 7f4ea06814
2 changed files with 4 additions and 3 deletions
+3 -2
View File
@@ -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
+1 -1
View File
@@ -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;
}