Simplify the code a bit and move the visible = 1 SQL check out of the main part of the WHERE

statement. This might be actually fixing an operator precedence logic bug.
This commit is contained in:
defacer
2005-04-11 23:24:23 +00:00
parent 6e957c415c
commit 0ad072dea5
+5 -6
View File
@@ -511,11 +511,6 @@ function calendar_sql_where($tstart, $tend, $users, $groups, $courses, $withdura
return false;
}
if ($ignorehidden) {
if (!empty($whereclause)) $whereclause .= ' AND';
$whereclause .= ' visible = 1';
}
if($withduration) {
$timeclause = 'timestart + timeduration >= '.$tstart.' AND timestart <= '.$tend;
}
@@ -531,7 +526,11 @@ function calendar_sql_where($tstart, $tend, $users, $groups, $courses, $withdura
$whereclause = $timeclause;
}
return empty($whereclause) ? false : $whereclause;
if ($ignorehidden) {
$whereclause .= ' AND visible = 1';
}
return $whereclause;
}
function calendar_top_controls($type, $data) {