From 8c165fe91a86a5231796542ee4ff95a6d3e33f27 Mon Sep 17 00:00:00 2001 From: moodler Date: Mon, 24 May 2004 01:44:48 +0000 Subject: [PATCH] Fix for bug 1449 Hidden events are now never shown. There is a new parameter in calendar_sql_where which can show them if necessary. --- calendar/lib.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/calendar/lib.php b/calendar/lib.php index b5e47c5f8c..d4d5f86d82 100644 --- a/calendar/lib.php +++ b/calendar/lib.php @@ -412,7 +412,7 @@ function calendar_get_upcoming($courses, $groups, $users, $daysinfuture, $maxeve return $output; } -function calendar_sql_where($tstart, $tend, $users, $groups, $courses, $withduration = true) { +function calendar_sql_where($tstart, $tend, $users, $groups, $courses, $withduration=true, $ignorehidden=true) { $whereclause = ''; // Quick test if(is_bool($users) && is_bool($groups) && is_bool($courses)) { @@ -464,6 +464,12 @@ function calendar_sql_where($tstart, $tend, $users, $groups, $courses, $withdura if(!empty($whereclause)) $whereclause .= ' OR'; $whereclause .= ' groupid = 0 AND courseid != 0'; } + + if ($ignorehidden) { + if (!empty($whereclause)) $whereclause .= ' AND'; + $whereclause .= ' visible = 1'; + } + if($withduration) { $timeclause = 'timestart + timeduration >= '.$tstart.' AND timestart <= '.$tend; } -- 2.39.5