From: <cl...@us...> - 2003-11-19 07:54:13
|
Update of /cvsroot/phpicalendar/phpicalendar/functions In directory sc8-pr-cvs1:/tmp/cvs-serv11463/functions Modified Files: date_functions.php ical_parser.php init.inc.php Log Message: Checked in a new popup system. Also added calname to calendar for popup reference. Index: date_functions.php =================================================================== RCS file: /cvsroot/phpicalendar/phpicalendar/functions/date_functions.php,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** date_functions.php 17 Sep 2003 19:23:30 -0000 1.16 --- date_functions.php 19 Nov 2003 07:54:09 -0000 1.17 *************** *** 161,212 **** } ! function openevent($cal, $st, $end, $arr, $lines, $wrap, $clic, $fclic, $class) { $event_text = stripslashes(urldecode($arr["event_text"])); # for iCal pseudo tag <http> comptability ! if (ereg("<([[:alpha:]]+://)([^<>[:space:]]+)>",$event_text,$reg)) { ! $ev = $reg[1] . $reg[2]; ! $event_text = $reg[2]; } else { ! $ev = $arr["event_text"]; $event_text = strip_tags($event_text, '<b><i><u>'); } if (isset($arr["organizer"])) { ! $organizer = urlencode(addslashes($arr["organizer"])); ! } else { ! $organizer = ''; } if (isset($arr["attendee"])) { ! $attendee = urlencode(addslashes($arr["attendee"])); ! } else { ! $attendee = ''; } if (isset($arr["location"])) { ! $location = $arr["location"]; ! } else { ! $location = ''; } if (isset($arr["status"])) { ! $status = $arr["status"]; ! } else { ! $status = ''; } ! if ($event_text != "") { ! if ($lines) $event_text = word_wrap($event_text, $wrap, $lines); ! $dsc = urlencode(addslashes($arr["description"])); ! echo '<a class="'.$class.'" href="'; ! if ((!(ereg("([[:alpha:]]+://[^<>[:space:]]+)", $ev, $res))) || ($dsc)) { ! echo "javascript:w=window.open('"; ! echo "includes/event.php?event="; ! echo urlencode(addslashes($ev)); ! echo "&cal="; ! echo urlencode(addslashes($cal)); ! echo "&start=$st&end=$end&description=$dsc&status=$status&location=$location&organizer=$organizer&attendee=$attendee"; ! echo "','Popup','"; ! echo "scrollbars=yes,width=460,height=275"; ! echo "');w.focus()"; } else { ! echo $res[1]; } ! echo '">'.$clic.$event_text.$fclic.'</a>'; } } --- 161,221 ---- } ! function openevent($calendar_name, $start, $end, $arr, $lines, $wrap, $pre_text, $post_text, $link_class) { $event_text = stripslashes(urldecode($arr["event_text"])); # for iCal pseudo tag <http> comptability ! if (ereg("<([[:alpha:]]+://)([^<>[:space:]]+)>",$event_text,$matches)) { ! $full_event_text = $matches[1] . $matches[2]; ! $event_text = $matches[2]; } else { ! $full_event_text = $event_text; $event_text = strip_tags($event_text, '<b><i><u>'); } + if (isset($arr["organizer"])) { ! $organizer = addslashes($arr["organizer"]); } + if (isset($arr["attendee"])) { ! $attendee = addslashes($arr["attendee"]); } + if (isset($arr["location"])) { ! $location = addslashes($arr["location"]); } + if (isset($arr["status"])) { ! $status = addslashes($arr["status"]); } ! ! if (isset($arr["description"])) { ! $description = addslashes(stripslashes(urldecode($arr["description"]))); ! } ! ! if (!empty($event_text)) { ! if ($lines > 0) { ! $event_text = word_wrap($event_text, $wrap, $lines); ! } ! ! if ((!(ereg("([[:alpha:]]+://[^<>[:space:]]+)", $full_event_text, $res))) || ($description)) { ! $escaped_event = addslashes($full_event_text); ! $escaped_calendar = addslashes($calendar_name); ! $escaped_start = addslashes($start); ! $escaped_end = addslashes($end); ! // fix for URL-length bug in IE: populate and submit a hidden form on click ! static $popup_data_index = 0; ! echo <<<END ! ! <script language="Javascript" type="text/javascript"><!-- ! var eventData = new EventData('$escaped_event', '$escaped_calendar', '$escaped_start', '$escaped_end', '$description', '$status', '$location', '$organizer', '$attendee'); ! document.popup_data[$popup_data_index] = eventData; ! // --></script> ! ! END; ! echo "<a class=\"$link_class\" href=\"#\" onclick=\"openEventWindow($popup_data_index);\">"; ! $popup_data_index++; } else { ! echo "<a class=\"$link_class\" href=\"{$res[1]}\">"; } ! echo "{$pre_text}{$event_text}{$post_text}</a>\n"; } } Index: ical_parser.php =================================================================== RCS file: /cvsroot/phpicalendar/phpicalendar/functions/ical_parser.php,v retrieving revision 1.129 retrieving revision 1.130 diff -C2 -d -r1.129 -r1.130 *** ical_parser.php 18 Nov 2003 19:43:13 -0000 1.129 --- ical_parser.php 19 Nov 2003 07:54:09 -0000 1.130 *************** *** 52,61 **** if ($parse_file) { - // some initializations, that have to be outside the calnumber loop - // auxiliary array for determining overlaps of events $overlap_array = array (); - - // using $uid to set specific points in array, if $uid is not in the - // .ics file, we need to have some unique place in the array $uid_counter = 0; } --- 52,56 ---- *************** *** 63,69 **** $calnumber = 1; foreach ($cal_filelist as $filename) { ! if ($parse_file) { - // patch to speed up parser $ifile = fopen($filename, "r"); --- 58,67 ---- $calnumber = 1; foreach ($cal_filelist as $filename) { ! ! // Find the real name of the calendar. ! $actual_calname = str_replace($calendar_path, '', $filename); ! $actual_calname = str_replace('/', '', str_replace('.ics', '', $actual_calname)); ! if ($parse_file) { $ifile = fopen($filename, "r"); *************** *** 232,236 **** while ($start != $end) { $start_date2 = date('Ymd', $start); ! $master_array[($start_date2)][('-1')][$uid]= array ('event_text' => $summary, 'description' => $description, 'calnumber' => $calnumber); $start = strtotime('+1 day', $start); } --- 230,234 ---- while ($start != $end) { $start_date2 = date('Ymd', $start); ! $master_array[($start_date2)][('-1')][$uid]= array ('event_text' => $summary, 'description' => $description, 'calnumber' => $calnumber, 'calname' => $actual_calname ); $start = strtotime('+1 day', $start); } *************** *** 259,263 **** } $nbrOfOverlaps = checkOverlap($start_date_tmp, $start_time_tmp, $end_time_tmp, $uid); ! $master_array[$start_date_tmp][$time_tmp][$uid] = array ('event_start' => $start_time_tmp, 'event_end' => $end_time_tmp, 'display_end' => $display_end_tmp, 'start_unixtime' => $start_unixtime, 'end_unixtime' => $end_unixtime, 'event_text' => $summary, 'event_length' => $length, 'event_overlap' => $nbrOfOverlaps, 'description' => $description, 'status' => $status, 'class' => $class, 'spans_day' => true, 'location' => $location, 'organizer' => serialize($organizer), 'attendee' => serialize($attendee) ); $start_tmp = strtotime('+1 day',$start_tmp); } --- 257,261 ---- } $nbrOfOverlaps = checkOverlap($start_date_tmp, $start_time_tmp, $end_time_tmp, $uid); ! $master_array[$start_date_tmp][$time_tmp][$uid] = array ('event_start' => $start_time_tmp, 'event_end' => $end_time_tmp, 'display_end' => $display_end_tmp, 'start_unixtime' => $start_unixtime, 'end_unixtime' => $end_unixtime, 'event_text' => $summary, 'event_length' => $length, 'event_overlap' => $nbrOfOverlaps, 'description' => $description, 'status' => $status, 'class' => $class, 'spans_day' => true, 'location' => $location, 'organizer' => serialize($organizer), 'attendee' => serialize($attendee), 'calnumber' => $calnumber, 'calname' => $actual_calname ); $start_tmp = strtotime('+1 day',$start_tmp); } *************** *** 274,278 **** if (!in_array($start_date, $except_dates)) { $nbrOfOverlaps = checkOverlap($start_date, $start_time, $end_time_tmp1, $uid); ! $master_array[($start_date)][($hour.$minute)][$uid] = array ('event_start' => $start_time, 'event_end' => $end_time_tmp1, 'display_end' => $display_end_tmp, 'start_unixtime' => $start_unixtime, 'end_unixtime' => $end_unixtime, 'event_text' => $summary, 'event_length' => $length, 'event_overlap' => $nbrOfOverlaps, 'description' => $description, 'status' => $status, 'class' => $class, 'spans_day' => false, 'location' => $location, 'organizer' => serialize($organizer), 'attendee' => serialize($attendee), 'calnumber' => $calnumber ); if (!$write_processed) $master_array[($start_date)][($hour.$minute)][$uid]['exception'] = true; } --- 272,276 ---- if (!in_array($start_date, $except_dates)) { $nbrOfOverlaps = checkOverlap($start_date, $start_time, $end_time_tmp1, $uid); ! $master_array[($start_date)][($hour.$minute)][$uid] = array ('event_start' => $start_time, 'event_end' => $end_time_tmp1, 'display_end' => $display_end_tmp, 'start_unixtime' => $start_unixtime, 'end_unixtime' => $end_unixtime, 'event_text' => $summary, 'event_length' => $length, 'event_overlap' => $nbrOfOverlaps, 'description' => $description, 'status' => $status, 'class' => $class, 'spans_day' => false, 'location' => $location, 'organizer' => serialize($organizer), 'attendee' => serialize($attendee), 'calnumber' => $calnumber, 'calname' => $actual_calname ); if (!$write_processed) $master_array[($start_date)][($hour.$minute)][$uid]['exception'] = true; } *************** *** 576,580 **** while ($start_time2 < $end_time2) { $start_date2 = date('Ymd', $start_time2); ! $master_array[($start_date2)][('-1')][]= array ('event_text' => $summary, 'description' => $description, 'calnumber' => $calnumber); $start_time2 = strtotime('+1 day', $start_time2); } --- 574,578 ---- while ($start_time2 < $end_time2) { $start_date2 = date('Ymd', $start_time2); ! $master_array[($start_date2)][('-1')][]= array ('event_text' => $summary, 'description' => $description, 'calnumber' => $calnumber, 'calname' => $actual_calname ); $start_time2 = strtotime('+1 day', $start_time2); } *************** *** 601,605 **** } $nbrOfOverlaps = checkOverlap($start_date_tmp, $start_time_tmp, $end_time_tmp, $uid); ! $master_array[$start_date_tmp][$time_tmp][$uid] = array ('event_start' => $start_time_tmp, 'event_end' => $end_time_tmp, 'display_end' => $display_end_tmp, 'start_unixtime' => $start_unixtime_tmp, 'end_unixtime' => $end_unixtime_tmp, 'event_text' => $summary, 'event_length' => $length, 'event_overlap' => $nbrOfOverlaps, 'description' => $description, 'status' => $status, 'class' => $class, 'spans_day' => true, 'location' => $location, 'organizer' => serialize($organizer), 'attendee' => serialize($attendee), 'calnumber' => $calnumber); $start_tmp = strtotime('+1 day',$start_tmp); } --- 599,603 ---- } $nbrOfOverlaps = checkOverlap($start_date_tmp, $start_time_tmp, $end_time_tmp, $uid); ! $master_array[$start_date_tmp][$time_tmp][$uid] = array ('event_start' => $start_time_tmp, 'event_end' => $end_time_tmp, 'display_end' => $display_end_tmp, 'start_unixtime' => $start_unixtime_tmp, 'end_unixtime' => $end_unixtime_tmp, 'event_text' => $summary, 'event_length' => $length, 'event_overlap' => $nbrOfOverlaps, 'description' => $description, 'status' => $status, 'class' => $class, 'spans_day' => true, 'location' => $location, 'organizer' => serialize($organizer), 'attendee' => serialize($attendee), 'calnumber' => $calnumber, 'calname' => $actual_calname); $start_tmp = strtotime('+1 day',$start_tmp); } *************** *** 616,620 **** if ($abs_until > $until_check) { $nbrOfOverlaps = checkOverlap($recur_data_date, $start_time, $end_time_tmp1, $uid); ! $master_array[($recur_data_date)][($hour.$minute)][$uid] = array ('event_start' => $start_time, 'event_end' => $end_time_tmp1, 'display_end' => $display_end_tmp, 'start_unixtime' => $start_unixtime_tmp, 'end_unixtime' => $end_unixtime_tmp, 'event_text' => $summary, 'event_length' => $length, 'event_overlap' => $nbrOfOverlaps, 'description' => $description, 'status' => $status, 'class' => $class, 'spans_day' => false, 'location' => $location, 'organizer' => serialize($organizer), 'attendee' => serialize($attendee), 'calnumber' => $calnumber); } } --- 614,618 ---- if ($abs_until > $until_check) { $nbrOfOverlaps = checkOverlap($recur_data_date, $start_time, $end_time_tmp1, $uid); ! $master_array[($recur_data_date)][($hour.$minute)][$uid] = array ('event_start' => $start_time, 'event_end' => $end_time_tmp1, 'display_end' => $display_end_tmp, 'start_unixtime' => $start_unixtime_tmp, 'end_unixtime' => $end_unixtime_tmp, 'event_text' => $summary, 'event_length' => $length, 'event_overlap' => $nbrOfOverlaps, 'description' => $description, 'status' => $status, 'class' => $class, 'spans_day' => false, 'location' => $location, 'organizer' => serialize($organizer), 'attendee' => serialize($attendee), 'calnumber' => $calnumber, 'calname' => $actual_calname); } } *************** *** 658,662 **** $vtodo_sort = $vtodo_priority; } ! $master_array['-2']["$vtodo_sort"]["$uid"] = array ('start_date' => $start_date, 'start_time' => $start_time, 'vtodo_text' => $summary, 'due_date'=> $due_date, 'due_time'=> $due_time, 'completed_date' => $completed_date, 'completed_time' => $completed_time, 'priority' => $vtodo_priority, 'status' => $status, 'class' => $class, 'categories' => $vtodo_categories, 'description' => $description); unset ($start_date, $start_time, $due_date, $due_time, $completed_date, $completed_time, $vtodo_priority, $status, $class, $vtodo_categories, $summary, $description); $vtodo_set = FALSE; --- 656,660 ---- $vtodo_sort = $vtodo_priority; } ! $master_array['-2']["$vtodo_sort"]["$uid"] = array ('start_date' => $start_date, 'start_time' => $start_time, 'vtodo_text' => $summary, 'due_date'=> $due_date, 'due_time'=> $due_time, 'completed_date' => $completed_date, 'completed_time' => $completed_time, 'priority' => $vtodo_priority, 'status' => $status, 'class' => $class, 'categories' => $vtodo_categories, 'description' => $description, 'calname' => $actual_calname); unset ($start_date, $start_time, $due_date, $due_time, $completed_date, $completed_time, $vtodo_priority, $status, $class, $vtodo_categories, $summary, $description); $vtodo_set = FALSE; Index: init.inc.php =================================================================== RCS file: /cvsroot/phpicalendar/phpicalendar/functions/init.inc.php,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** init.inc.php 14 Nov 2003 22:33:11 -0000 1.41 --- init.inc.php 19 Nov 2003 07:54:09 -0000 1.42 *************** *** 7,11 **** // uncomment when developing, comment for shipping version ! error_reporting (0); $ALL_CALENDARS_COMBINED = 'all_calendars_combined971'; --- 7,11 ---- // uncomment when developing, comment for shipping version ! error_reporting (E_ALL); $ALL_CALENDARS_COMBINED = 'all_calendars_combined971'; |