From 7f2e37b5eb011cc6498880deb523f993736ce214 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Lehrke?= Date: Wed, 17 Mar 2010 16:57:03 +0000 Subject: [PATCH] Configurable timezone for file export of calendar data --- calendar/inc/class.calendar_hooks.inc.php | 14 ++++++++++++++ calendar/inc/class.calendar_ical.inc.php | 16 +++++++++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/calendar/inc/class.calendar_hooks.inc.php b/calendar/inc/class.calendar_hooks.inc.php index c0fd02b49f..38c214223b 100644 --- a/calendar/inc/class.calendar_hooks.inc.php +++ b/calendar/inc/class.calendar_hooks.inc.php @@ -250,6 +250,10 @@ class calendar_hooks $freebusy_help = lang('Should not loged in persons be able to see your freebusy information? You can set an extra password, different from your normal password, to protect this informations. The freebusy information is in iCal format and only include the times when you are busy. It does not include the event-name, description or locations. The URL to your freebusy information is %1.',''.$freebusy_url.''); } + // Timezone for file exports + $export_tzs = array(1 => 'Use Event TZ'); + $export_tzs += egw_time::getTimezones(); + return array( 'defaultcalendar' => array( 'type' => 'select', @@ -425,6 +429,16 @@ class calendar_hooks 'admin' => False, 'forced' => 'ical', ), + 'export_timezone' => array( + 'type' => 'select', + 'label' => 'Timezone of event exports', + 'name' => 'export_timezone', + 'values' => $export_tzs, + 'help' => 'Use this timezone to export calendar data.', + 'xmlrpc' => True, + 'admin' => False, + 'default' => '1', // Use event's TZ + ), 'notifyAdded' => array( 'type' => 'notify', 'label' => 'Notification messages for added events', diff --git a/calendar/inc/class.calendar_ical.inc.php b/calendar/inc/class.calendar_ical.inc.php index 65133b1395..217d9f00de 100644 --- a/calendar/inc/class.calendar_ical.inc.php +++ b/calendar/inc/class.calendar_ical.inc.php @@ -1943,7 +1943,21 @@ class calendar_ical extends calendar_boupdate break; case 'file': // used outside of SyncML, eg. by the calendar itself ==> all possible fields - $this->tzid = false; // use event's TZ + if (isset($this->cal_prefs['export_timezone'])) + { + switch ($this->cal_prefs['export_timezone']) + { + case 1: + $this->tzid = false; // use event's TZ + break; + default: + $this->tzid = $this->cal_prefs['export_timezone']; + } + } + else + { + $this->tzid = false; // use event's TZ + } $this->supportedFields = $defaultFields['full']; break;