Here at pre-high school education center of TTI SFU we’ve developed an improvement for Moodle administration tool, user bulk actions, to implement it on our site.
Its code was updated so that now it has a plug-in structure, enabling developers to add new bulk actions functionality more easily, on the base of single code. Shortly, all actions are stored in their own subfolders in /admin/user/actions/ folder, and the base code redirects user to index.php in the action’s folder. To simplify the implementation even further, necessary language strings can be stored in corresponding subfolder of /admin/user/lang/ folder and fetched by get_string function with action-specific parameters. All “standard” actions (view, confirm, delete…) were edited to fit this plug-in structure and perform the same.
Additionally, two more actions were added: bulk user enrolment and bulk user unenrolment. These enable administrators to quickly enrol users to, or remove them from specified list of courses. Bulk enrolment also gives opportunity to specify the role, which is assigned to users, and to automatically add them to groups with a specified name (the names are taken from the selected courses automatically; if the group is missing in any course, it will not be created - users will be just enroled). The role assignment may also be hidden. Currently implemented languages for those plug-ins are en_utf8 and ru_utf8.
This improvement may resolve bug 10002 and extends the functionality of patch, accepted in bug 15449.
We would like to share this piece of code, and looking forward to hear any response or suggestions. We also would appreciate to see our patch in standard Moodle distrib.
To install this updated tool you have to delete (or rename for backup) the whole /admin/user/ folder and replace it with the one in the attachment.
Here are some screenshots: