28356 Commits

Author SHA1 Message Date
martinlanghoff
55a814399f accesslib:build_context_path() refer to dbfamily instead of dbtype
so mysql's various drivers can be used.
2007-09-20 02:45:57 +00:00
toyomoyo
163a5eee2c MDL-11356, set display of grade items to database default (-1) 2007-09-20 02:39:25 +00:00
martinlanghoff
d20559f3e4 accesslib: build_context_path() - better UPDATE SQL
A bit of cleanup on the SQL we use for updates. Unfortunately, MySQL
uses non-SQL-standard syntax for updates reading or updating multiple
tables. After much testing across Pg and MySQL, I boiled it down to
the minimal differences -- but we still have different SQL.

The timings for this on a large reference install, calling
build_context_path(true):

 - MySQL incompatible 1s
 - Petr's fixes 60s -- DB complains of too many writes
 - This commit 24s  -- DB complains of too many writes

Also - fixed a remaining problem with $emptyclause

Affects MDL-11347
2007-09-20 01:03:35 +00:00
martinlanghoff
92b34bdd6c accesslib:build_Context_path() fix $emptyclause
We need 2 different empty clauses, one for updates, anotherone for
selects.
2007-09-20 00:16:22 +00:00
martinlanghoff
413a19dd4c accesslib:build_context_path() - fix $emptyclause to avoid Oracle's dirty hack
accesslib is now clean of Oracle's dirty hack. Thanks Eloy for the idea.

MDL-11347
2007-09-19 23:46:37 +00:00
stronk7
351e55fba6 Delete one excess parenthesis... Applying Bryce's patch to MDL-11347 2007-09-19 22:40:58 +00:00
skodak
203d964a4a MDL-11347 yet more beautification proposed by Eloy 2007-09-19 19:20:18 +00:00
skodak
b37453d73d MDL-11347 yet more beautification proposed by Eloy 2007-09-19 19:13:49 +00:00
skodak
40c670d416 MDL-11347 improving sql syntax - thanks Eloy for comments 2007-09-19 19:01:32 +00:00
mudrd8mz
d456b18f7b Fixes MDL-11327. Error when trying to include a non existing file. 2007-09-19 17:58:03 +00:00
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