Skip to content

Commit

Permalink
Fix for bug 1449
Browse files Browse the repository at this point in the history
Hidden events are now never shown.

There is a new parameter in calendar_sql_where which can show them if necessary.
  • Loading branch information
moodler committed May 24, 2004
1 parent 3cb9ee3 commit 8c165fe
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion calendar/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 8c165fe

Please sign in to comment.