Add $c->auto_refresh_duration option to set a auto refresh on any GET calendar.
[davical.git] / inc / vtimezone.php
bloba1509449c43c9c0477769ff584c0016de1b307f7
1 <?php
2 /**
3 * Extend the vComponent to specifically handle VTIMEZONE resources
4 */
6 require_once('AwlQuery.php');
7 require_once('vComponent.php');
9 class VTimezone extends vComponent {
11 static function getInstance($name) {
12 $qry = new AwlQuery('SELECT * FROM timezones WHERE tzid = ? ORDER BY active DESC', $name);
13 if ( $qry->Exec('VTimezone',__LINE__,__FILE__) && $qry->rows() > 0 && $row = $qry->Fetch() ) {
14 $vtz = new vComponent($row->vtimezone);
15 if ( $vtz->GetType() == 'VTIMEZONE' ) return $vtz;
16 $tmp = $vtz->GetComponents('VTIMEZONE');
17 if ( count($tmp) < 1 || $tmp[0]->GetType() != 'VTIMEZONE' ) return null;
18 $vtz = $tmp[0];
19 return $vtz;
21 return null;
24 static function msCdoToOlson($tzcdo) {
25 switch( $tzcdo ) {
26 /**
27 * List of Microsoft CDO Timezone IDs from here:
28 * http://msdn.microsoft.com/en-us/library/aa563018%28loband%29.aspx
30 case 0: return('UTC');
31 case 1: return('Europe/London');
32 case 2: return('Europe/Lisbon');
33 case 3: return('Europe/Paris');
34 case 4: return('Europe/Berlin');
35 case 5: return('Europe/Bucharest');
36 case 6: return('Europe/Prague');
37 case 7: return('Europe/Athens');
38 case 8: return('America/Brasilia');
39 case 9: return('America/Halifax');
40 case 10: return('America/New_York');
41 case 11: return('America/Chicago');
42 case 12: return('America/Denver');
43 case 13: return('America/Los_Angeles');
44 case 14: return('America/Anchorage');
45 case 15: return('Pacific/Honolulu');
46 case 16: return('Pacific/Apia');
47 case 17: return('Pacific/Auckland');
48 case 18: return('Australia/Brisbane');
49 case 19: return('Australia/Adelaide');
50 case 20: return('Asia/Tokyo');
51 case 21: return('Asia/Singapore');
52 case 22: return('Asia/Bangkok');
53 case 23: return('Asia/Kolkata');
54 case 24: return('Asia/Muscat');
55 case 25: return('Asia/Tehran');
56 case 26: return('Asia/Baghdad');
57 case 27: return('Asia/Jerusalem');
58 case 28: return('America/St_Johns');
59 case 29: return('Atlantic/Azores');
60 case 30: return('America/Noronha');
61 case 31: return('Africa/Casablanca');
62 case 32: return('America/Argentina/Buenos_Aires');
63 case 33: return('America/La_Paz');
64 case 34: return('America/Indiana/Indianapolis');
65 case 35: return('America/Bogota');
66 case 36: return('America/Regina');
67 case 37: return('America/Tegucigalpa');
68 case 38: return('America/Phoenix');
69 case 39: return('Pacific/Kwajalein');
70 case 40: return('Pacific/Fiji');
71 case 41: return('Asia/Magadan');
72 case 42: return('Australia/Hobart');
73 case 43: return('Pacific/Guam');
74 case 44: return('Australia/Darwin');
75 case 45: return('Asia/Shanghai');
76 case 46: return('Asia/Novosibirsk');
77 case 47: return('Asia/Karachi');
78 case 48: return('Asia/Kabul');
79 case 49: return('Africa/Cairo');
80 case 50: return('Africa/Harare');
81 case 51: return('Europe/Moscow');
82 case 53: return('Atlantic/Cape_Verde');
83 case 54: return('Asia/Yerevan');
84 case 55: return('America/Panama');
85 case 56: return('Africa/Nairobi');
86 case 58: return('Asia/Yekaterinburg');
87 case 59: return('Europe/Helsinki');
88 case 60: return('America/Godthab');
89 case 61: return('Asia/Rangoon');
90 case 62: return('Asia/Kathmandu');
91 case 63: return('Asia/Irkutsk');
92 case 64: return('Asia/Krasnoyarsk');
93 case 65: return('America/Santiago');
94 case 66: return('Asia/Colombo');
95 case 67: return('Pacific/Tongatapu');
96 case 68: return('Asia/Vladivostok');
97 case 69: return('Africa/Ndjamena');
98 case 70: return('Asia/Yakutsk');
99 case 71: return('Asia/Dhaka');
100 case 72: return('Asia/Seoul');
101 case 73: return('Australia/Perth');
102 case 74: return('Asia/Riyadh');
103 case 75: return('Asia/Taipei');
104 case 76: return('Australia/Sydney');
106 case 57: // null
107 case 52: // null
108 default: // null
110 return null;