]> git.mjollnir.org Git - moodle.git/commitdiff
fixed capabilities in chat recent activity, removed broken optimization from message...
authorskodak <skodak>
Tue, 31 Oct 2006 21:07:00 +0000 (21:07 +0000)
committerskodak <skodak>
Tue, 31 Oct 2006 21:07:00 +0000 (21:07 +0000)
mod/chat/gui_header_js/insert.php
mod/chat/lib.php
mod/chat/report.php

index 799d6842c78f6dac5107a4ab11d51bf852f4ac00..6972bcc4a73861230c42d37f02c12f2595ba2d77 100644 (file)
@@ -14,7 +14,7 @@
         error('No chat found');
     }
 
-    if (!$course = get_record('course', 'id', $chat->course, '', '', '','', 'id, shortname')) {
+    if (!$course = get_record('course', 'id', $chat->course)) {
         error('Could not find the course this belongs to!');
     }
 
index 7ca4f942b8642e72b347641c1176153302679d06..d69c9510dc2edbea290e43317b56f61dd003c7cd 100644 (file)
@@ -199,12 +199,7 @@ function chat_print_recent_activity($course, $isteacher, $timestart) {
             if ($chat = get_record('chat', 'id', $chatuser->chatid)) {
               
                 // we find the course module id
-                $chatmod = get_record('modules', 'name', 'chat');
-                $SQL = "select * from {$CFG->prefix}course_modules where
-                        course = $course->id 
-                        and module = $chatmod->id
-                        and instance = $chat->id";
-                $cm = get_records_sql($SQL);
+                $cm = get_coursemodule_from_instance('chat', $chat->id, $course->id);
                 $context = get_context_instance(CONTEXT_MODULE, $cm->id);
               
                 // needs to be fixed
@@ -219,7 +214,7 @@ function chat_print_recent_activity($course, $isteacher, $timestart) {
             }
             $current = $chatuser->chatid;
         }
-        $fullname = fullname($chatuser, has_capability('moodle/site:viewfullnames', get_context_instance(CONTEXT_MODULE, $cm->id)));
+        $fullname = fullname($chatuser, has_capability('moodle/site:viewfullnames', get_context_instance(CONTEXT_COURSE, $course->id)));
         echo '<li class="info name">'.$fullname.'</li>';
     }
 
index 02faa08c1cdb743771986b6f576a1fd6b495b9c5..82af7f1ed42d86d8e75b6e5233974611c2e44988 100644 (file)
@@ -79,7 +79,7 @@
                     echo $formatmessage->html;
                 }
             }
-            print_simple_box_end('center');
+            print_simple_box_end();
         }
 
         if (!$deletesession or !has_capability('mod/chat:deletelog', $context)) {