]> git.mjollnir.org Git - moodle.git/commitdiff
Chat now logs "talk" events ... which also updates last access in the course
authormoodler <moodler>
Fri, 30 Apr 2004 12:40:42 +0000 (12:40 +0000)
committermoodler <moodler>
Fri, 30 Apr 2004 12:40:42 +0000 (12:40 +0000)
so chatters appear in the online users block so Tom is happy.  :-)

Seriously though, it's good to have talking events in the log.

mod/chat/db/mysql.php
mod/chat/db/mysql.sql
mod/chat/db/postgres7.php
mod/chat/db/postgres7.sql
mod/chat/insert.php
mod/chat/version.php

index 6270ccc7a85202bea69af3e939f7a80bf869e147..1bb74215a321545394cfb1c766a9ec246273b587 100644 (file)
@@ -33,6 +33,10 @@ function chat_upgrade($oldversion) {
         chat_refresh_events();
     }
 
+    if ($oldversion < 2004043000) {
+        modify_database("", "INSERT INTO prefix_log_display VALUES ('chat', 'talk', 'chat', 'name');");
+    }
+
     return true;
 }
 
index d11b71c1a5e106cfbe9d8793dd1269872dcc85a6..6efe107078d4f9d2de5f8d6569272f31d85a3a62 100644 (file)
@@ -58,4 +58,5 @@ INSERT INTO prefix_log_display VALUES ('chat', 'view', 'chat', 'name');
 INSERT INTO prefix_log_display VALUES ('chat', 'add', 'chat', 'name');
 INSERT INTO prefix_log_display VALUES ('chat', 'update', 'chat', 'name');
 INSERT INTO prefix_log_display VALUES ('chat', 'report', 'chat', 'name');
+INSERT INTO prefix_log_display VALUES ('chat', 'talk', 'chat', 'name');
 
index caf36d012083ec5be77e4a98849e314eab853401..5857707014b3956d0f9f45870c5cdd5f0200b826 100644 (file)
@@ -16,6 +16,10 @@ function chat_upgrade($oldversion) {
         chat_refresh_events();
     }
 
+    if ($oldversion < 2004043000) {
+        modify_database("", "INSERT INTO prefix_log_display VALUES ('chat', 'talk', 'chat', 'name');");
+    }
+
     return true;
 }
 
index bbdca03d5836c9f85d7a7b3ca7608e2799a82c6d..b77d1187f1d5dc2d4f82dcf112a299b9e32c802e 100644 (file)
@@ -55,3 +55,4 @@ INSERT INTO prefix_log_display VALUES ('chat', 'view', 'chat', 'name');
 INSERT INTO prefix_log_display VALUES ('chat', 'add', 'chat', 'name');
 INSERT INTO prefix_log_display VALUES ('chat', 'update', 'chat', 'name');
 INSERT INTO prefix_log_display VALUES ('chat', 'report', 'chat', 'name');
+INSERT INTO prefix_log_display VALUES ('chat', 'talk', 'chat', 'name');
index 2b0031d1db050dcba4afb272f5d09be26728ab93..60a6b41d972164a759b39ab07c09b7ff213f88cd 100644 (file)
@@ -20,7 +20,7 @@
     require_login($chat->course);
 
     if ($groupid) {
-        if (!isteacheredit($course->id) and !ismember($groupid)) {
+        if (!isteacheredit($chat->course) and !ismember($groupid)) {
             error("You can't chat here!");
         }
     }
 
         $chatuser->lastmessageping = time();
         update_record("chat_users", $chatuser);
+
+        if ($cm = get_coursemodule_from_instance("chat", $chat->id, $chat->course)) {
+            add_to_log($chat->course, "chat", "talk", "view.php?id=$cm->id", $chat->id, $cm->id);
+        }
     }
     
 /// Go back to the other page
index efdfdbebfad034c4a728d5c34a171fe51e680ffa..56f054ea51b2da0083c592401e2a254eeaaa8ec6 100644 (file)
@@ -5,7 +5,7 @@
 ///  This fragment is called by moodle_needs_upgrading() and /admin/index.php
 /////////////////////////////////////////////////////////////////////////////////
 
-$module->version  = 2004042500;   // The (date) version of this module
+$module->version  = 2004043000;   // The (date) version of this module
 $module->requires = 2004013101;  // Requires this Moodle version
 $module->cron     = 300;          // How often should cron check this module (seconds)?