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