80 Commits

Author SHA1 Message Date
Marina Glancy
442f12f81a MDL-62742 core: rename coursecat->core_course_category
Also rename course_in_list -> core_course_list_element
Deprecate class coursecat_sortable_records
2018-08-28 11:36:23 +02:00
Shamim Rezaie
f7115c2e80 MDL-58768 coursecat: coursecat::get to accept a $user parameter 2018-07-28 07:51:32 +10:00
Andrew Nicols
618b223302 Merge branch 'MDL-61519-master' of https://github.com/andrewnicols/moodle 2018-03-21 09:09:03 +08:00
Andrew Nicols
b30b66c57e MDL-61519 coursecat: Reset the coursecat cache on enrolment 2018-03-21 09:06:51 +08:00
Martin Gauk
ef780a0051 MDL-61519 coursecat: do not cache get_all_children_ids 2018-03-20 13:20:04 +00:00
Martin Gauk
c4172077df MDL-61519 calendar: do not iterate through all categories
Replace calls to \coursecat::get_all() or cache the results.
2018-03-16 14:30:55 +00:00
Andrew Nicols
74475e5bb4 MDL-59890 calendar: Delete category events upon category removal 2017-10-03 23:22:18 +08:00
Andrew Nicols
e9321ad07d MDL-59890 coursecat: Add helper to fetch nested view of coursecat 2017-10-03 21:28:31 +08:00
Andrew Nicols
0085b0ea3c MDL-59890 calendar: Add support for the category to vault 2017-10-03 21:28:31 +08:00
Andrew Nicols
05f184bb7f MDL-59890 calendar: Add ability to add category events 2017-09-29 08:57:08 +08:00
Johannes Burk
1dcd1a071c MDL-59799 course: Include course/lib.php before using move_courses(). 2017-09-01 16:46:26 +02:00
Adam Olley
b3e4fbc011 MDL-58160 coursecat: Use set_many to populate category cache
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.
2017-03-06 12:04:25 +10:30
Neill Magill
bd305a3973 MDL-55209 coursecat: Should be able to remove category idnumber
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.
2016-11-02 09:50:34 +00:00
Daniel Neis Araujo
fbcdb0d710 MDL-22078 course: add end date 2016-10-03 09:51:36 +08:00
Mark Nelson
ea88fd4e66 MDL-48012 core: added pre_*_delete hooks 2016-03-15 16:58:46 +08:00
Damyon Wiese
235ef57a3d MDL-51324 forms: Add a new course selector
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
2016-03-09 13:30:18 +08:00
Marina Glancy
74fa9f76dc MDL-50851 course: use new tag API 2016-01-10 15:25:47 +08:00
Marina Glancy
5667e60249 MDL-41042 coursecat: reset course contacts cache more often 2015-10-07 10:23:03 +08:00
Marina Glancy
a6d4a36388 MDL-41042 coursecat: better handle changes in coursecontact 2015-10-07 10:15:19 +08:00
Ankit Agarwal
2d3fcda8ec MDL-50340 adminstration: Fix restore course links 2015-05-25 11:11:20 +05:30
Andrew Nicols
fb3b04cb03 Merge branch 'patch-1' of https://github.com/sk-unikent/moodle 2015-04-16 07:45:04 +08:00
David Monllao
f1d498a62a MDL-48456 course: Using default max int value 2015-03-23 15:16:18 +08:00
Daniel Kosinski
551e64ccb9 MDL-48456 course: Increase timeout when deleting all courses in category 2015-03-22 16:21:51 +01:00
Skylar Kelty
6a5681db1b MDL-49489 caching: Prevent full coursecontact purge 2015-03-16 09:22:53 +00:00
Marina Glancy
6f98532334 MDL-46486 coursecat: remove function forgotten in MDL-38147 2014-12-01 13:12:21 +08:00
Heiko Schach
000f1488f0 MDL-48036 course: change multilang cache key 2014-11-25 14:34:45 +00:00
Dmitry Nefedov
e5fc064876 MDL-47385 coursecat: Mistake line in phpdocs deleted. 2014-09-25 21:17:52 +08:00
Syxton
9a4231e993 MDL-45847 resort: Add more course sorting options
MDL-45847 resort: Add more course sorting options

Add descending sort options and course timecreated sort options.
Includes behat and unit test changes.
2014-07-10 16:15:26 -04:00
Marina Glancy
24c32bdf2f MDL-44403 events: added public method to get eventdata 2014-03-04 15:16:15 +08:00
Mark Nelson
001f09548d MDL-40912 coursecat: replaced 'hide' and 'show' add_to_log calls with an event 2014-01-14 19:24:15 -08:00
Mark Nelson
d86c7206aa MDL-40912 coursecat: replaced 'move' add_to_log calls with an event 2014-01-14 19:24:14 -08:00
Mark Nelson
c4cea8cb5d MDL-40912 coursecat: replaced 'update' add_to_log call with an event 2014-01-14 19:24:14 -08:00
Mark Nelson
03ea10e6d3 MDL-40912 coursecat: replaced 'add' add_to_log call with an event 2014-01-14 19:24:08 -08:00
Sam Hemelryk
39bd07f732 MDL-43526 course: links to restore from management and admin structure. 2014-01-07 12:08:34 +08:00
Adrian Greeve
5b1944bbba MDL-40612 libraries: Tidy up and improvement of the code for additional name fields.
Includes an update to get_all_user_name_fields() and the inclusion of set_user_name_object()
2013-11-11 11:01:14 +08:00
Damyon Wiese
9e16402727 Merge branch '42629-26' of git://github.com/samhemelryk/moodle
Conflicts:
	course/classes/management_renderer.php
2013-11-05 14:04:08 +08:00
Damyon Wiese
1ddbe7815d Merge branch 'wip-MDL-42318-master' of https://github.com/marinaglancy/moodle 2013-11-05 11:06:23 +08:00
Sam Hemelryk
c7a2291f8b MDL-42629 course: management resorting improvements 2013-11-05 09:49:20 +08:00
Rajesh Taneja
3b732cd6cc MDL-42492 course: Show option to move category to top level
added behat to test move category
2013-11-01 15:53:38 +11:00
Marina Glancy
9d88b492b1 MDL-42318 coursecat: do not allow to sort if there are invisible children 2013-10-29 10:26:56 +11:00
Dan Poltawski
e077f21827 Merge branch 'wip-MDL-42020-master' of git://github.com/marinaglancy/moodle 2013-10-10 08:18:28 +08:00
Marina Glancy
bf1405a60a MDL-42020 course: performance improvement in course listings
- better performance when get_course_count() OR search_course_count() are called by themselves
- better performance in displaying course contacts
2013-10-10 10:51:16 +11:00
Sam Hemelryk
484c4c6cf3 MDL-31830 course: several management interface improvements
* 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.
2013-10-07 10:22:57 +13:00
Sam Hemelryk
b488058f7d MDL-31830 course: fixed interface issues with limited user
* 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.
2013-10-07 10:22:51 +13:00
Sam Hemelryk
5aff38e4d8 MDL-31830 course: renamed functions for consistency
* course_move_by_one => course_change_sortorder_by_one
* course_move_after_course => course_move_after_course
* helper::action_course_move_after_course  => helper::action_course_change_sortorder_after_course
* helper::action_course_moveup 		   => helper::action_course_change_sortorder_up_one
* helper::action_course_movedown 	   => helper::action_course_change_sortorder_down_one
* helper::action_course_moveup_by_record   => helper::action_course_change_sortorder_up_one_by_record
* helper::action_course_movedown_by_record => helper::action_course_change_sortorder_down_one_by_record
* helper::action_category_movedown         => helper::action_category_change_sortorder_down_one
* helper::action_category_movedown_by_id   => helper::action_category_change_sortorder_down_one_by_id
* helper::action_category_moveup 	   => helper::action_category_change_sortorder_up_one
* helper::action_category_moveup_by_id     => helper::action_category_change_sortorder_up_one_by_id
* coursecat::move_by_one 	           => coursecat::change_sortorder_by_one
2013-10-07 10:22:36 +13:00
Sam Hemelryk
67e1f26874 MDL-31830 course: several small code improvements
* 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.
2013-10-07 10:22:36 +13:00
Sam Hemelryk
5dc361e16e MDL-31830 core_course: new course category management interface
* 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.
2013-10-07 10:21:41 +13:00
Marina Glancy
6b0b05b32f MDL-41942 course: Allow course listings to work with caches disabled 2013-09-27 18:34:20 +10:00
Eloy Lafuente (stronk7)
bbfa86fe48 Merge branch 'wip-MDL-41594-master' of git://github.com/marinaglancy/moodle 2013-09-24 23:20:53 +02:00
Marina Glancy
b73d8a35c2 MDL-41594 Bug fix for orphaned invisible categories
thanks to L.Sanocki
2013-09-17 20:58:03 +10:00