When the course category cache needs to be repopulated, two entries are added
to the cache for each category. In core this is currently done in a for-loop,
resulting in N set calls to the cache (where N is twice the number of
categories in Moodle).
This change switches that code to using a single set_many cache call instead,
which makes this an O(1) operation instead of O(N).
For a site with say, 1000 categories, this results in only 1 set call to the
cachestore instead of 2000.
Users should be able to remove an idnumber from a category, before this
change when trying to delete an idnumber users would be told it already
existed.
This change also stops 0 from being allowed multiple times as an idnumber.
This is a squashed commit containing a number of changes:
This is an ajax driven course selector that has searching etc. It can select single, or multiple courses.
Make course selector accept a list of courses to exclude
courseselector - lookup coursename on setValue
Use the get_course_display_name_in_list function to generate the course names
Add a throttle to auto-complete to reduce spamming the server
Do a single query to fetch all the courses in the mform element when validation fails
Fix core course search function to return results when there are less than 2 chars in the query.
Handle setData with an empty array in new course selector
MDL-45847 resort: Add more course sorting options
Add descending sort options and course timecreated sort options.
Includes behat and unit test changes.
* Tidied up course detail permissions so that user is not shown information they couldn't access elsewhere.
* category link dimming now accounts for course creation as an action as well.
* category single select when in courses view mode is now limited to courses user can action in.
* There is now a check at the start of the management page to redirect to course/index.php if the user isn't able to manage in any category.
* Tweaked navigation again, to give the limited users a navbar structure similar to the system cap'd user.
* Cancelling a category delete now takes you back to the category you were viewing.
* Fixed undefined notice
* Improved placement of course request and approval links.
* Several styling tweaks/improvements to the base theme.
* Several styling tweaks/improvements to the bootstrapbase theme.
* Navigation/settings now show best available option.
* Resorting categories works now for limited access user.
* Display of up and down arrows corrected.
* Checkboxes no longer displayed if an action can't be performed.
* I can rebase this for you/the integrator before it goes in for sure no probs :)
* Fixed double phpdoc block of course_change_visibility
* Moved permission checks out of course_move_after_course and into helper function.
* Reviewed setType calls for editcategory_form.php.
* Reviewed all uses of can_resort and added more specific methods.
* Fixed method mentioned in exception for resort methods.
* Converted calls to fetch courses to call get_course.
* Exceptions now thrown when trying to move courses and problems arise.
* Fixed unnecessary namespace hinting in core_course_management_renderer.
* Abstracted common logic of can_resort_any and can_change_parent_any.
* Removed check for system level capability from has_manage_capability_on_any.
* Reviewed debugging calls I've introduced.
* Implemented a new course and category management page.
* Deprecated the old management interface.
* Unit tests to cover the new API and core functions.
* Behat tests to cover the new interface.