1 This files describes API changes in /calendar/* ,
2 information provided here is intended especially for developers.
5 * Plugins can now create their own calendar events, both standard and action ones. To do it they need to specify
6 $event->component when creating an event. Component events can not be edited or deleted manually.
7 See https://docs.moodle.org/dev/Calendar_API#Component_events
8 * The following functions have been deprecated because they were no longer used:
9 - calendar_add_event_metadata()
10 - core_calendar_renderer::event()
11 * Updated calendar_can_manage_user_event() function to check permissions to user events.
14 * The following functions have been finally deprecated and can not be used anymore:
15 * calendar_wday_name()
16 * calendar_get_block_upcoming()
17 * calendar_print_month_selector()
20 * calendar_get_upcoming()
21 * Added core_calendar_external::get_timestamps(), which allows an array containing an arbitrary number of arrays of
22 date/time data to be converted and returned as timestamps, along with an optional key.
25 * calendar_get_default_courses() function now has optional $userid parameter.
26 * calendar_set_filters() function now has optional $user parameter.
27 * The core_calendar\local\event\container class now provides two new helper methods for getting and setting the requesting user:
28 set_requesting_user() and get_requesting_user().
29 * The following functions have been finally deprecated and can not be used anymore:
30 * calendar_preferences_button()
31 * added core_calendar_get_valid_event_timestart_range callback for course events when the update_event_start_day function is used
35 * core_calendar_external::get_calendar_events now returns the categoryid for category events.
38 * calendar_get_mini, and calendar_get_upcoming have been deprecated. Please update to use the new exporters and renderers.
39 * added core_calendar_get_valid_event_timestart_range and core_calendar_event_timestart_updated callbacks for module events
40 when the update_event_start_day function is used in the local api.
43 * calendar_event_hook() has been removed. Developers should be using the Moodle events system to achieve this behaviour,
44 rather than using a hacky calendar specific implementation.
45 * calendar_wday_name() is deprecated and no longer used in core.
46 * calendar_get_block_upcoming() is deprecated, please use block_calendar_upcoming::get_upcoming_content() instead.
47 * calendar_print_month_selector() is deprecated and no longer used in core.
48 * calendar_cron() is deprecated and should not be used. Please use the core\task\calendar_cron_task instead.
51 * calendar_preferences_button() is now deprecated. Calendar preferences have been moved to the user preferences page.
54 default values changes in code:
55 * core_calendar_external::get_calendar_events_parameters() 'timeend' default option changed; now, by default,
56 all events are returned, not only the past ones.
57 * calendar types need to be updated to be compatible with standard PHP date/time code
60 required changes in code:
61 * calendar_add_icalendar_event() now requires a valid subscriptionid
62 * calendar_process_subscription_row() throws exception for invalid subscriptionid
63 * calendar_update_subscription_events() now throws a dml_exception instead of moodle_exception for bad subscriptions
64 * calendar_get_mini() function now has optional $placement and $courseid paramaters.
66 optional - no changes needed:
67 * calendar_update_subscription() should now be used to update Ical subscriptions.
71 required changes in code:
73 * calendar_get_popup() function now just returns id, instead of the string "id=$id"