From 5d01bcce7dbbe60726b95a3b292d1a0f051831dd Mon Sep 17 00:00:00 2001 From: kink Date: Wed, 10 Sep 2003 16:00:27 +0000 Subject: [PATCH] In month view, sort events on a day by starttime so that an event that starts at 9 is not displayed below one that starts at 17. Include the time in the tooltips. Remove some E_ALL notices. This whole calendarcode needs some serious maintentance, but that's for later. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@5673 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- plugins/calendar/calendar.php | 3 ++- plugins/calendar/calendar_data.php | 5 +++++ plugins/calendar/event_edit.php | 6 +++--- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/plugins/calendar/calendar.php b/plugins/calendar/calendar.php index 4d4d9ba2..881cd9d6 100644 --- a/plugins/calendar/calendar.php +++ b/plugins/calendar/calendar.php @@ -116,7 +116,8 @@ function drawmonthview() { $i=0; while ($calfoo = each($calendardata[$cdate])) { $calbar = $calendardata[$cdate][$calfoo['key']]; - echo ($calbar['priority']==1) ? "$calbar[title]
\n" : "$calbar[title]
\n"; + $title = '['. $calfoo['key']. '] ' .$calbar['message']; + echo ($calbar['priority']==1) ? "$calbar[title]
\n" : "$calbar[title]
\n"; $i=$i+1; if($i==2){ break; diff --git a/plugins/calendar/calendar_data.php b/plugins/calendar/calendar_data.php index 82e16b86..1f702585 100644 --- a/plugins/calendar/calendar_data.php +++ b/plugins/calendar/calendar_data.php @@ -40,6 +40,11 @@ function readcalendardata() { 'reminder' => $fdata[6] ); } fclose ($fp); + // this is to sort the events within a day on starttime + foreach($calendardata as $day => $data) { + ksort($data, SORT_NUMERIC); + $calendardata[$day] = $data; + } } } } diff --git a/plugins/calendar/event_edit.php b/plugins/calendar/event_edit.php index e96abba9..533ce663 100644 --- a/plugins/calendar/event_edit.php +++ b/plugins/calendar/event_edit.php @@ -186,15 +186,15 @@ function confirm_update() { ) . html_tag( 'tr', html_tag( 'td', _("Priority:") , 'right', $color[4] ) ."\n" . - html_tag( 'td', $tmparray[priority] , 'left', $color[4] ) ."\n" + html_tag( 'td', $tmparray['priority'] , 'left', $color[4] ) ."\n" ) . html_tag( 'tr', html_tag( 'td', _("Title:") , 'right', $color[4] ) ."\n" . - html_tag( 'td', $tmparray[title] , 'left', $color[4] ) ."\n" + html_tag( 'td', $tmparray['title'] , 'left', $color[4] ) ."\n" ) . html_tag( 'tr', html_tag( 'td', _("Message:") , 'right', $color[4] ) ."\n" . - html_tag( 'td', $tmparray[message] , 'left', $color[4] ) ."\n" + html_tag( 'td', $tmparray['message'] , 'left', $color[4] ) ."\n" ) . html_tag( 'tr', html_tag( 'th', _("to:") . "
\n", '', $color[4], 'colspan="2"' ) ."\n" -- 2.25.1