diff options
author | Jason Oster <parasytic@users.sourceforge.net> | 2009-07-08 18:28:13 +0000 |
---|---|---|
committer | Jason Oster <parasytic@users.sourceforge.net> | 2009-07-08 18:28:13 +0000 |
commit | ca4ff2e70c0e5de884c77d5183a603b741f9e05d (patch) | |
tree | a04a6fd3518d5914d55a07dc7a942c59fe2d913a /functions/template.php | |
parent | bc77101e73f5fdf8eeddf9bbb1d434fb396fb089 (diff) | |
download | phpicalendar-ca4ff2e70c0e5de884c77d5183a603b741f9e05d.tar.gz phpicalendar-ca4ff2e70c0e5de884c77d5183a603b741f9e05d.tar.bz2 phpicalendar-ca4ff2e70c0e5de884c77d5183a603b741f9e05d.zip |
Fix overlapping events which span a day, fix erroneously adding 15 minutes to events which span a day or more and end on the same time they start, add day-spanning icons in day and week views
Diffstat (limited to 'functions/template.php')
-rw-r--r-- | functions/template.php | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/functions/template.php b/functions/template.php index 9ce5124..1400873 100644 --- a/functions/template.php +++ b/functions/template.php @@ -266,7 +266,7 @@ class Page { # ovlKey is a time slot; $ovlValue is an array with key=uid if ($ovlKey != "-1") { foreach($ovlValue as $ovl2Value) { - $nbrGridCols[($thisday)] = kgv($nbrGridCols[($thisday)], ($ovl2Value["event_overlap"] + 1)); + $nbrGridCols[$thisday] = kgv($nbrGridCols[$thisday], ($ovl2Value["event_overlap"] + 1)); } } } @@ -508,6 +508,19 @@ class Page { if ($event_status != '') { $confirmed .= '<img src="images/'.$event_status.'.gif" width="9" height="9" alt="" border="0" hspace="0" vspace="0" /> '; } + $event_date_start = date('Ymd', $this_time_arr[$uid]['start_unixtime']); + $event_date_end = date('Ymd', $this_time_arr[$uid]['end_unixtime']); + if ($event_date_start != $event_date_end) { + if ($thisday == $event_date_start) { + $confirmed .= '<img src="images/longevent_start.gif" width="9" height="9" alt="" border="0" hspace="0" vspace="0" /> '; + } + else if ($thisday == $event_date_end) { + $confirmed .= '<img src="images/longevent_end.gif" width="9" height="9" alt="" border="0" hspace="0" vspace="0" /> '; + } + else { + $confirmed .= '<img src="images/longevent_mid.gif" width="9" height="9" alt="" border="0" hspace="0" vspace="0" /> '; + } + } $event_temp = $loop_event; $event = openevent($thisday, $cal_time, $uid, $this_time_arr[$uid], $phpiCal_config->week_events_lines, 25, 'ps'); $weekdisplay .= '<td rowspan="' . $event_length[$thisday][$i]['length'] . '" colspan="' . $drawWidth . '" align="left" valign="top" class="eventbg2_'.$event_calno.'">'."\n"; @@ -731,6 +744,19 @@ class Page { $confirmed = ''; if (is_array($event_recur)) $confirmed .= '<img src="images/recurring.gif" width="9" height="9" alt="" border="0" hspace="0" vspace="0" /> '; if ($event_status != '') $confirmed .= '<img src="images/'.$event_status.'.gif" width="9" height="9" alt="" border="0" hspace="0" vspace="0" /> '; + $event_date_start = date('Ymd', $this_time_arr[$uid]['start_unixtime']); + $event_date_end = date('Ymd', $this_time_arr[$uid]['end_unixtime']); + if ($event_date_start != $event_date_end) { + if ($getdate == $event_date_start) { + $confirmed .= '<img src="images/longevent_start.gif" width="9" height="9" alt="" border="0" hspace="0" vspace="0" /> '; + } + else if ($getdate == $event_date_end) { + $confirmed .= '<img src="images/longevent_end.gif" width="9" height="9" alt="" border="0" hspace="0" vspace="0" /> '; + } + else { + $confirmed .= '<img src="images/longevent_mid.gif" width="9" height="9" alt="" border="0" hspace="0" vspace="0" /> '; + } + } $daydisplay .= '<td rowspan="' . $event_length[$i]['length'] . '" colspan="' . $drawWidth . '" align="left" valign="top" class="eventbg2_'.$event_calno.'">'."\n"; // Start drawing the event |