"MDL-11371, The View past chat sessions should not appear if there haven't been any."

This commit is contained in:
dongsheng 2008-10-15 09:03:30 +00:00
parent 48eb7bc9de
commit 8eed94e2f0

View file

@ -113,13 +113,15 @@
groups_print_activity_menu($cm, "view.php?id=$cm->id"); groups_print_activity_menu($cm, "view.php?id=$cm->id");
if ($currentgroup) { if ($currentgroup) {
$groupselect = " AND groupid = '$currentgroup'";
$groupparam = "&groupid=$currentgroup"; $groupparam = "&groupid=$currentgroup";
} else { } else {
$groupselect = "";
$groupparam = ""; $groupparam = "";
} }
if ($chat->studentlogs or has_capability('mod/chat:readlog',$context)) { if ($chat->studentlogs or has_capability('mod/chat:readlog',$context)) {
if ($msg = get_records_select('chat_messages', "chatid = '$chat->id' $groupselect", '', 'id', '', 1)) { if ($msg = $DB->get_records_select('chat_messages', "chatid = ? $groupselect", array($chat->id))) {
echo '<div class="reportlink">'; echo '<div class="reportlink">';
echo "<a href=\"report.php?id=$cm->id\">". echo "<a href=\"report.php?id=$cm->id\">".
get_string('viewreport', 'chat').'</a>'; get_string('viewreport', 'chat').'</a>';