From 25a8b7dbc4625dbc419c9c02f54811f8e8ed925c Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Wed, 23 Jan 2013 16:10:17 +0000 Subject: [PATCH] Fix iCal export --- .../inc/class.calendar_export_ical.inc.php | 28 ++++++++++++------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/calendar/inc/class.calendar_export_ical.inc.php b/calendar/inc/class.calendar_export_ical.inc.php index ab0fd7735b..1d37a2f47a 100644 --- a/calendar/inc/class.calendar_export_ical.inc.php +++ b/calendar/inc/class.calendar_export_ical.inc.php @@ -35,13 +35,14 @@ class calendar_export_ical extends calendar_export_csv { $limit_exception = bo_merge::is_export_limit_excepted(); if (!$limit_exception) $export_limit = bo_merge::getExportLimit('calendar'); - if($options['selection']['select'] == 'criteria') { + if($options['selection'] == 'criteria') + { $query = array( - 'start' => $options['selection']['start'], - 'end' => strtotime('+1 day',$options['selection']['end'])-1, - 'categories' => $options['categories'] ? $options['categories'] : $options['selection']['categories'], + 'start' => $options['criteria']['start'], + 'end' => strtotime('+1 day',$options['criteria']['end'])-1, + 'categories' => $options['categories'], 'daywise' => false, - 'users' => $options['selection']['owner'], + 'users' => $options['criteria']['owner'], 'cfs' => $cfs // Otherwise we shouldn't get any custom fields ); if(bo_merge::hasExportLimit($export_limit) && !$limit_exception) { @@ -49,9 +50,12 @@ class calendar_export_ical extends calendar_export_csv { $query['num_rows'] = (int)$export_limit; // ! int of 'no' is 0 } $events =& $this->bo->search($query); - } elseif ($options['selection']['select'] == 'search_results') { + } + elseif ($options['selection'] == 'search_results') + { $states = $GLOBALS['egw']->session->appsession('session_data','calendar'); - if($states['view'] == 'listview') { + if($states['view'] == 'listview') + { $query = $GLOBALS['egw']->session->appsession('calendar_list','calendar'); $query['num_rows'] = -1; // all $query['start'] = 0; @@ -62,16 +66,20 @@ class calendar_export_ical extends calendar_export_csv { } $ui = new calendar_uilist(); $ui->get_rows($query, $events, $unused); - } else { + } + else + { $query = $GLOBALS['egw']->session->appsession('session_data','calendar'); $query['users'] = explode(',', $query['owner']); $query['num_rows'] = -1; - if(bo_merge::hasExportLimit($export_limit) && !$limit_exception) { + if(bo_merge::hasExportLimit($export_limit) && !$limit_exception) + { $query['num_rows'] = (int)$export_limit; // ! int of 'no' is 0 } $events = array(); - switch($states['view']) { + switch($states['view']) + { case 'month': $query += calendar_export_csv::get_query_month($states); break;