Skip to content

Calendar: Migrate course event recipients and filter to Vue, redirect the legacy agenda - #9339

Open
AngelFQC wants to merge 11 commits into
chamilo:masterfrom
AngelFQC:calendar/agenda-legacy-step2
Open

AngelFQC wants to merge 11 commits into
chamilo:masterfrom
AngelFQC:calendar/agenda-legacy-step2

Conversation

@AngelFQC

Copy link
Copy Markdown
Member

Step 2 of #9337: the course-event features the legacy agenda still had are now in the Vue agenda, and the legacy agenda page redirects to it.

Changes

  • Visibility fix. No layer filtered resource_links.user, so a course event sent to one user (for example, one created with the legacy agenda.php) was visible to the whole course, and the personal agenda listed events sent to other users and to other groups. A learner now sees the events of the whole course, of their groups, and the events sent to them, as in Agenda::getCourseEvents(). Teachers see all of them. Outside a group, GroupContextQueryExtension no longer hides the events of the learner's groups (only for CCalendarEvent).
  • Recipient validation. AgendaHelper::canAddLinks() rejects a uid that is not subscribed to the course (or to the course in the session) and a gid of another course.
  • Send to. Teachers choose users and groups when they create or edit a course event. There is a new GET /api/calendar/course-recipients endpoint (teachers only). courseRecipients in the PUT replaces the links of the event in the current course. ResourceListener keeps the gid of a single-link calendar event outside a group context; the CREATE voter validates it first.
  • Filter. recipient=USER:<id>|GROUP:<id> lists the events sent to one user or group. It only has an effect for course editors. The selector is shown in the month view and in the list view.
  • Redirects. calendar/agenda_js.php redirects by type (admin/platform → ?type=global). my_space/calendar_plan.php, which was already broken on master, redirects to the personal agenda, and its links were removed. inc/ajax/agenda.ajax.php and agenda/month.html.twig were deleted (both are in UPDATE-METADATA.json).

Tests

  • tests/CoreBundle/Api/CCalendarEventRecipientApiTest.php: 11 tests covering visibility per role, recipient validation, editing recipients, the filter and the recipient endpoint. The visibility and validation tests fail without the fix.
  • Playwright: calendarCourseRecipients.feature (new) and agendaLegacyRedirects.feature (extended).
  • Documentation: 3.x/en/teacher-guide/additional-tools/agenda.md in the docs repository (all branch).

Out of scope

  • CCalendarEventVoter lets only the creator edit an event, so another teacher of the course cannot edit it.
  • A learner with allow_user_edit_agenda can send links with uid/gid through the API. The legacy form did not show the selector to learners.

🤖 Generated with Claude Code

@codecov

codecov Bot commented Oct 27, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.56757% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 19.17%. Comparing base (06629ed) to head (ecaee8b).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
...DataProvider/Extension/CCalendarEventExtension.php 92.00% 4 Missing ⚠️
src/CoreBundle/Helpers/AgendaHelper.php 86.95% 3 Missing ⚠️
...ndle/Controller/Api/UpdateCCalendarEventAction.php 94.59% 2 Missing ⚠️
...reBundle/State/CalendarEventRecipientsProvider.php 94.11% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #9339      +/-   ##
============================================
+ Coverage     19.12%   19.17%   +0.05%     
- Complexity    63847    63909      +62     
============================================
  Files          2591     2592       +1     
  Lines        238077   238222     +145     
============================================
+ Hits          45523    45672     +149     
+ Misses       192554   192550       -4     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@AngelFQC AngelFQC linked an issue Oct 27, 2026 that may be closed by this pull request
6 of 21 tasks

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Calendar: Replace the legacy agenda pages with redirects to the Vue agenda

1 participant