From c2fa847c506d770e91d700372acacbe48c4534a7 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Fri, 3 Feb 2012 01:51:28 +0000 Subject: [PATCH] * eSync/Calendar: fixed tz-aliases to NOT use Etc/GMT* but Olson identifiers, no more exception in AS tzblob generation, generation of tzblobs for Etc/GMT* --- .../inc/class.calendar_activesync.inc.php | 27 +++++++++++++++---- calendar/setup/tz_aliases.inc.php | 6 ++--- 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/calendar/inc/class.calendar_activesync.inc.php b/calendar/inc/class.calendar_activesync.inc.php index ba0d87b049..1f7f3a5023 100644 --- a/calendar/inc/class.calendar_activesync.inc.php +++ b/calendar/inc/class.calendar_activesync.inc.php @@ -1328,7 +1328,18 @@ END:VTIMEZONE if (!isset($standard)) { - throw new egw_exception_assertion_failed("NO standard component for '$name' in '$component'!"); + if (preg_match('/^etc\/gmt([+-])([0-9]+)$/i',$name,$matches)) + { + $standard = array( + 'TZOFFSETTO' => sprintf('%s%02d00',$matches[1],$matches[2]), + 'TZOFFSETFROM' => sprintf('%s%02d00',$matches[1],$matches[2]), + ); + unset($daylight); + } + else + { + throw new egw_exception_assertion_failed("NO standard component for '$name' in '$component'!"); + } } // get bias and dstbias from standard component, which is present in all tz's // (dstbias is relative to bias and almost always 60 or 0) @@ -1482,10 +1493,15 @@ END:VTIMEZONE error_log(__METHOD__.'('.array2string($data).') NO matching timezone found --> using UTC now!'); break; } - if (self::tz2as($tz) == $data) - { - $cache[$key] = $tz; - break; + try { + if (self::tz2as($tz) == $data) + { + $cache[$key] = $tz; + break; + } + } + catch(Exception $e) { + // simpy ignore that, as it only means $tz can NOT be converted, because it has no VTIMEZONE component } } return $cache[$key]; @@ -1600,6 +1616,7 @@ if (isset($_SERVER['SCRIPT_FILENAME']) && $_SERVER['SCRIPT_FILENAME'] == __FILE_ 'America/New_York' => 'LAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAABAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAACAAMAAAAAAAAAxP///w==', 'Pacific/Auckland' => 'MP3//wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAABAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkAAAAFAAMAAAAAAAAAxP///w==', 'Australia/Sydney' => 'qP3//wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAFAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAoAAAAFAAIAAAAAAAAAxP///w==', + 'Etc/GMT+3' => 'TP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==', ) as $tz => $sync_blob) { // get as timezone data for a given timezone diff --git a/calendar/setup/tz_aliases.inc.php b/calendar/setup/tz_aliases.inc.php index 7b595297f5..ff85188d83 100644 --- a/calendar/setup/tz_aliases.inc.php +++ b/calendar/setup/tz_aliases.inc.php @@ -48,7 +48,7 @@ $tz_aliases = array( 'Fiji Standard Time' => 'Pacific/Fiji', 'GMT Standard Time' => 'Europe/London', 'GTB Standard Time' => 'Europe/Istanbul', - 'Georgian Standard Time' => 'Etc/GMT-3', + 'Georgian Standard Time' => 'Asia/Tbilisi', 'Greenland Standard Time' => 'America/Godthab', 'Greenwich Standard Time' => 'Atlantic/Reykjavik', // was 'Africa/Reykjavik', 'Hawaiian Standard Time' => 'Pacific/Honolulu', @@ -80,7 +80,7 @@ $tz_aliases = array( 'Pakistan Standard Time' => 'Asia/Karachi', 'Romance Standard Time' => 'Europe/Paris', 'Russian Standard Time' => 'Europe/Moscow', - 'SA Eastern Standard Time' => 'Etc/GMT+3', + 'SA Eastern Standard Time' => 'America/Buenos_Aires', 'SA Pacific Standard Time' => 'America/Bogota', 'SA Western Standard Time' => 'America/La_Paz', 'SE Asia Standard Time' => 'Asia/Bangkok', @@ -92,7 +92,7 @@ $tz_aliases = array( 'Tasmania Standard Time' => 'Australia/Hobart', 'Tokyo Standard Time' => 'Asia/Tokyo', 'Tonga Standard Time' => 'Pacific/Tongatapu', - 'US Eastern Standard Time' => 'Etc/GMT+5', + 'US Eastern Standard Time' => 'America/New_York', 'US Mountain Standard Time' => 'America/Phoenix', 'Venezuela Standard Time' => 'America/Caracas', 'Vladivostok Standard Time' => 'Asia/Vladivostok',