Merge branch 'MDL-61781-33' of https://github.com/lucaboesch/moodle into MOODLE_33_STABLE
[moodle.git] / enrol / upgrade.txt
blobf170c7ab625ce0f4b9b3baaf10a75c5cb23a4c95
1 This files describes API changes in /enrol/* - plugins,
2 information provided here is intended especially for developers.
4 === 3.3 ===
6 * External function core_enrol_external::get_users_courses now return the user progress, start and the end course dates.
8 === 3.2 ===
10 * External function core_enrol_external::get_users_courses now return the category id as an additional optional field.
12 === 3.1 ===
14 * core_enrol_external::get_enrolled_users now supports two additional parameters for ordering: sortby and sortdirection.
15 * Enrolment plugins UI have been consolidated. Plugins can implement use_standard_editing_ui() function
16   and add edit_instance_form() and edit_instance_validation() methods instead of providing their own edit.php and form.
17   They can then rely on the default implementation of get_action_icons and get_course_navigation. In future this will
18   mean they can be called by webservices/user upload tools because they can validate their data.
20 === 3.0 ===
22 * Added new events enrol_instance_created, enrol_instance_updated and
23   enrol_instance_deleted . Always trigger them when changing records in the
24   DB table 'enrol'.
25 * Constant CACHE_COURSE_CONTACTS_TTL was deleted.
26 * 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.
28 === 2.9 ===
30 * External function core_enrol_external::get_users_courses now returns additional optional fields:
31    - summary: Course summary.
32    - summaryformat: Course summary format.
33    - format: Course format.
34    - showgrades: True if grades are shown, otherwise false.
35    - lang: Forced course language.
36    - enablecompletion: Control or not via completion and activity settings.
38 === 2.8 ===
40 * enrol_plugin::instance_deleteable() is deprecated and has been replaced by enrol_plugin::can_delete_instance()
41 * enrol_plugin::can_hide_show_instance() is a new function to control who can hide/show enrolment instances.
42   Returns true by default but plugins must implement their own logic.
44 === 2.6 ===
46 * Enrolment plugin which supports self enrolment should implement can_self_enrol()
47 * Enrolment plugin should implement get_enrol_info() to expose instance information
48   with webservice or external interface.
49 * Webservice core_enrol_get_enrolled_users_with_capability was incorrectly specifing
50   float as the return type for user id. int is the actual returned type and is now
51   reported as such.
53 === 2.5 ===
55 * plugins may use general enrol/editenrolment.php page to let users edit
56   enrolments manually
57 * new support for grade recovery in enrol_plugin::enrol_user() method
59 === 2.4 ===
61 required changes in code:
62 * use role_get_name() or role_fix_names() if you need any role names, using role.name
63   directly from database is not correct any more
64 * new restore support: ENROL_RESTORE_EXACT, ENROL_RESTORE_NOUSERS
65   and ENROL_RESTORE_CLASS were removed, implement new restore_* plugin methods instead
67 other changes and new features:
68 * course enrolment manager now works with disabled plugins too
69 * new support for protected group membership linked to enrol instance
70 * new support for expiry notifications - see enrol_plugin::send_expiry_notifications() method
73 === 2.2 ===
75 required changes in code:
76 * load_temp_role() is deprecated, use load_temp_course_role() instead, temp role not loaded
77 * remove_temp_role() is deprecated, use remove_temp_course_roles() instead
78 * 'user_unenrol_modified' event was renamed to 'user_enrol_modified'
81 === 2.0 ===
83 required changes in code:
84 * enrolment plugins need to be rewritten to use new API - see inline phpdocs and official plugins