Permalink
Browse files

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

  • Loading branch information...
toyomoyo
toyomoyo committed Oct 11, 2007
1 parent 3dda8f3 commit 7f4ea06814abeda07c2ca0cfe4cc22da4f694483
Showing with 4 additions and 3 deletions.
  1. +3 −2 calendar/lib.php
  2. +1 −1 group/lib/basicgrouplib.php
View
@@ -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;
}

0 comments on commit 7f4ea06

Please sign in to comment.