diff --git a/calendar/inc/class.calendar_timezones.inc.php b/calendar/inc/class.calendar_timezones.inc.php index 0b7ac0a3ab..a41a31b62a 100644 --- a/calendar/inc/class.calendar_timezones.inc.php +++ b/calendar/inc/class.calendar_timezones.inc.php @@ -111,7 +111,7 @@ class calendar_timezones // if not tzid queried, resolve aliases automatically if ($data && $data['alias'] && $what != 'tzid' && $what != 'alias') { - $data = self::is2tz($data['alias'],null); + $data = self::id2tz($data['alias'],null); } return !$data ? $data : ($what ? $data[$what] : $data); } @@ -206,4 +206,36 @@ class calendar_timezones $GLOBALS['egw']->framework->render('

'.self::import_sqlite()."

\n",lang('Update timezones'),true); } } -calendar_timezones::init_static(); \ No newline at end of file +/* +if (isset($_SERVER['SCRIPT_FILENAME']) && $_SERVER['SCRIPT_FILENAME'] == __FILE__) // some tests +{ + $GLOBALS['egw_info'] = array( + 'flags' => array( + 'currentapp' => 'calendar', + ) + ); + include('../../header.inc.php'); + calendar_timezones::init_static(); + +// echo "

Testing availability of VTIMEZONE data for each tzid supported by PHP

\n"; +// foreach(DateTimeZone::listIdentifiers() as $tz) + echo "

Testing availability of VTIMEZONE data for each TZID supported by EGroupware

\n"; + foreach(call_user_func_array('array_merge',egw_time::getTimezones()) as $tz => $label) + { + if (($id = calendar_timezones::tz2id($tz,'component')) || $tz == 'UTC') // UTC is always supported + { + $found[] = $tz; + //if (substr($tz,0,10) == 'Australia/') echo "$tz: found
\n"; + } + else + { + $not_found[] = $tz; + echo "$tz: NOT found
\n"; + } + } + echo '

'.count($found).' found, '.count($not_found)." NOT found

\n"; + + if ($not_found) echo "
\n\$no_vtimezone = array(\n\t'".implode("',\n\t'",$not_found)."',\n);\n
\n"; +} +else*/ +calendar_timezones::init_static(); diff --git a/phpgwapi/inc/class.egw_time.inc.php b/phpgwapi/inc/class.egw_time.inc.php index face3916cd..5fafb7ff51 100644 --- a/phpgwapi/inc/class.egw_time.inc.php +++ b/phpgwapi/inc/class.egw_time.inc.php @@ -430,8 +430,51 @@ class egw_time extends DateTime 'Arctic' => array(), 'UTC' => array('UTC' => 'UTC'), ); + // no VTIMEZONE available in calendar_timezones --> do NOT return them + static $no_vtimezone = array( + 'Europe/Tiraspol', + 'America/Atka', + 'America/Buenos_Aires', + 'America/Catamarca', + 'America/Coral_Harbour', + 'America/Cordoba', + 'America/Ensenada', + 'America/Fort_Wayne', + 'America/Indianapolis', + 'America/Jujuy', + 'America/Knox_IN', + 'America/Mendoza', + 'America/Porto_Acre', + 'America/Rosario', + 'America/Virgin', + 'Asia/Ashkhabad', + 'Asia/Beijing', + 'Asia/Chungking', + 'Asia/Dacca', + 'Asia/Macao', + 'Asia/Riyadh87', + 'Asia/Riyadh88', + 'Asia/Riyadh89', + 'Asia/Tel_Aviv', + 'Asia/Thimbu', + 'Asia/Ujung_Pandang', + 'Asia/Ulan_Bator', + 'Australia/ACT', + 'Australia/Canberra', + 'Australia/LHI', + 'Australia/North', + 'Australia/NSW', + 'Australia/Queensland', + 'Australia/South', + 'Australia/Tasmania', + 'Australia/Victoria', + 'Australia/West', + 'Australia/Yancowinna', + 'Pacific/Samoa', + ); foreach(DateTimeZone::listIdentifiers() as $name) { + if (in_array($name,$no_vtimezone)) continue; // do NOT allow to set in EGroupware, as we have not VTIMEZONE component for it list($continent,$rest) = explode('/',$name,2); if (!isset($tzs[$continent])) continue; // old depricated timezones $datetime = new egw_time('now',new DateTimeZone($name));