Fix for bug 5132, search now no longer prevents display of

arbitrary single records
This commit is contained in:
moodler
2006-04-08 16:33:16 +00:00
parent 82d1796197
commit 3dec563cec
+11 -1
View File
@@ -386,7 +386,17 @@
$records = get_records_sql($sqlselect.$limit);
if (empty($records)) { // Nothing to show!
if ($search){
if ($record) { // Something was requested so try to show that at least (bug 5132)
if (isteacher($course->id) || empty($data->approval) ||
$record->approved || (isloggedin() && $record->userid == $USER->id)) {
if (!$currentgroup || $record->groupid == $currentgroup || $record->groupid == 0) {
$records[] = $record;
}
}
}
if ($records) { // OK, we can show this one
data_print_template('singletemplate', $records, $data, $search, $page);
} else if ($search){
notify(get_string('nomatch','data'));
} else {
notify(get_string('norecords','data'));