Fix Agenda Events sort by start date In personal Agenda- Refs #8014

1.9.x
José Loguercio 10 years ago
parent 4aaf4b291a
commit 4882ef1304
  1. 8
      main/calendar/agenda_list.php

@ -36,6 +36,14 @@ if (!empty($GLOBALS['_cid']) && $GLOBALS['_cid'] != -1) {
$this_section = SECTION_COURSES;
} else {
// Agenda is out of the course tool (e.g personal agenda)
// Little hack to sort the events by start date in personal agenda (Agenda events List view - See #8014)
usort($events, function($a, $b) {
$t1 = strtotime($a['start']);
$t2 = strtotime($b['start']);
return $t1 - $t2;
});
$url = false;
foreach ($events as &$event) {
$event['url'] = api_get_self() . '?cid=' . $event['course_id'] .

Loading…
Cancel
Save