| @@ 1430-1441 (lines=12) @@ | ||
| 1427 | } |
|
| 1428 | ||
| 1429 | if (!empty($groupId)) { |
|
| 1430 | if (!api_is_allowed_to_edit()) { |
|
| 1431 | $user_id = api_get_user_id(); |
|
| 1432 | $group_memberships = GroupManager::get_group_ids( |
|
| 1433 | $course_id, |
|
| 1434 | $user_id |
|
| 1435 | ); |
|
| 1436 | } else { |
|
| 1437 | $group_memberships = GroupManager::get_group_ids( |
|
| 1438 | $course_id, |
|
| 1439 | $user_id |
|
| 1440 | ); |
|
| 1441 | } |
|
| 1442 | } else { |
|
| 1443 | // if no group was defined but I am a student reviewing his agenda, |
|
| 1444 | // group events should show, so we should fetch those groups to which |
|
| @@ 1442-1460 (lines=19) @@ | ||
| 1439 | $user_id |
|
| 1440 | ); |
|
| 1441 | } |
|
| 1442 | } else { |
|
| 1443 | // if no group was defined but I am a student reviewing his agenda, |
|
| 1444 | // group events should show, so we should fetch those groups to which |
|
| 1445 | // I belong |
|
| 1446 | if (!api_is_allowed_to_edit()) { |
|
| 1447 | $user_id = api_get_user_id(); |
|
| 1448 | $group_memberships = GroupManager::get_group_ids( |
|
| 1449 | $course_id, |
|
| 1450 | $user_id |
|
| 1451 | ); |
|
| 1452 | } else { |
|
| 1453 | // If no group was defined and I am a teacher/admin reviewing |
|
| 1454 | // someone else's agenda, we should fetch this person's groups |
|
| 1455 | $group_memberships = GroupManager::get_group_ids( |
|
| 1456 | $course_id, |
|
| 1457 | $user_id |
|
| 1458 | ); |
|
| 1459 | } |
|
| 1460 | } |
|
| 1461 | ||
| 1462 | $tlb_course_agenda = Database::get_course_table(TABLE_AGENDA); |
|
| 1463 | $tbl_property = Database::get_course_table(TABLE_ITEM_PROPERTY); |
|