| @@ 1666-1677 (lines=12) @@ | ||
| 1663 | } |
|
| 1664 | ||
| 1665 | if (!empty($groupId)) { |
|
| 1666 | if (!api_is_allowed_to_edit()) { |
|
| 1667 | $user_id = api_get_user_id(); |
|
| 1668 | $group_memberships = GroupManager::get_group_ids( |
|
| 1669 | $course_id, |
|
| 1670 | $user_id |
|
| 1671 | ); |
|
| 1672 | } else { |
|
| 1673 | $group_memberships = GroupManager::get_group_ids( |
|
| 1674 | $course_id, |
|
| 1675 | $user_id |
|
| 1676 | ); |
|
| 1677 | } |
|
| 1678 | } else { |
|
| 1679 | // if no group was defined but I am a student reviewing his agenda, |
|
| 1680 | // group events should show, so we should fetch those groups to which |
|
| @@ 1678-1696 (lines=19) @@ | ||
| 1675 | $user_id |
|
| 1676 | ); |
|
| 1677 | } |
|
| 1678 | } else { |
|
| 1679 | // if no group was defined but I am a student reviewing his agenda, |
|
| 1680 | // group events should show, so we should fetch those groups to which |
|
| 1681 | // I belong |
|
| 1682 | if (!api_is_allowed_to_edit()) { |
|
| 1683 | $user_id = api_get_user_id(); |
|
| 1684 | $group_memberships = GroupManager::get_group_ids( |
|
| 1685 | $course_id, |
|
| 1686 | $user_id |
|
| 1687 | ); |
|
| 1688 | } else { |
|
| 1689 | // If no group was defined and I am a teacher/admin reviewing |
|
| 1690 | // someone else's agenda, we should fetch this person's groups |
|
| 1691 | $group_memberships = GroupManager::get_group_ids( |
|
| 1692 | $course_id, |
|
| 1693 | $user_id |
|
| 1694 | ); |
|
| 1695 | } |
|
| 1696 | } |
|
| 1697 | ||
| 1698 | $tlb_course_agenda = Database::get_course_table(TABLE_AGENDA); |
|
| 1699 | $tbl_property = Database::get_course_table(TABLE_ITEM_PROPERTY); |
|