Merge branch 'MDL-63426-master' of https://github.com/lucaboesch/moodle
[moodle.git] / enrol / upgrade.txt
blob09ff3baf9bd8a9a775309d482e3508fb504cdbc6
1 This files describes API changes in /enrol/* - plugins,
2 information provided here is intended especially for developers.
4 === 3.5 ===
6 * Default sorting in enrol_get_my_courses(), enrol_get_all_users_courses() and enrol_get_users_courses() now respects
7   the site setting "navsortmycoursessort" and should be consistently used when displaying the courses in the UI.
9 === 3.4 ===
11 * render_course_enrolment_users_table method has been removed from the renderer. The enrolled users page is now
12   combined with the participants page. /enrol/users.php no longer exists.
14 === 3.3 ===
16 * External function core_enrol_external::get_users_courses now return the user progress, start and the end course dates.
18 === 3.2 ===
20 * External function core_enrol_external::get_users_courses now return the category id as an additional optional field.
22 === 3.1 ===
24 * core_enrol_external::get_enrolled_users now supports two additional parameters for ordering: sortby and sortdirection.
25 * Enrolment plugins UI have been consolidated. Plugins can implement use_standard_editing_ui() function
26   and add edit_instance_form() and edit_instance_validation() methods instead of providing their own edit.php and form.
27   They can then rely on the default implementation of get_action_icons and get_course_navigation. In future this will
28   mean they can be called by webservices/user upload tools because they can validate their data.
30 === 3.0 ===
32 * Added new events enrol_instance_created, enrol_instance_updated and
33   enrol_instance_deleted . Always trigger them when changing records in the
34   DB table 'enrol'.
35 * Constant CACHE_COURSE_CONTACTS_TTL was deleted.
36 * External function core_enrol_external::get_enrolled_users now returns only the viewable participants if the course has groups enabled and no groupid is passed.
38 === 2.9 ===
40 * External function core_enrol_external::get_users_courses now returns additional optional fields:
41    - summary: Course summary.
42    - summaryformat: Course summary format.
43    - format: Course format.
44    - showgrades: True if grades are shown, otherwise false.
45    - lang: Forced course language.
46    - enablecompletion: Control or not via completion and activity settings.
48 === 2.8 ===
50 * enrol_plugin::instance_deleteable() is deprecated and has been replaced by enrol_plugin::can_delete_instance()
51 * enrol_plugin::can_hide_show_instance() is a new function to control who can hide/show enrolment instances.
52   Returns true by default but plugins must implement their own logic.
54 === 2.6 ===
56 * Enrolment plugin which supports self enrolment should implement can_self_enrol()
57 * Enrolment plugin should implement get_enrol_info() to expose instance information
58   with webservice or external interface.
59 * Webservice core_enrol_get_enrolled_users_with_capability was incorrectly specifing
60   float as the return type for user id. int is the actual returned type and is now
61   reported as such.
63 === 2.5 ===
65 * plugins may use general enrol/editenrolment.php page to let users edit
66   enrolments manually
67 * new support for grade recovery in enrol_plugin::enrol_user() method
69 === 2.4 ===
71 required changes in code:
72 * use role_get_name() or role_fix_names() if you need any role names, using role.name
73   directly from database is not correct any more
74 * new restore support: ENROL_RESTORE_EXACT, ENROL_RESTORE_NOUSERS
75   and ENROL_RESTORE_CLASS were removed, implement new restore_* plugin methods instead
77 other changes and new features:
78 * course enrolment manager now works with disabled plugins too
79 * new support for protected group membership linked to enrol instance
80 * new support for expiry notifications - see enrol_plugin::send_expiry_notifications() method
83 === 2.2 ===
85 required changes in code:
86 * load_temp_role() is deprecated, use load_temp_course_role() instead, temp role not loaded
87 * remove_temp_role() is deprecated, use remove_temp_course_roles() instead
88 * 'user_unenrol_modified' event was renamed to 'user_enrol_modified'
91 === 2.0 ===
93 required changes in code:
94 * enrolment plugins need to be rewritten to use new API - see inline phpdocs and official plugins