]> git.mjollnir.org Git - moodle.git/commitdiff
Fix for bug #2004 (Bug of the Year! :D):
authordefacer <defacer>
Fri, 29 Oct 2004 17:21:19 +0000 (17:21 +0000)
committerdefacer <defacer>
Fri, 29 Oct 2004 17:21:19 +0000 (17:21 +0000)
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
calendar/view.php

index e569689d9a160bc95b995efc52e0ef44610c7701..6b3634c92f09d1241bb3391244cc90b6b7e561cf 100644 (file)
@@ -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
index c25c1400fd3171123c8d08c0659dbce4cc70c579..3f3402594dfcc42a6772f08cd6a45ef0f3be06ec 100644 (file)
@@ -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