소스 검색

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.

Thijs Kinkhorst 22 년 전
부모
커밋
d349eb1c7e
3개의 변경된 파일10개의 추가작업 그리고 4개의 파일을 삭제
  1. 2 1
      plugins/calendar/calendar.php
  2. 5 0
      plugins/calendar/calendar_data.php
  3. 3 3
      plugins/calendar/event_edit.php

+ 2 - 1
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) ? "<a href=\"#\" style=\"text-decoration:none; color: $color[1]\" title=\"$calbar[message]\">$calbar[title]</a><br>\n" : "<a href=\"#\" style=\"text-decoration:none; color: $color[6]\" title=\"$calbar[message]\">$calbar[title]</a><br>\n";
+                    $title = '['. $calfoo['key']. '] ' .$calbar['message'];
+                    echo ($calbar['priority']==1) ? "<a href=\"#\" style=\"text-decoration:none; color: $color[1]\" title=\"$title\">$calbar[title]</a><br>\n" : "<a href=\"#\" style=\"text-decoration:none; color: $color[6]\" title=\"$title\">$calbar[title]</a><br>\n";
                     $i=$i+1;
                     if($i==2){
                         break;

+ 5 - 0
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;
+            }
         }
     }
 }

+ 3 - 3
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:") . "<br>\n", '', $color[4], 'colspan="2"' ) ."\n"