127 Commits

Author SHA1 Message Date
moodler
0ad4eb5f63 Add institution to the data returned about course students 2004-02-06 12:03:30 +00:00
moodler
b5abf3e824 Fixed a Typo - thanks Bruno Vernier 2004-02-04 06:16:59 +00:00
moodler
d4469f2a84 Clean up of insert_record with some better error-checking 2004-02-03 15:18:41 +00:00
moodler
69d79bc31f OK, some big improvements to the logs.
Logs now include a field called modid which contains the coursemodule id.

This makes it now possible to

   - see complete logs per-activity

   - do backup/restore of logs

The upgrade process will currently try to scan all the old logs and
rebuild this field based on available data (especially forums).

STILL TO DO:  alter all the non-forum modules to send the coursemodule id
2004-01-31 14:47:57 +00:00
moodler
3d35e6b732 Putting in a placeholder when counting or gettig users in group 0
(return nothing for now)
2004-01-31 04:03:46 +00:00
moodler
0720313b30 get_course_students can now look for groups as well (doesn't handle
group 0 yet)

get_course_users is more robust (fixes the journal report problem etc)
2004-01-31 03:30:31 +00:00
gustav_delius
3d94772d47 better logging of forum mail errors, see http://moodle.org/mod/forum/discuss.php?d=4865. Required the addition of an extra optional argument $user="" to add_to_log() 2004-01-30 18:21:56 +00:00
moodler
fcf9c45033 New paratmeter to insert_record called primarykey (defaults to "id")
and removed insert_record_old
2004-01-30 09:04:31 +00:00
paca70
77e84a85f2 My php 4.3.4/postgres7.4 combination was thinking
that returned id-column was string and some modules were thingking that theres
insert error if return value is string.
Right now all id-colums is always integer so
this should be ok.
2004-01-30 07:45:36 +00:00
moodler
89f1cea654 Fixed problem with magic quotes 2004-01-30 02:25:02 +00:00
moodler
0892f7bd01 IMPORTANT! CRUCIAL CHANGE TO MAJOR FUNCTION!
Petri Asikainen rewrote insert_record to use ADOdb functions.  It might
be very slightly slower but it gets rid of all the horrible not-quite-working
PostgreSQL workarounds the old one contained.

It worked for him on PostgreSQL 7.4 and for me on MySQL 3.23 and 4.0.15,
so I'm checking it in.

Please test it thoroughly on your test systems.

Since it writes data it has the potential to stuff things up, so be
careful on production systems for a few days.
2004-01-29 15:27:21 +00:00
moodler
70812e39a0 Added new table called "user preferences" which can be used for
storing arbitrary preferences for each user.

Thanks to Jon Papaioannou for the first draft of this code
which I modified.
2004-01-28 14:14:19 +00:00
moodler
404afe6b86 Get groupmode when returning a list of instances 2004-01-26 09:13:47 +00:00
gustav_delius
2e39d2f810 minor fixes, including bugs 997, 998 2004-01-25 19:37:04 +00:00
moodler
2c4263c433 Sort group members by last access by default 2004-01-10 16:52:33 +00:00
moodler
14f3260978 Fix for case calling get_courses("all") when there is no user 2004-01-08 04:50:43 +00:00
moodler
75194fffbf Temporary sorting order on group members 2003-12-31 14:16:55 +00:00
moodler
3facf28fe1 Fix when storing group memberships in USER session 2003-12-30 19:06:53 +00:00
moodler
2d439c9d59 Slight fix for MySQL 4 2003-12-30 18:19:15 +00:00
moodler
0da33e07b9 Need to change table name! It was tougher than I thought to work around
the reserved word "group"
2003-12-30 18:07:09 +00:00
moodler
f374fb1006 This is the first check-in of support for groups.
It's very early (it doesn't actually do anything yet!) but you can
define groups and get an idea of how the interface is shaping up.
I also wanted to show that I have actually done something on this! :-)

From here my plan is to add group support to the modules, one by one
(forums first), then go back and clean up some of the central interfaces,
graphics etc.

Finally, test, test, test and get 1.2 out well before the end of February.
2003-12-30 17:18:06 +00:00
moodler
3f1d9b22ba Undoing that last checkin while I examine the consequences for other
database types
2003-12-02 16:21:28 +00:00
paca70
ce24824eba To fix postgresql 7.4 default values.
Starting with v. 7.4 postgres is returning default-values with datatype in form:
'default value'::data type
This cannot be inserted back to database so DEFAULT keyword must be used.
2003-12-02 15:42:33 +00:00
paca70
a051e31700 To fix postgres column renaming. 2003-12-01 22:28:36 +00:00
moodler
a328425d17 New feature based on code from Gustav Delius
-> A-Z subsets on the participant list.

http://moodle.org/mod/forum/discuss.php?d=3162

I also made a new datalib function called count_course_students()
2003-11-04 12:09:52 +00:00
moodler
937ae59c8e Get longtimenosee students according to their course access (not site access) 2003-10-27 14:01:29 +00:00
moodler
4d744a220a Added a new column to user_students and user_teachers called "timeaccess"
for recording the last access to the COURSE.

This is updated at the same time as add_to_log and is now used instead
of user->lastaccess when course user listings are required.

This means course listings now show what you expect and open up the way
for a "current users" listing and instant messaging etc ...
2003-10-27 12:38:00 +00:00
moodler
489b291962 When searching users don't use "LIKE" for all databases. 2003-09-19 08:33:27 +00:00
moodler
160e811553 Don't grab unconfirmed users in user listing 2003-09-18 11:51:05 +00:00
moodler
7a1ade1b78 Make get_course_students backward compatible 2003-09-18 04:50:22 +00:00
moodler
4969ad7400 First attempt at proper paging for the user page.
Still needs some work ...
2003-09-18 04:46:34 +00:00
moodler
30222590f7 When adding a new column, set all the default values manually 2003-09-14 17:39:18 +00:00
moodler
18a97fd84d Some early phpdoc-style documentation (thanks to Russell Jungwirth!)
Fixes for use of MySQL-only CONCAT function on other databases
2003-09-14 04:04:15 +00:00
moodler
88487dea6d One GROUP BY -> DISTINCT 2003-09-10 13:28:27 +00:00
moodler
0db8b2e2b7 Some fixes for PostgreSQL (use DISTINCT) 2003-09-10 13:17:13 +00:00
moodler
f1c1b17ab5 Some small fixes to the category display:
- small numbers of courses (less than 8) are displayed in full,
    unless the creator or admin is editing.

  - course counts are now accurate when all courses are removed from
    a category
2003-09-03 14:05:31 +00:00
moodler
3af6e1dbb8 Allow Course creators to see all hidden categories and courses 2003-09-03 08:29:05 +00:00
moodler
5b6a1dd3ad Invisible courses get put last on the My Courses listing 2003-09-03 08:10:02 +00:00
moodler
2962233937 Fixed a little typo on PostgreSQL code 2003-09-03 08:02:01 +00:00
moodler
de9cbba690 Minor change to make user searches a bit better
Next time I'll put proper paging in
2003-08-27 13:36:22 +00:00
moodler
7f12f9cdd9 'Extras' in cached course modinfo activities is now returned.
This means that Resources can now employ them on the index listing.

Specifically, Resources that are popup now popup from there too.
2003-08-26 13:47:46 +00:00
moodler
1a5ab4490f Improvements to logs when looking at site logs.
Also, improvements to get_site_users (slower but it works now!)
2003-08-23 06:19:05 +00:00
moodler
7a7ac154a4 Some small fixes when deleting a category 2003-08-22 12:49:37 +00:00
moodler
519d369f60 Added full paging to all displays of logs! :-) 2003-08-22 06:07:18 +00:00
moodler
2f3499b70d Fixed up get_my_courses().
It's not a tidy SQL statement any more but it's MUCH MUCH faster
with large data sets.
2003-08-21 17:24:40 +00:00
moodler
8130b77b40 Split get-courses_page from get-courses so they can specialise 2003-08-21 14:04:04 +00:00
moodler
53b67df521 Fixed the SQL for teachers and students 2003-08-21 12:19:09 +00:00
moodler
f68e5995e5 Fix for non-logged-in person 2003-08-21 09:39:07 +00:00
moodler
8ef9cb5618 Some fixes to handle very very big categories.
- paging
  - more efficient SQL
2003-08-21 09:33:07 +00:00
moodler
356fea4a64 Slightly better 2003-08-21 08:20:20 +00:00