diff options
-rw-r--r-- | day.php | 8 | ||||
-rw-r--r-- | functions/date_functions.php | 20 | ||||
-rw-r--r-- | functions/ical_parser.php | 44 | ||||
-rw-r--r-- | functions/init.inc.php | 4 | ||||
-rw-r--r-- | week.php | 2 |
5 files changed, 49 insertions, 29 deletions
@@ -33,7 +33,7 @@ $start_week_time = strtotime(dateOfWeek($getdate, $week_start_day)); $dayborder = 0; $nbrGridCols = 1; -if (is_array($master_array[($getdate)])) { +if (isset($master_array[($getdate)])) { foreach($master_array[($getdate)] as $ovlKey => $ovlValue) { if ($ovlKey != '-1') { foreach($ovlValue as $ovl2Value) { @@ -59,7 +59,7 @@ if (is_array($master_array[($getdate)])) { } ?> -<?php if (is_array($master_array['-2'])) include (BASE.'functions/todo.js'); ?> +<?php if (isset($master_array['-2'])) include (BASE.'functions/todo.js'); ?> </head> <body bgcolor="#FFFFFF"> <?php include (BASE.'includes/header.inc.php'); ?> @@ -101,7 +101,7 @@ if (is_array($master_array[($getdate)])) { <table width="100%" border="0" cellspacing="0" cellpadding="0" class="G10B"> <?php // The all day events returned here. - if ($master_array[($getdate)]['-1']) { + if (isset($master_array[($getdate)]['-1'])) { echo "<tr>\n"; echo '<td colspan="3" height="24">'."\n"; echo '<table width="100%" border="0" cellspacing="1" cellpadding="4">'."\n"; @@ -179,7 +179,7 @@ if (is_array($master_array[($getdate)])) { } // add events that overlap $day_start instead of cutting them out completely - if ("$day_start" == "$cal_time" && is_array($master_array[$getdate])) { + if ("$day_start" == "$cal_time" && isset($master_array[$getdate])) { foreach($master_array[$getdate] as $time_key => $time_arr) { if ((int)$time_key < (int)$cal_time && is_array($time_arr) && $time_key != '-1') { foreach($time_arr as $event_tmp) { diff --git a/functions/date_functions.php b/functions/date_functions.php index e8abe2c..cc13518 100644 --- a/functions/date_functions.php +++ b/functions/date_functions.php @@ -170,17 +170,25 @@ function openevent($cal, $st, $end, $arr, $lines, $wrap, $clic, $fclic) { $ev = $arr["event_text"]; $event_text = strip_tags($event_text, '<b><i><u>'); } - if ($arr["organizer"]) { + if (isset($arr["organizer"])) { $organizer = urlencode(addslashes($arr["organizer"])); + } else { + $organizer = ''; } - if ($arr["attendee"]) { + if (isset($arr["attendee"])) { $attendee = urlencode(addslashes($arr["attendee"])); + } else { + $attendee = ''; } - if ($arr["location"]) { - $organizer = $arr["location"]; + if (isset($arr["location"])) { + $location = $arr["location"]; + } else { + $location = ''; } - if ($arr["status"]) { - $organizer = $arr["status"]; + if (isset($arr["status"])) { + $status = $arr["status"]; + } else { + $status = ''; } if ($event_text != "") { if ($lines) $event_text = word_wrap($event_text, $wrap, $lines); diff --git a/functions/ical_parser.php b/functions/ical_parser.php index 2c193b4..1ccdde5 100644 --- a/functions/ical_parser.php +++ b/functions/ical_parser.php @@ -94,11 +94,11 @@ if ($parse_file) { $recurrence_id, $uid, $class, $attendee, $location, $organizer ); - $except_dates = array(); - $except_times = array(); + $except_dates = array(); + $except_times = array(); $first_duration = TRUE; - $count = 1000000; - $valarm_set = FALSE; + $count = 1000000; + $valarm_set = FALSE; unset( $until, $bymonth, $byday, $bymonthday, $byweek, $byweekno, @@ -109,13 +109,15 @@ if ($parse_file) { } elseif ($line == 'END:VEVENT') { // CLASS support - if ($class == 'PRIVATE') { - $summary ='**PRIVATE**'; - $description ='**PRIVATE**'; - } elseif ($class == 'CONFIDENTIAL') { - $summary ='**CONFIDENTIAL**'; - $description ='**CONFIDENTIAL**'; - } + if (isset($class)) { + if ($class == 'PRIVATE') { + $summary ='**PRIVATE**'; + $description ='**PRIVATE**'; + } elseif ($class == 'CONFIDENTIAL') { + $summary ='**CONFIDENTIAL**'; + $description ='**CONFIDENTIAL**'; + } + } // make sure we have some value for $uid if (!isset($uid)) { @@ -145,8 +147,11 @@ if ($parse_file) { $write_processed = true; } - if (!isset($summary)) $summary = ''; - if (!isset($description)) $description = ''; + if (!isset($summary)) $summary = ''; + if (!isset($description)) $description = ''; + if (!isset($status)) $status = ''; + if (!isset($class)) $class = ''; + if (!isset($location)) $location = ''; $mArray_begin = mktime (0,0,0,12,21,($this_year - 1)); $mArray_end = mktime (0,0,0,1,12,($this_year + 1)); @@ -179,13 +184,16 @@ if ($parse_file) { } // RECURRENCE-ID Support - if ($recurrence_d) { + if (isset($recurrence_d)) { + $recurrence_delete["$recurrence_d"]["$recurrence_t"] = $uid; } // handle single changes in recurring events // Maybe this is no longer need since done at bottom of parser? - CL 11/20/02 if ($uid_valid && $write_processed) { + if (!isset($hour)) $hour = 00; + if (!isset($minute)) $minute = 00; $processed[$uid] = array($start_date,($hour.$minute)); } @@ -908,7 +916,9 @@ if ($parse_file) { } } } -//print '<pre>'; + + /* + //print '<pre>'; // Remove pesky recurrences if (is_array($recurrence_delete)) { foreach ($recurrence_delete as $delete => $delete_key) { @@ -943,7 +953,9 @@ if ($parse_file) { } } } - } + } + + */ // Sort the array by absolute date. if (isset($master_array) && is_array($master_array)) { ksort($master_array); diff --git a/functions/init.inc.php b/functions/init.inc.php index 2b44e69..05326f8 100644 --- a/functions/init.inc.php +++ b/functions/init.inc.php @@ -6,12 +6,12 @@ //chmod(BASE.'calendars/School.ics',0666); // uncomment when developing, comment for shipping version -// error_reporting (E_ALL); +error_reporting (E_ALL); if (!defined('BASE')) define('BASE', './'); include(BASE.'config.inc.php'); include(BASE.'functions/error.php'); -if ($HTTP_COOKIE_VARS['phpicalendar']) { +if (isset($HTTP_COOKIE_VARS['phpicalendar'])) { $phpicalendar = unserialize(stripslashes($HTTP_COOKIE_VARS['phpicalendar'])); if (isset($phpicalendar['cookie_language'])) $language = $phpicalendar['cookie_language']; if (isset($phpicalendar['cookie_calendar'])) $default_cal_check = $phpicalendar['cookie_calendar']; @@ -58,7 +58,7 @@ for ($i=0;$i<7;$i++) { echo "<link rel=\"alternate\" type=\"application/rss+xml\" title=\"RSS\" href=\"".$default_path."/rss/rss.php?cal=".$cal."&rssview=week\">"; } ?> - <?php if (is_array($master_array['-2'])) include (BASE.'functions/todo.js'); ?> + <?php if (isset($master_array['-2'])) include (BASE.'functions/todo.js'); ?> </head> <body bgcolor="#FFFFFF"> <?php include (BASE.'includes/header.inc.php'); ?> |