This change removes references in code and comments to a few
deprecated functions that were accidentally missed in the larger
change.
The code changes only affect service_users.php. I made it support
custom user profile fields in this query, because it was easy
enough, rather than adding another TODO to fix later.
This class would belong more appropriately within the 'user' API
(core_user) instead of within the 'core' API, since it is
directly related to user data.
Since the class has only just been added to Moodle, now is a good
time to move it.
In all cases changes have been kept to a minimum while not making
the code completely horrible. For example, there are many instances
where it would probably be better to rewrite a query entirely, but
I have not done that (in order to reduce the risk of changes).
This includes:
- changing all usernames in feature to lowercase, for cross-db passing. Fixes:
- user/tests/behat/set_email_display.feature
- ensure that course_enrolment_manager::get_potential_users() and
external always returns user->maildisplay attribute, so email
visibility can be calculated by user_get_user_details(). Fixes:
- enrol/tests/behat/enrol_user.feature
- blocks/news_items/tests/behat/display_news.feature
- course/tests/behat/course_creation.feature
The commit message above was my best attempt at meeting the very short restrictions on commit message first lines.
What it needed to say was: "Only show bulk enrolment operations for enrolment methods that have an instance in the course"
Role sort order was not available in the UI (in JavaScript) due to
the use of PHP assoc arrays and JSON encoding/decoding. This patch
addresses this by sending the roles in a json array, rather than
json object.
Here we optimise SQL queries for enrolled users list. Expensive subquery is
replaced with faster LEFT JOIN and the whole groups filtering component is
aded on demand.
As part of fixing this, I refactored some common code out of
get_potential_users and search_other_users. Previously, only one of
those bits of code had been updated.
This patch includes following changes and new features:
* Group sync in enrol_cohort plugin.
* Option for editing of role in existing cohort sync instance.
* Group memberships are now restored after enrolments.
* New enrol method for restore of protected group membership.
* New component callback 'restore_group_member' for restore of general plugin group membership.
* New component callback 'restore_role_assignment' for restore of general plugin role assignments.
* Implemented group membership protection in enrolment UI.
* Other minor fixes and cleanup.
Notes:
* The YUI base enrolment page is not reimplemented yet - see MDL-35618.