From 9b00469b471a8b159c60ecca333f0f7064ba1d27 Mon Sep 17 00:00:00 2001 From: Jim Hu Date: Sat, 20 Dec 2008 03:22:54 +0000 Subject: misc error warnings and notices --- includes/event.php | 23 +++++++++++++---------- includes/todo.php | 10 +++++----- 2 files changed, 18 insertions(+), 15 deletions(-) (limited to 'includes') diff --git a/includes/event.php b/includes/event.php index c8c5865..faedd21 100644 --- a/includes/event.php +++ b/includes/event.php @@ -1,4 +1,5 @@ [:space:]]+[[:alnum:]/]",'\0',$event['description']); -if (is_array($organizer)) { +$organizer = ''; +if (isset($organizer) && is_array($organizer)) { $i=0; - $display .= $organizer_lang . ' - '; + $display .= $lang['l_organizer'] . ' - '; foreach ($organizer as $val) { $organizers .= $organizer[$i]["name"] . ', '; $i++; } $organizer = substr($organizers,0,-2); } -if (is_array($attendee)) { +$attendees = ''; +if (isset($attendee) && is_array($attendee)) { $i=0; - $display .= $attendee_lang . ' - '; + $display .= $lang['l_attendee'] . ' - '; foreach ($attendee as $val) { $attendees .= $attendee[$i]["name"] . ', '; $i++; @@ -51,13 +54,13 @@ if (is_array($attendee)) { $attendee = substr($attendees,0,-2); } -if ($event['location']) { +if (isset($event['location'])) { if ($event['url'] != '') $event['location'] = ''.stripslashes($event['location']).''; }else{ $event['location'] = stripslashes($event['location']); } -if (!$event['location'] && $event['url']) { +if (!isset($event['location']) && isset($event['url'])) { $event['location'] = ''.$event['url'].''; $lang['l_location'] = 'URL'; } @@ -79,10 +82,10 @@ switch ($event['status']){ $event['status'] = '' ; } -$page = new Page(BASE.'templates/'.$template.'/event.tpl'); +$page = new Page(BASE.'templates/'.$phpiCal_config->template.'/event.tpl'); $page->replace_tags(array( - 'charset' => $charset, + 'charset' => $phpiCal_config->charset, 'cal' => $event['calname'], 'event_text' => $event['event_text'], 'event_times' => $event_times, @@ -92,7 +95,7 @@ $page->replace_tags(array( 'status' => $event['status'], 'location' => stripslashes($event['location']), 'cal_title_full' => $event['calname'].' '.$lang['l_calendar'], - 'template' => $template, + 'template' => $phpiCal_config->template, 'l_organizer' => $lang['l_organizer'], 'l_attendee' => $lang['l_attendee'], 'l_status' => $lang['l_status'], diff --git a/includes/todo.php b/includes/todo.php index 6823405..1cefcdc 100644 --- a/includes/todo.php +++ b/includes/todo.php @@ -4,7 +4,7 @@ define('BASE', '../'); include_once(BASE.'functions/init.inc.php'); include_once(BASE.'functions/date_functions.php'); require_once(BASE.'functions/template.php'); - +$current_view = 'todo'; $vtodo_array = unserialize(urldecode(base64_decode($_REQUEST['todo_data']))); // Set the variables from the array @@ -25,9 +25,9 @@ $vtodo_text = ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]",'= 1 && $priority <= 4) { @@ -43,7 +43,7 @@ if ($priority >= 1 && $priority <= 4) { $page = new Page(BASE.'templates/'.$template.'/todo.tpl'); $page->replace_tags(array( - 'charset' => $charset, + 'charset' => $phpiCal_config->charset, 'cal' => $cal_title_full, 'vtodo_text' => $vtodo_text, 'description' => $description, @@ -52,7 +52,7 @@ $page->replace_tags(array( 'status' => $status, 'due_date' => $due_date, 'cal_title_full' => $cal_title_full, - 'template' => $template, + 'template' => $phpiCal_config->template, 'l_created' => $lang['l_created'], 'l_priority' => $lang['l_priority'], 'l_status' => $lang['l_status'], -- cgit v1.2.3