From c7f728d4ba4e9f1faf53850e539939a668d67332 Mon Sep 17 00:00:00 2001 From: nathangray Date: Wed, 14 Sep 2016 09:44:48 -0600 Subject: [PATCH] Make sure calendar CSV export still gets results when filtering by criteria with no end date --- calendar/inc/class.calendar_export_csv.inc.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/calendar/inc/class.calendar_export_csv.inc.php b/calendar/inc/class.calendar_export_csv.inc.php index 72eff6edf4..797e6a6602 100644 --- a/calendar/inc/class.calendar_export_csv.inc.php +++ b/calendar/inc/class.calendar_export_csv.inc.php @@ -49,14 +49,20 @@ class calendar_export_csv implements importexport_iface_export_plugin { { case 'criteria': $query = array( - 'start' => $options['criteria']['start'], - 'end' => strtotime('+1 day',$options['criteria']['end'])-1, 'categories' => $options['categories'] ? $options['categories'] : $options['criteria']['categories'], //'enum_recuring' => false, // we want the recurring events enumerated for csv export 'daywise' => false, 'users' => $options['criteria']['owner'], 'cfs' => $cfs // Otherwise we shouldn't get any custom fields ); + if($options['criteria']['start']) + { + $query['start'] = $options['criteria']['start']; + } + if($options['criteria']['end']) + { + $query['end'] = strtotime('+1 day',$options['criteria']['end'])-1; + } if(Api\Storage\Merge::hasExportLimit($export_limit) && !$limit_exception) { $query['offset'] = 0; $query['num_rows'] = (int)$export_limit; // ! int of 'no' is 0