From 50ce9c8c7c7ac6b8c3137e84ec4da8a1bbe38a12 Mon Sep 17 00:00:00 2001 From: Jim Hu Date: Mon, 29 Dec 2008 03:07:34 +0000 Subject: change handling of multiday allday events in week view; other misc changes --- functions/date_functions.php | 37 +++++++++++++++++++++++++++---------- 1 file changed, 27 insertions(+), 10 deletions(-) (limited to 'functions/date_functions.php') diff --git a/functions/date_functions.php b/functions/date_functions.php index ec70fa6..931e613 100644 --- a/functions/date_functions.php +++ b/functions/date_functions.php @@ -153,16 +153,33 @@ function chooseOffset($time, $timezone = '') { } return $offset; } - +/* Returns a string to make event text with a link to popup boxes + $arr is a master array item + $lines is the number of lines to restrict the event_text to, using word_wrap + $length is the length of one line + $link_class is a css class + $pre_text and $post_text are to add tags around the link text (e.g. or) + + $title is the tooltip for the link +*/ function openevent($event_date, $time, $uid, $arr, $lines = 0, $length = 0, $link_class = '', $pre_text = '', $post_text = '') { - global $cpath, $master_array; + global $cpath, $timeFormat, $dateFormat_week; $return = ''; $event_text = stripslashes(urldecode($arr["event_text"])); - if (empty($start)) { + # build tooltip + if ($time == -1) { + $start = localizeDate($dateFormat_week, $arr['start_unixtime']); + $end = localizeDate($dateFormat_week, ($arr['end_unixtime'] - 60)); $title = $event_text; + if ($start != $end) $title = "$start - $end $event_text"; } else { - $title = $arr['event_start'].' - '.$arr['event_end'].': '.$event_text; + $start = date($timeFormat, $arr['start_unixtime']); + $end = date($timeFormat, $arr['end_unixtime']); + $title = "$start: $event_text"; + if ($start != $end) $title = "$start - $end $event_text"; } + $title .= "\n".urldecode($arr['description'])."\n".urldecode($arr['location']); + $title = trim($title); # for iCal pseudo tag comptability if (ereg("<([[:alpha:]]+://)([^<>[:space:]]+)>",$event_text,$matches)) { $full_event_text = $matches[1] . $matches[2]; @@ -181,14 +198,14 @@ function openevent($event_date, $time, $uid, $arr, $lines = 0, $length = 0, $lin $escaped_date = addslashes($event_date); $escaped_time = addslashes($time); $escaped_uid = addslashes($uid); - $event_data = addslashes(serialize ($master_array[$event_date][$time][$uid])); + $event_data = addslashes(serialize ($arr)); // fix for URL-length bug in IE: populate and submit a hidden form on click static $popup_data_index = 0; -$return = " - "; + $return = " + "; $return .= ''; $popup_data_index++; -- cgit v1.2.3