470 Commits

Author SHA1 Message Date
skodak
d251907c51 MDL-14679 fixed datalib whitespace 2008-05-30 16:51:01 +00:00
skodak
c3df090199 MDL-14679 datalib conversion completed 2008-05-30 16:47:21 +00:00
skodak
06c1a1daf4 MDL-14981 regex search support in datalib, fixed course search 2008-05-25 20:43:46 +00:00
skodak
3b8a284cca MDL-14679 more datalib conversions 2008-05-25 15:16:17 +00:00
skodak
624a690b3d MDL-14679 first part of datalib conversion 2008-05-25 09:39:02 +00:00
skodak
f33e1ed4ae MDL-14679 ok, here is the big patch with new dmllib and ddlib API, some code is already converted, XML db editor works; see tracker for details of regressions and TODOs 2008-05-15 21:40:00 +00:00
dongsheng
12d0687748 "MDL-14460, fix get_context_instance, merged from MOODLE_19_STABLE" 2008-05-01 06:07:24 +00:00
stronk7
341b5ed236 Finally fixed version of lastaccess hadling.
Moved from add_to_log() to require_login(). MDL-14272 ; merged from 19_STABLE
2008-04-15 21:46:04 +00:00
stronk7
252720c45a Correct usage of debugging. MDL-11893 ; merged from 19_STABLE 2008-04-15 21:32:06 +00:00
stronk7
0fdf06cd78 Fixing logic + minor formatting of email. MDL-11893 ; merged from 19_STABLE 2008-04-15 20:02:59 +00:00
dongsheng
0369268bba MDL-11893, append failed SQL to email, see tracker 2008-04-15 05:37:31 +00:00
stronk7
edb15b8f04 Check for 60s interval from PHP. Save 3 queries per request. MDL-14272 ; merged from 19_STABLE 2008-04-10 21:00:38 +00:00
stronk7
cb8aaedf61 Unset rcache on UPDATE statements not using dmllib.php. MDL-14257 ; merged from 19_STABLE 2008-04-08 23:17:20 +00:00
dongsheng
c7a7112781 MDL-12263, under certain conditions, $catctxids is NULL, so an if statement should be here. 2008-03-20 07:20:00 +00:00
sam_marshall
6c5a2108b5 MDL-13915: Fixed add_to_log when very long url is specified (now doesn't try to insert more than 100 chars into database) 2008-03-13 15:32:08 +00:00
martinlanghoff
656418b179 MDL-11180 datalib: get_courses() - grab the course context as part of the select
This speeds up course & category listing enormously - cutting 2500 DB queries
for a site with 2500 courses. It's the power of the JOIN...
2008-02-26 21:48:08 +00:00
moodler
f191a887c6 MDL-12294 merge parentlang 2008-02-26 07:29:09 +00:00
skodak
585385278c MDL-13483 found two more native php mail() commands; merged from MOODLE_19_STABLE 2008-02-25 14:05:06 +00:00
skodak
c7e6b7e462 MDL-13399, MDL-13614 fixed regression caused by last commit; merged from MOODLE_19_STABLE 2008-02-23 19:29:25 +00:00
skodak
7007049315 MDL-13399 prevent ambiguous column names in get_my_courses; merged from MOODLE_19_STABLE 2008-02-18 20:14:16 +00:00
skodak
ac0b1a1987 MDL-13155 reworked get_all_instances_in_course() and get_all_instances_in_courses(), based on patch by Tim; merged from MOODLE_19_STABLE 2008-02-05 21:34:58 +00:00
skodak
b4619aba72 MDL-12945 disabled mods are not returned from get_course_mods() anymore, the results are used in scheduled backup and other parts that do not expect disabled mods; merged from MOODLE_19_STABLE 2008-02-01 07:33:37 +00:00
skodak
dd97c32868 MDL-12945 a slightly bigger patch for performance in recent activity and various group related issues + some other fixes - see list of subtasks in tracker; merged from MOODLE_19_STABLE 2008-01-24 20:33:50 +00:00
martinlanghoff
c26ecb1a29 datalib: get_admins() - Rewrite to avoid get_users_by_capability()
get_admins() and get_admin() were counting on
get_users_by_capability() returning a role-assignment id to pick the
"primary" admin account. With the get_users_by_capability() rewrite,
we no longer have an RA id to clearly blame for the capability.

So, rewrite get_admins() based on the known-good SQL used in
is_siteadmin().

MDL-12452
2008-01-06 23:24:50 +00:00
stronk7
0f62a5b5bb Better behaviour for "-" course searches under MSSQL and Oracle. MDL-7312 ; merged from 19_STABLE 2008-01-01 12:03:00 +00:00
stronk7
a599aeebe5 Prevent some debugging notices, cast to object before inserting. Merged from 19_STABLE 2007-12-31 15:20:02 +00:00
tjhunt
3d96cba76a Improve PHP doc comments. 2007-12-12 17:10:48 +00:00
martinlanghoff
1d854cec5a datalib: get_logs_user*() - fix invalid SQL - MDL-12426
Oracle does not accept column labels in the GROUP BY section -
get_logs_usercourse() and get_logs_userday() were computing the
day/hours column and using it in the GROUP BY. The compatible fix
is to reproduce the same computation in the GROUP BY section.

Credit for the fix goes to Dennis Rochford <Dennis.Rochford@usq.edu.au>.
2007-12-04 06:26:10 +00:00
skodak
cd1edf9e8a MDL-12101 cleanup/fixing/refactoring of user bulk operation and admin user browsing 2007-11-13 08:43:20 +00:00
tjhunt
5354679f77 Fix typo. Merged from MOODLE_19_STABLE. 2007-10-25 14:30:07 +00:00
toyomoyo
9f06454655 MDL-11893, email admin when add_to_log() fails 2007-10-25 04:02:41 +00:00
skodak
03cedd6283 MDL-11432 eliminated majority of RecordCount uses, added several missing rs_close() - this should help improve perf on some platforms - Eloy says ;-) 2007-10-10 12:19:27 +00:00
stronk7
115a43113a ANSI join ON clauses should contain only the join condition. Also,
added prefix to the ORDER BY to prevent duplicate names.
2007-10-08 17:42:46 +00:00
moodler
5b1dbd5cd7 Some SQL fixes to avoid putting 'quotes' around integers (performance) 2007-10-05 13:34:28 +00:00
skodak
d75731c6ac prevent returning of invalid array from get_course_managers() 2007-10-03 22:26:05 +00:00
stronk7
59bef7283d Moving 3 functions from datalib to deprecatedlib. Only used
by admin/cron.php. First step of MDL-11571 and MDL-11487
2007-10-03 16:31:20 +00:00
moodler
1afb11e70b Fixed longtimenosee unenrolments. user_lastaccess and role_assignments were growing with uneccessary entries, to the point where memory limits were reached and in the end NO unenrolments were happening at all.
See  MDL-11571
2007-10-03 12:24:06 +00:00
tjhunt
3b0ee367a7 MDL-11466 - failing to check for the case $rs = false in the accesslib performance improvements. Credit for the fix goes to Gareth Morgan. 2007-09-26 21:31:54 +00:00
tjhunt
8d503f7557 Get rid of duplicate $Id$ tags. 2007-09-26 10:11:13 +00:00
nicolasconnault
bfbfdb5350 MDL-11350 allowvisiblecoursesinhiddencategories was not used fully in the determination of the course's visibility 2007-09-20 13:15:26 +00:00
toyomoyo
05a71b3341 change restore code to use the more efficient get_user_courses_bycap 2007-09-20 09:16:49 +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
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
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
e89f157b0a datalib: get_courses_wmanagers() exclude the sitecourse
Should never return the sitecourse - so we exclude it explicitly.
2007-09-19 07:49:10 +00:00
martinlanghoff
2e159efb1c Revert "datalib: Introducing sql_intarray_to_in()"
We don't need sql_intarray_to_in(), use implode() instead.

This reverts commit 3ef7fc54d9df780c837c64a8ace1fc565d6d7744.
2007-09-19 07:47:26 +00:00
martinlanghoff
44f1636ee2 datalib: get_categories() - remove PostgreSQL-ism 2007-09-19 07:28:43 +00:00
martinlanghoff
40fb8aa69a datalib: get_categories() returns context, supports !shallow
With this patch, get_categories() now adds a nice context
sub-object to the returned object, which means callers can
save DB traffic.

It now also supports "deep" retrievals, which means we can
rewrite the course categories display pages to avoid
costly recursion.
2007-09-19 07:27:20 +00:00