]> git.mjollnir.org Git - moodle.git/commitdiff
Some fixes for delete groups sessions
authormoodler <moodler>
Tue, 24 Feb 2004 07:21:52 +0000 (07:21 +0000)
committermoodler <moodler>
Tue, 24 Feb 2004 07:21:52 +0000 (07:21 +0000)
mod/chat/report.php

index a86b65aa09b22a4e4b7e3929ed60ed8655f74128..d6991e7178df9cb91b60551436f734c187872c15 100644 (file)
@@ -6,7 +6,7 @@
     require_once("lib.php");
 
     require_variable($id);          // Course module ID
-    optional_variable($group, "");  // Start of period
+    optional_variable($groupid, "");  // Group
     optional_variable($start, "");  // Start of period
     optional_variable($end, "");    // End of period
     optional_variable($deletesession, "");    // Delete a session
 
     if ($start and $end and !$confirmdelete) {   // Show a full transcript
 
+        if ($groupid) {
+            $groupselect = " AND groupid = '$currentgroup'";
+            $groupparam = "&groupid=$currentgroup";
+        } else {
+            $groupselect = "";
+            $groupparam = "";
+        }
+
         print_header("$course->shortname: $chat->name: $strchatreport", "$course->fullname",
                      "$navigation <a href=\"index.php?id=$course->id\">$strchats</a> -> 
                      <a href=\"view.php?id=$cm->id\">$chat->name</a> -> 
 
         if ($deletesession and $isteacheredit) {
             notice_yesno(get_string("deletesessionsure", "chat"), 
-                         "report.php?id=$cm->id&deletesession=1&confirmdelete=1&start=$start&end=$end", 
+                         "report.php?id=$cm->id&deletesession=1&confirmdelete=1&start=$start&end=$end$groupparam", 
                          "report.php?id=$cm->id");
         }
 
         if (!$messages = get_records_select("chat_messages", "chatid = $chat->id AND 
                                                               timestamp >= '$start' AND 
-                                                              timestamp <= '$end'", "timestamp ASC")) {
+                                                              timestamp <= '$end' $groupselect", "timestamp ASC")) {
             print_heading(get_string("nomessages", "chat"));
 
         } else {
 
     if ($currentgroup) {
         $groupselect = " AND groupid = '$currentgroup'";
-        $groupparam = "&group=$currentgroup";
+        $groupparam = "&groupid=$currentgroup";
     } else {
         $groupselect = "";
         $groupparam = "";