From a94329a8ed846f04f4d1343cdee210ee8b34f9c9 Mon Sep 17 00:00:00 2001 From: defacer Date: Fri, 29 Oct 2004 17:21:19 +0000 Subject: [PATCH] Fix for bug #2004 (Bug of the Year! :D): Events in each day are now displayed ordered by starting time, and not by eventid as before. Thanks to Gustav for pointing this out! --- calendar/lib.php | 5 ++--- calendar/view.php | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/calendar/lib.php b/calendar/lib.php index e569689d9a..6b3634c92f 100644 --- a/calendar/lib.php +++ b/calendar/lib.php @@ -112,7 +112,7 @@ function calendar_get_mini($courses, $groups, $users, $cal_month = false, $cal_y $events = array(); } else { - $events = get_records_select('event', $whereclause); + $events = get_records_select('event', $whereclause, 'timestart'); } // This is either a genius idea or an idiot idea: in order to not complicate things, we use this rule: if, after @@ -297,8 +297,7 @@ function calendar_get_upcoming($courses, $groups, $users, $daysinfuture, $maxeve if ($whereclause === false) { $events = false; } else { - $whereclause .= ' ORDER BY timestart'; // We want them this way - $events = get_records_select('event', $whereclause); + $events = get_records_select('event', $whereclause, 'timestart'); } // This is either a genius idea or an idiot idea: in order to not complicate things, we use this rule: if, after diff --git a/calendar/view.php b/calendar/view.php index c25c1400fd..3f3402594d 100644 --- a/calendar/view.php +++ b/calendar/view.php @@ -312,7 +312,7 @@ function calendar_show_month_detailed($m, $y, $courses, $groups, $users) { $events = array(); } else { - $events = get_records_select('event', $whereclause); + $events = get_records_select('event', $whereclause, 'timestart'); } // Extract information: events vs. time -- 2.39.5