Commit graph

28996 commits

Author SHA1 Message Date
tjhunt
314fc083d9 MDL-10824 - spaces in javascript URLs are not strictly valid. Merged from MOODLE_18_STABLE. 2007-09-19 17:44:52 +00:00
skodak
554bda0538 MDL-11347 fixed context c in update which Tim's pg did not like much 2007-09-19 17:40:20 +00:00
skodak
1e550d2f65 MDL-11048 fixing some notices and changing the list of correlated tags to comma separated format without apostrophes 2007-09-19 17:34:19 +00:00
tjhunt
1ced9d7b73 MDL-10903 - Wrong capability checked in get_all_instances_in_course should be moodle/course:viewhiddenactivities, not moodle/course:viewhiddencourses. Merged from MOODLE_18_STABLE. 2007-09-19 17:06:31 +00:00
tjhunt
260812ba06 MDL-10972 - The lang string 'fullname', which is normally used for course fullnames, was being used for a person's full name in some quiz reports. This dual usage is not translatable into all languages. Merged from MOODLE_18_STABLE. 2007-09-19 15:52:27 +00:00
skodak
2e0eade37f MDL-11347 temporary patch for mysql trouble in build_context_path() 2007-09-19 15:51:04 +00:00
skodak
3772df8dee MDL-11354 ipaddress typo in mnet environment.php 2007-09-19 15:44:31 +00:00
tjhunt
6ef56c991f MDL-6043 - supplimental - make corse reset function update quiz open and close dates. Thanks to Shamim Rezaei for the implementation, which I edited slightly. 2007-09-19 15:38:14 +00:00
nicolasconnault
41f22daa71 MDL-11353 Completed the implementation. This included a new method in grade_item: get_displaytype(), since that value could be set to default, and we must then look up to course, then site values. And the get_letter() method in grade_grade has been modified to first check the grade_letters table. All works like a dream! 2007-09-19 15:37:46 +00:00
nicolasconnault
ac5b0a4919 MDL-11339 Moved the gradedisplaytype element from user prefs to the display element of the grade_item settings 2007-09-19 14:28:26 +00:00
nicolasconnault
109bf12cda MDL-11340 Finished! 2007-09-19 14:12:34 +00:00
nicolasconnault
bc6969ddeb MDL-11340 Almost complete: Just need the "Add grade letter" button 2007-09-19 13:49:26 +00:00
nicolasconnault
dbdffd2c96 MDL-11340 Almost complete: Just need the "Add grade letter" button 2007-09-19 12:45:44 +00:00
tjhunt
fca490bca0 MDL-6315 - When processing a manul grading action, if both the comment and the score are blank - as might be the case on the 'Grade all' page of the manual grading when the teacher uses it to grade some, but not all of the students - then do not record the question as graded. Merged from MOODLE_18_STABLE. 2007-09-19 10:56:24 +00:00
tjhunt
6c554fc9b8 XHTML Strictness. Merged from MOODLE_18_STABLE. 2007-09-19 10:32:09 +00:00
tjhunt
01c4e87acf MDL-11095 - Use absolute path to include tabs.php, not a relative path, for greater robustness. Merged from MOODLE_18_STABLE. 2007-09-19 10:26:39 +00:00
moodler
95ffcee0bf Only show SQL feedback during full forced update (ie upgrade) 2007-09-19 09:55:31 +00:00
moodler
c122ad2a49 Just enabling SQL feedback so that errors like we're seeing in MySQL right now are exposed 2007-09-19 09:43:13 +00:00
moodler
47592ea851 New tags file 2007-09-19 08:57:31 +00:00
skodak
caee703562 adding missing closing } 2007-09-19 08:53:24 +00:00
stronk7
c2f8bff82c Now assignment submodules are handled by the XMLDB editor. Pending commit. 2007-09-19 08:04:11 +00:00
martinlanghoff
dcd6a7755f accesslib: update PHPDoc with intro to code
Explain what we mean by _fad(), $ad and $ctx. Might help resolve MDL-11173
2007-09-19 07:57:10 +00:00
martinlanghoff
4c4fc4ffb1 accesslib: janitorial - use $ad for accessdata everywhere
Make sure we always say $ad when we talk about accessdata. This patch
fixes a few leftover bits and pieces...
2007-09-19 07:56:56 +00:00
martinlanghoff
f2a7ad77ec accesslib: cleanup_dirty_contexts() - also forget about CAST()s 2007-09-19 07:56:43 +00:00
martinlanghoff
70981363bf accesslib: get_dirty_contexts() - fix race condition, forget about CAST()s
In one tiny patch we do two things.

First, we fix the race condition around dirty context and accessdata
timestamps -- it is saner to offset the check than to offset the
recording of the change (as an earlier patch did).

    On a cluster, you still need NTP.

Second, we do away with CAST(). Ideally, the values should be compared
as ints but it's hard to get a CAST() syntax that is portable enough
to work on all our supported DBs. And Eloy pointed out (and I
corroborated testing) that we'll never have problems with the string
length, as our timestamps are always 10 chars as a string... and the
day they go to 11 chars we'll hit the unix Year-2038 bug.
2007-09-19 07:56:30 +00:00
martinlanghoff
99be2a7fad accesslib: build_context_path() now sets path/depth for other blocks
Blocks not on the coursepage should have their context "hanging" from the
site context. get_context_instance() was doing this correctly, but not
build_context_path().
2007-09-19 07:56:14 +00:00
martinlanghoff
348648a2a5 Revert "accesslib: mark_context_dirty() - fix race condition"
This reverts commit 2b65045c5e8259f5997b3bbf457ec9d05027a93c.
2007-09-19 07:55:59 +00:00
martinlanghoff
ac0b19ffe9 lib/setup: Cleanup warnings in apacheloguser handling 2007-09-19 07:55:46 +00:00
martinlanghoff
c6f01310ad weblib: print_user_picture() fix typoed classname when faking user object 2007-09-19 07:55:29 +00:00
martinlanghoff
91d39e7392 user/index: switch to recordsets to use less memory
Memory usage was still high for long userlists. Use recordsets
to manage memory growth.

Note that we are still collecting a long long HTML table in memory
before we print it, so the footprint of the html itself is bit of an
issue.
2007-09-19 07:55:15 +00:00
martinlanghoff
b6ac3623ce user/index: Fetch participants' contexts with the search
With this patch, we fetch participants contexts in the main search
query. This cuts 1DBq per participant for the display.

Might fix MDL-11222 'global teacher viewing participants issues' where
we are getting OOM'd with many users.
2007-09-19 07:55:00 +00:00
martinlanghoff
45ea1afb16 accesslib: make_context_subobj() now expects ctxlevel, and fix all callers
make_context_subobj() was not providing a contextlevel property, and
no callers fetched the field. This comes from its humble origins where
it was only ever called for course objects. These days it's used in
many other situations, so this patch DTRT and

 - fixes make_context_subobj() expect a cxtlevel and turn it into
   contextlevel

 - fixes all callers (accesslib, datalib) to provide it
2007-09-19 07:54:37 +00:00
martinlanghoff
b1cff118c7 datalib:get_courses_wmanagers() handle empty $CFG->coursemanager more gracefully
Having no roles set as coursemanager is a valid setting.
get_courses_wmanagers() should not produce invalid SQL on it...
actually, it should not even try to get the course managers.
2007-09-19 07:54:23 +00:00
martinlanghoff
aba5f469f6 accesslib: get_user_access_sitewide() was skipping rdefs
The SQL query that would fetch rdefs not associated with any ra was
not being executed. Duh! For example, a user with a teacher RA sitewide
would never be affected by a role override at the category
level, because it was not being loaded into accessdata.
2007-09-19 07:54:06 +00:00
martinlanghoff
53fb75dc1f accesslib: get_user_access_bycontext() fetches all relevant rdefs
get_user_access_bycontext() was narrowing down too much the rdefs it
was fetching. With this patch, it now correctly retrieves the rdefs for
new roles assigned in lower contexts, and also correctly retrieves
rdefs present in the course context (fixing MDL-11220).

This also means that we now do the job in 2 DB queries (instead of 3),
and we move a bit more data, but those rows are actually needed ;-)
2007-09-19 07:53:49 +00:00
martinlanghoff
37875ac5b7 calendar/lib: calendar_set_filters() use pre-fetched context and course recs
Showing the calendar block was causing 2 DB queries per course the
user is enrolled in. Instead, use the data available in the array that
is passed as a parameter, and spare the DB a ton of needless traffic.

Fixes MDL-11221 Calendar not using context stuff from get_my_courses

Author: Martin Dougiamas
2007-09-19 07:53:33 +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
dd14fecfa4 accesslib upgrade: remove stray build_context_rel(), force path rebuild
Fixes problems during upgrades from 1.7x/1.8.x to mdl19-perf.
2007-09-19 07:53:00 +00:00
martinlanghoff
8f9a180282 weblib: build_navigation() try to avoid pointless capchecks
Prevent calls to has_capability() in build_navigation() from messing
with upgrades.

Most calls to has_capability() in weblib should be moved to the callers.
2007-09-19 07:52:42 +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
c7a8ec8cf0 accesslib: has_cap_fad() respect local-context-wins permissions rule
The initial implementation of has_cap_fad() just added the permission
values regardless of the locality of the context. This patch adds
support (read: fixes bug) for the "local context wins" rule.

Additionally, it removes a related bug where we were exiting early
if we found a CAP_PROHIBIT, ignoring the $doanything flag.
2007-09-19 07:52:06 +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
bbfed0ec61 datalib: get_my_courses() honour $fields array
If the caller passes a fields array, then merge it as we say we will do.
2007-09-19 07:51:36 +00:00
martinlanghoff
b9e9491a89 accesslib: get_my_courses() fix when called when empty sort
get_my_courses() was failing if called with an empty sortorder on a
cached courselist. Fix.
2007-09-19 07:51:19 +00:00
martinlanghoff
5f6b9c09b7 index.php: drop unused $hidesitecourse parameter when calling print_courses()
And this is the only user of print_courses() that mentions it
explicitly. Other callers have been checked and don't need or use the
sitecourse.
2007-09-19 07:51:02 +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
015e19287b Revert "textlib: Don't require_once() class.t3lib_div.php which we never use"
Turns out class.t3lib_cs.php depends on class.t3lib_div.php. Will drop
the two commits before we go into HEAD.

This reverts commit 5768bf6fb4dfa334dc81a80d26111904c4d13abd.
2007-09-19 07:49:49 +00:00
martinlanghoff
1dcf763428 accesslib: get_user_access_bycontext() remove 2 unused var declarations (trivial) 2007-09-19 07:49:35 +00:00