1746 Commits

Author SHA1 Message Date
nicolasconnault
5a81060351 MDL-11500 Catching empty $coursemod when viewhiddensection is false, + corrected type $coursemode => $coursemod 2007-10-05 05:40:56 +00:00
nicolasconnault
05a334392c MDL-11525 When courseid is not present in the log entry, showing "Site" instead of $log->info 2007-10-05 04:24:42 +00:00
nicolasconnault
ece966f06e MDL-11482 Resolved the sum icon issue (added a new x-bar icon) and resolved a dependency problem in moodlelib 2007-10-03 12:22:25 +00:00
skodak
1f41940f20 MDL-11523 fixed - moving categories and courses around breaks paths and depths in context table + some notice fixes 2007-10-02 22:34:12 +00:00
nfreear
806ebc150c Fixes MDL-11161, Activity type text ... beginning of activity links in Screen Reader...moved to end (also MDL- 7436) 2007-10-02 09:36:47 +00:00
stronk7
6bb919860b Passing $course to require_login() provides correct and
automatic navlinks to the course. MDL-11452
2007-09-27 23:37:42 +00:00
skodak
95aa0af862 MDL-11472 fixed harcoded mdl_ prefix in sql queries 2007-09-27 08:41:19 +00:00
nfreear
d2bd42498c Follow-up for MDL-1149 Accessibility: Current week/topic is NOT indicated non-visually. Reorder. 2007-09-26 12:53:04 +00:00
nfreear
6285f8a882 Fix MDL-7436 Accessibility "Indicate type of resource in the name of the resource" 2007-09-25 15:15:07 +00:00
nfreear
f4a01ab61f MDL-1149 Accessibility: Current week/topic is NOT indicated non-visually, only in styling. 2007-09-25 12:05:36 +00:00
nfreear
e9b9c1d810 MDL-1149 Accessibility: Current week is NOT indicated non-visually, only in styling. 2007-09-25 12:00:51 +00:00
mattc-catalyst
acf000b077 MDL-11419 - groups: interface enhancements + new features:
* Display the grouping a course module belongs to on the course page - for course managers only.
    * When adding users to groups, display the groups a user already belongs to.
    * Added an overview report that shows groupings, groups and members for a course.
    * Added a dialogue to automatically create groups and assign members based on either the number of desired groups or the number of desired users per group.
2007-09-24 21:55:15 +00:00
nfreear
e0b033d5f8 Partial fix of reopened MDL-7436 Accessibility: "Indicate type of resource in the name of the resource" 2007-09-24 17:26:40 +00:00
skodak
651f7cf277 MDL-10833 course theme in live logs fixed 2007-09-24 15:39:29 +00:00
skodak
f2fdc8ebe7 MDL-11071 Added disabledif logic to groupings/groups common dialogue 2007-09-24 15:07:00 +00:00
skodak
024ef5288a MDL-11414 fixed handling of log urls (problem reported by Andreas Nolden) 2007-09-23 13:13:13 +00:00
nicolasconnault
2f6c662f41 MDL-11379 and MDL-11380 fixed 2007-09-21 07:52:52 +00:00
martinlanghoff
853a093ec5 course/index: remove call to rebuild_context_rel()
Very last caller to rebuild_context_rel() and any XX_context_rel()
function. move_category() already takes care of calling
context_moved(), which does the required context.path maintenance.

Addresses MDL-11219
2007-09-19 07:53:17 +00:00
martinlanghoff
6b4d8c4d58 course/lib: print_course() fix bug when $course->managers was not set
Fix a thinko in a variable assignment that prevented us from grabbing
the correct roles as managers. Addresses Yu's report at
MDL-11182 admin shows up as teacher.
2007-09-19 07:52:27 +00:00
martinlanghoff
5b9e50caf0 course/lib: print_my_moodle() - ask get_my_courses() for the summary
get_my_courses() now defaults to a much leaner dataset, but accepts an
array of "additional" fields we want. So ask nicely for the summary,
so that we can print_course() later with it.
2007-09-19 07:51:50 +00:00
martinlanghoff
6c54240a61 course/lib: print_courses() drop $hidesitecourse parameter
The $hidesitecourse and related code seem to be dead code. An audit of
the callers did not turn up any interesting/valid use of it.
2007-09-19 07:50:41 +00:00
martinlanghoff
49cd4d7934 Revert "course/lib: print_courses() - no need to worry about sitecourse"
This reverts commit d7816749a4ceda352a2fac6e82d7f02f435473ed.
2007-09-19 07:50:28 +00:00
martinlanghoff
1d28d87b35 accesslib - Ensure newly-created categories have a context
New categories need a context immediately, and for top-level
categories, they also need to taint the "root" context to trigger
a reload of $USER->access.

This fixes problems with creation of initial courses(MDL-11178),
duplicate misc categories, etc.
2007-09-19 07:50:05 +00:00
martinlanghoff
55c47e48a9 course/lib: print_courses() - no need to worry about sitecourse
get_courses_wmanagers() excludes the sitecourse, so we no longer
check for it. And check explicitly for an empty course array.
2007-09-19 07:49:23 +00:00
martinlanghoff
c9e42aaa99 course/index: Bring back Petr's MDL-9647 simplify dealing with headers/footers in admin sections
I had mistakenly reverted some of Petr's changes.

Fixes MDL-11179 19PERF: Notice on /course/index.php as admin
2007-09-19 07:48:56 +00:00
martinlanghoff
dfbf98cdb3 course/index: minor context-related fixes
- The code uses the system context a lot. Declare
   $sysctx at the top and use it.

 - If the category has a context property, use it
   (saves 1 DB query per category displayed)

The DB costs of this page in editing mode are

 - ~100 DB queries for fix_course_sortorder()

 - ~50 DB queries for the categories listing

If we rewrite both to lose the recursion, we could resolve the
page in perhaps 5 DBq.
2007-09-19 07:27:31 +00:00
martinlanghoff
4dde1463ee course/lib: print_courses() and print_course() rework
print_course() can now recognise a $course object that already has a
$course->context obj and a $course->managers array, which means that
there will be no DB access triggered by print_course().

(Backwards compat is retained so it still works the old way for
callers that get a single course printed anyway (during enrolment
for example.)

And print_courses() now uses get_courses_wmanagers(), and passes the
returned $course objects to print_course().

With this patch, a homepage listing 9 courses (with varying numbers of
teachers) sheds 63 DB queries (88 to 25). A course listing page with
3 courses sheds 9 (33 to 24).

On a single server overall time spent serving the homepage is reduced just
a little bit (262ms to 238ms) -- on a clustered environment, less DB queries
mean much lower latency and DB costs.
2007-09-19 07:26:54 +00:00
martinlanghoff
431cad0d62 course/lib: print_course() bugfix when $rusers is empty 2007-09-19 07:26:27 +00:00
martinlanghoff
57770b87d0 Interactive enrolment/unenrolments: make sure we unset mycourses 2007-09-19 07:17:23 +00:00
martinlanghoff
0e801c6c9d course/unenrol: check $USER->access[rsw] for role switches 2007-09-19 07:15:38 +00:00
martinlanghoff
88903eeab9 course/index: Move categories around using move_category()
Use the newfangled move_category() when moving categories
around, to ensure we Do The Right Thing in the backend,
decoupled from UI stuff.
2007-09-19 07:14:34 +00:00
martinlanghoff
19f601d178 course/lib: move_courses() calls content_moved(), intro move_category()
move_courses() now calls content_moved() which will take care of any
accesslib-required changes. And introducing move_category() which
also calls content_moved() when needed.
2007-09-19 07:14:23 +00:00
martinlanghoff
a372aab507 course: Changing a course cat from course/edit calls context_moved()
Changes to course cat from the main course settings form now calls
context_moved(), and accesslib data is properly maintained.
2007-09-19 07:13:57 +00:00
martinlanghoff
c633af7a5a course/edit: mark the course contextpath as dirty to force a reload
Combined with the path creation in create_context() we can now create
a course, enter and edit it immediately. Amazing.

Like - 21st century technology.
2007-09-19 07:13:20 +00:00
martinlanghoff
3d3def3a4e course/unenrol codepaths mark the context dirty - bugfix
Oops. one if() branch was missing the mark_context_dirty(). Fixed.
2007-09-19 07:12:43 +00:00
martinlanghoff
a9d4ea7849 All interactive enrol/unenrol codepaths mark the context dirty
Manually enrolling and unenrolling self, and other users should
transparently set the context dirty. So walk all callers to
role_assign() and role_unassign() and mark the context dirty
where appropriate.

OTOH, most automated-backend enrol/unenrol mechanisms should not.
The backend lookups that happen when you login are well covered
by the login/enrolment process, and don't need to be marked dirty.
2007-09-19 07:11:42 +00:00
martinlanghoff
690c946c15 get_role_users() callers rework to use the new $gethidden 2007-09-19 07:09:50 +00:00
martinlanghoff
3bf13d05f5 course/lib:print_course() smarter calling of get_role_users()
And saves a few dbqueries too...
2007-09-19 07:09:24 +00:00
martinlanghoff
026579bbc3 course/search.php: smarter about contexts, bugfix in pagination
Save a ton of queries about contexts, and a bugfix in how we are
calling the pagination for get_courses_search().
2007-09-19 07:08:50 +00:00
martinlanghoff
679b617967 categories: Categories page and get_courses_page() - smarter about context
This patch saves 1600 context lookups on a 1600 course category. rcache
does help a bit with small categories, but on large setups, this is
not sustainable.

And it's not needed either. We have the data right at our fingertips.
Just get it when it's cheap...
2007-09-19 07:08:24 +00:00
martinlanghoff
d7d4b0e572 course/view: roleswitch checks moved to the course page
Implemented all the relevant checks for role_switch().

accesslib's role_switch() doesn't do any UI-related checks any more,
being a backend lib call. These belong here.
2007-09-19 07:06:44 +00:00
martinlanghoff
d863419245 course/index: move orphan fixups to an optimised fix_coursecategory_orphans()
Move the fixups for orphan courses to the newly minted
fix_coursecategory_orphans() -- and optimise it to take only 1 dbquery for
the common case.

If we do find lots of orphans, we issue 2 updates per orphan.

This cuts down dbqueries drastically - we used to have 2x the number of
courses in the site.
2007-09-12 02:56:36 +00:00
skodak
ffc536af8e MDL-7380 converted various places to use new groups API 2007-09-08 20:53:05 +00:00
mattc-catalyst
263017bbdd MDL-10888: groupings - mod/workshop - add grouping support 2007-09-06 01:35:37 +00:00
moodler
7b0d5cd551 Merged fixes for MDL-7425 from 1.8 stable 2007-08-30 06:01:57 +00:00
toyomoyo
a683deeca6 merged fix for MDL-10818, do not display graph if user has no permission 2007-08-28 07:04:41 +00:00
nicolasconnault
9837bd1d2c MDL-7574 Applying Matthew Davidson's patch. 2007-08-27 16:59:04 +00:00
skodak
97928ddf00 MDL-11003 adding of first activity on frontpage does not work - incorrect section 2007-08-26 15:30:51 +00:00
skodak
273eb2f5aa MDL-10999 Cannot Insert or Edit a Label 2007-08-26 07:44:14 +00:00
nicolasconnault
ba7472ccdf MDL-10910 Corrected two errors committed while fixing MDL-10870 2007-08-23 15:08:14 +00:00