Commit graph

542 commits

Author SHA1 Message Date
skodak
78d4711ebb fixed data/index.php when no databases available, initialized array in get_all_instances_in_course() from datalib.php; merged from MOODLE_16_STABLE 2006-10-08 19:45:29 +00:00
gustav_delius
6bff0453f5 Incomplete user record (the one where the username is still 'changeme') should not be included in user listing. See bug 4570 2006-10-05 22:21:09 +00:00
moodler
0351730630 FIxed a debugging message 2006-10-01 06:39:20 +00:00
dwoolhead
12490fc2b3 Prevent 'Warning: Invalid argument supplied for foreach() in ...' for get_courses_page function when there are no courses in the required category. 2006-09-22 11:15:10 +00:00
moodler
cc7c0592e4 Fixes for get_users_longtimenosee 2006-09-22 09:49:26 +00:00
moodler
33f857405b Slight extensions to get_my_courses() API to make it more useful in general 2006-09-19 14:23:43 +00:00
moodler
0dde27bb52 More efficient get_my_courses() 2006-09-19 14:14:32 +00:00
vyshane
285f94f506 Few small fixes 2006-09-19 08:16:26 +00:00
toyomoyo
d76a5a7fed replacing references to user_* tables 2006-09-19 01:44:33 +00:00
skodak
09575480bb fixed several warnings in get_course() 2006-09-17 18:07:35 +00:00
moodler
41f6ed56ce Don't rely on the legacy capabilities to identify admins, use doanything 2006-09-17 16:00:16 +00:00
tjhunt
36075e092d MDL-6041 - Proper fix that eliminates the magic number 99999 when getting lists of studnets. Now, there is no arbitrary upper limit in the datalib functions, and sensible upper limits on pages that display lists of users. However, if you try to get all the site students, then get_students prints a warning in debug mode, telling you that you need to rethink your code.
Also a few more ISNULL()s eliminated.

And a typo role_assignment -> role_assignments.
2006-09-15 14:32:35 +00:00
moodler
5081e7868d Some SQL fixes 2006-09-15 13:51:42 +00:00
toyomoyo
71dea306b4 changing lib functions to work with roles, some functions might not work as expected now 2006-09-15 09:08:48 +00:00
moodler
3cc8b355c2 Fixed a notice when course->modinfo is empty 2006-09-15 06:16:35 +00:00
vyshane
e521770c84 Small SQL fix. Removed unneeded WHERE clause 2006-09-15 03:18:59 +00:00
toyomoyo
ea8158c118 changing sql calls from user_students table to role_assignments table 2006-09-14 09:08:07 +00:00
toyomoyo
61b03dc7a6 replacing legacy calls 2006-09-14 03:18:55 +00:00
moodler
ea82d6b638 CHanged a lot of CFG->debug stuff to use the new debuggin() function 2006-09-13 09:45:07 +00:00
moodler
cb80265b21 Tidying add_to_log slghtly 2006-09-13 05:31:12 +00:00
toyomoyo
ae9e4c064e replacing iscreator() calls with capabilty 2006-09-12 08:56:10 +00:00
toyomoyo
1c45e42e3c adding capabilities 2006-09-11 08:56:23 +00:00
moodler
613bbd7c2b Moving deprecated functions out of datalib.php
Many of these still need updating to remove all dependence on user_xxx tables
2006-09-10 07:07:52 +00:00
toyomoyo
51792df056 adding capabilities 2006-09-08 08:46:26 +00:00
stronk7
93a89227fd One less use of old LIMIT clause. Now logs are working properly. 2006-09-05 21:40:17 +00:00
stronk7
405bc45cf6 No need to specify DISTINCT because u.* guaranties distinct by id. 2006-09-05 19:01:41 +00:00
stronk7
94ef00f3bb MSSQL and Oracle don't want DISTINCT clauses over TEXT/BINARY fields.
In this case, we simply delete it because SELECT g.* guarantees unique
records to be retrieved by the first field.
2006-09-04 22:05:58 +00:00
stronk7
fea43a7f51 Casting $course->modinfo to string prevents one notice to
be showed when it's null, returning false as desired.
2006-09-04 21:12:37 +00:00
toyomoyo
20aeb4b8e3 utf8 migrate support for site with roles active, resolved isstudent legacy problem, implemented $CFG->notloggedinroleid 2006-09-01 09:25:34 +00:00
stronk7
7e13be0887 Splitting datalib.php in three libraries:
- ddllib.php: Where all the DDL (install/upgrade) functions will be.
  - dmllib.php: Where all the DML (select...) functions will be.
  - datalib.php: Legacy lib. Its contents should go to other libraries soon.
For more info see: http://docs.moodle.org/en/XMLDB_Roadmap (point 1)
2006-08-18 22:56:08 +00:00
tjhunt
5553c2ec47 New function record_exists_select with unit tests for all the record_exists_* functions. 2006-08-18 11:28:30 +00:00
tjhunt
cfa27f4472 Fix bug in new function get_field_select(), and this time add a unittest to see if the new function works! 2006-08-17 16:28:29 +00:00
tjhunt
ab757152ec New function get_field_select(). 2006-08-15 13:44:22 +00:00
tjhunt
78b26f761c Typo in comment. 2006-08-10 15:44:52 +00:00
tjhunt
dba4e6da97 Document table_column. 2006-08-09 17:46:16 +00:00
skodak
f9d5371b28 new function get_coursemodule_from_id() is now used for obtaining of valid $cm from coursemodule id SC#283 2006-08-08 22:09:55 +00:00
moodler
fa145ae1af Merged fixes from stable 2006-07-19 10:21:52 +00:00
martinlanghoff
2338ad3239 Close Bug #5670 - get_courses_page() - remove costly and redundant DISTINCT
get_courses_page() uses get_records_sql() which means that it will actually
break if the first field requested isn't c.id. This in turn means that
the DISTINCT is not needed at all.

So let's go fast again!
2006-07-18 04:39:01 +00:00
moodler
418b4e5a5f Merged new variable $CFG->allowvisiblecoursesinhiddencategories from stable 2006-07-13 14:18:29 +00:00
tjhunt
a36f058e53 Bug 6101 - Automatically scroll to any errors when upgrading the database. JavaScript thanks to Andrew Walker. PHP changes are my fault. 2006-07-13 09:48:56 +00:00
tjhunt
3ef8c9362d Bug #5979 - Check in the OU's unit testing framework. Docs at http://docs.moodle.org/en/Unit_tests 2006-06-30 14:59:05 +00:00
tjhunt
3fae19dd98 Bug #5810 missing ' > 7' in debug test. Merged from MOODLE_16_STABLE. 2006-06-13 14:37:45 +00:00
stronk7
d96466d29f Moving from lastIP to lastip everywhere. Bug 5763.
(http://moodle.org/bugs/bug.php?op=show&bugid=5763)

Merged from MOODLE_16_STABLE
2006-06-09 10:04:43 +00:00
stronk7
ee6e91d4af make_default_scale() now searches properly under
both dataroot and dirroot, defaulting to en_utf8. Bug 5719.
(http://moodle.org/bugs/bug.php?op=show&bugid=5719)


Merged from MOODLE_16_STABLE
2006-06-04 15:19:05 +00:00
moodler
152a90601b Merged fixes from stable (undoing category visibility changes) 2006-05-02 07:56:25 +00:00
toyomoyo
5bce15857e added a comment 2006-04-18 03:45:23 +00:00
moodler
c204f5fea1 Made the empty recordset array cache global, so that various functions can
manipulate it.    See bug 5077.
2006-04-11 07:43:05 +00:00
moodler
d9d282e493 Fixing some documentation.
get_records etc are not inefficient if used correctly, and result in MUCH
more readable code that get_recordset does.

I'm already starting to see code being submitted that takes these
instructions literally and it looks like Java.  :-(
2006-04-06 15:26:44 +00:00
stronk7
475e9de86f SITE and SITEID were calculated *before* 'set names' so they weren't
fetched properly from DB. Moving such block of code from datalib.php
to setup.php to execute it *after* 'set names'. Credit goes to Skodak B-)
2006-03-29 23:38:46 +00:00
moodler
f07fa64418 Of $COURSE you can't redefine constants :) 2006-03-29 17:56:35 +00:00