From: <par...@us...> - 2009-07-08 18:28:19
|
Update of /cvsroot/phpicalendar/phpicalendar/functions In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv17508/functions Modified Files: draw_functions.php template.php Log Message: 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 Index: draw_functions.php =================================================================== RCS file: /cvsroot/phpicalendar/phpicalendar/functions/draw_functions.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** draw_functions.php 28 Dec 2008 19:30:41 -0000 1.9 --- draw_functions.php 8 Jul 2009 18:28:13 -0000 1.10 *************** *** 1,5 **** <?php # drawEventTimes returns starttime and endtime and event length for drawing into a grid ! function drawEventTimes ($start, $end) { global $phpiCal_config; $sta_h = $sta_min = $end_h = $end_min = "00"; --- 1,5 ---- <?php # drawEventTimes returns starttime and endtime and event length for drawing into a grid ! function drawEventTimes ($start, $end, $long_event = FALSE) { global $phpiCal_config; $sta_h = $sta_min = $end_h = $end_min = "00"; *************** *** 25,29 **** } ! if (($sta_h . $sta_min) == ($end_h . $end_min)) { $end_min += $gridLength; if ($end_min == 60) { --- 25,29 ---- } ! if ((!$long_event) && (($sta_h . $sta_min) == ($end_h . $end_min))) { $end_min += $gridLength; if ($end_min == 60) { *************** *** 31,36 **** $end_min = "00"; } ! } $draw_len = ($end_h * 60 + $end_min) - ($sta_h * 60 + $sta_min); return array ("draw_start" => ($sta_h . $sta_min), "draw_end" => ($end_h . $end_min), "draw_length" => $draw_len); } --- 31,37 ---- $end_min = "00"; } ! } $draw_len = ($end_h * 60 + $end_min) - ($sta_h * 60 + $sta_min); + return array ("draw_start" => ($sta_h . $sta_min), "draw_end" => ($end_h . $end_min), "draw_length" => $draw_len); } Index: template.php =================================================================== RCS file: /cvsroot/phpicalendar/phpicalendar/functions/template.php,v retrieving revision 1.120 retrieving revision 1.121 diff -C2 -d -r1.120 -r1.121 *** template.php 7 Jul 2009 14:48:29 -0000 1.120 --- template.php 8 Jul 2009 18:28:13 -0000 1.121 *************** *** 267,271 **** if ($ovlKey != "-1") { foreach($ovlValue as $ovl2Value) { ! $nbrGridCols[($thisday)] = kgv($nbrGridCols[($thisday)], ($ovl2Value["event_overlap"] + 1)); } } --- 267,271 ---- if ($ovlKey != "-1") { foreach($ovlValue as $ovl2Value) { ! $nbrGridCols[$thisday] = kgv($nbrGridCols[$thisday], ($ovl2Value["event_overlap"] + 1)); } } *************** *** 509,512 **** --- 509,525 ---- $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'); *************** *** 732,735 **** --- 745,761 ---- 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"; |