From 2ccdb089fcfdcb7ceb66283df426de105d22c8c3 Mon Sep 17 00:00:00 2001 From: Jason Oster Date: Fri, 16 Apr 2010 19:02:36 +0000 Subject: Fix calendar selection bug assuming "All Calendars Combined" --- functions/ical_parser.php | 2 +- functions/init.inc.php | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'functions') diff --git a/functions/ical_parser.php b/functions/ical_parser.php index 61e2587..ee1f65b 100644 --- a/functions/ical_parser.php +++ b/functions/ical_parser.php @@ -11,7 +11,7 @@ include_once(BASE.'functions/parse/recur_functions.php'); $realcal_mtime = time(); $parse_file = true; if ($phpiCal_config->save_parsed_cals == 'yes') { - if (sizeof ($cal_filelist) > 1) { + if (count($cal_filelist) == count($all_calendars_combined)) { // This is a special case for "all calendars combined" $parsedcal = $phpiCal_config->tmp_dir.'/parsedcal-'.urlencode($cpath.'::'.$phpiCal_config->ALL_CALENDARS_COMBINED).'-'.$this_year; if (file_exists($parsedcal)) { diff --git a/functions/init.inc.php b/functions/init.inc.php index 04069cf..3ac162b 100644 --- a/functions/init.inc.php +++ b/functions/init.inc.php @@ -48,9 +48,11 @@ if (isset($_GET['cal']) && $_GET['cal'] !='') { $cal_filenames[0] = $phpiCal_config->ALL_CALENDARS_COMBINED; } +$all_calendars_combined = availableCalendars($username, $password, $phpiCal_config->ALL_CALENDARS_COMBINED); + //load cal_filenames if $ALL_CALENDARS_COMBINED if ($cal_filenames[0] == $phpiCal_config->ALL_CALENDARS_COMBINED){ - $cal_filenames = availableCalendars($username, $password, $phpiCal_config->ALL_CALENDARS_COMBINED); + $cal_filenames = $all_calendars_combined; } // Separate the calendar identifiers into web calendars and local // calendars. -- cgit v1.2.3