| @@ 1447-1458 (lines=12) @@ | ||
| 1444 | } |
|
| 1445 | ||
| 1446 | if (!empty($groupId)) { |
|
| 1447 | if (!api_is_allowed_to_edit()) { |
|
| 1448 | $user_id = api_get_user_id(); |
|
| 1449 | $group_memberships = GroupManager::get_group_ids( |
|
| 1450 | $course_id, |
|
| 1451 | $user_id |
|
| 1452 | ); |
|
| 1453 | } else { |
|
| 1454 | $group_memberships = GroupManager::get_group_ids( |
|
| 1455 | $course_id, |
|
| 1456 | $user_id |
|
| 1457 | ); |
|
| 1458 | } |
|
| 1459 | } else { |
|
| 1460 | // if no group was defined but I am a student reviewing his agenda, |
|
| 1461 | // group events should show, so we should fetch those groups to which |
|
| @@ 1459-1477 (lines=19) @@ | ||
| 1456 | $user_id |
|
| 1457 | ); |
|
| 1458 | } |
|
| 1459 | } else { |
|
| 1460 | // if no group was defined but I am a student reviewing his agenda, |
|
| 1461 | // group events should show, so we should fetch those groups to which |
|
| 1462 | // I belong |
|
| 1463 | if (!api_is_allowed_to_edit()) { |
|
| 1464 | $user_id = api_get_user_id(); |
|
| 1465 | $group_memberships = GroupManager::get_group_ids( |
|
| 1466 | $course_id, |
|
| 1467 | $user_id |
|
| 1468 | ); |
|
| 1469 | } else { |
|
| 1470 | // If no group was defined and I am a teacher/admin reviewing |
|
| 1471 | // someone else's agenda, we should fetch this person's groups |
|
| 1472 | $group_memberships = GroupManager::get_group_ids( |
|
| 1473 | $course_id, |
|
| 1474 | $user_id |
|
| 1475 | ); |
|
| 1476 | } |
|
| 1477 | } |
|
| 1478 | ||
| 1479 | $tlb_course_agenda = Database::get_course_table(TABLE_AGENDA); |
|
| 1480 | $tbl_property = Database::get_course_table(TABLE_ITEM_PROPERTY); |
|