Passed
Branch master (ff9d34)
by Mike
09:14
created
lib/utils/timezoneutil.php 1 patch
Spacing   +165 added lines, -165 removed lines patch added patch discarded remove patch
@@ -18,83 +18,83 @@  discard block
 block discarded – undo
18 18
      * Updated at: 01.06.2012
19 19
      */
20 20
     private static $mstzones = array(
21
-                        "000" => array("Dateline Standard Time",                    "(GMT-12:00) International Date Line West"),
22
-                        "001" => array("Samoa Standard Time",                       "(GMT-11:00) Midway Island, Samoa"),
23
-                        "002" => array("Hawaiian Standard Time",                    "(GMT-10:00) Hawaii"),
24
-                        "003" => array("Alaskan Standard Time",                     "(GMT-09:00) Alaska"),
25
-                        "004" => array("Pacific Standard Time",                     "(GMT-08:00) Pacific Time (US and Canada); Tijuana"),
26
-                        "010" => array("Mountain Standard Time",                    "(GMT-07:00) Mountain Time (US and Canada)"),
27
-                        "013" => array("Mexico Standard Time 2",                    "(GMT-07:00) Chihuahua, La Paz, Mazatlan"),
28
-                        "015" => array("US Mountain Standard Time",                 "(GMT-07:00) Arizona"),
29
-                        "020" => array("Central Standard Time",                     "(GMT-06:00) Central Time (US and Canada"),
30
-                        "025" => array("Canada Central Standard Time",              "(GMT-06:00) Saskatchewan"),
31
-                        "030" => array("Mexico Standard Time",                      "(GMT-06:00) Guadalajara, Mexico City, Monterrey"),
32
-                        "033" => array("Central America Standard Time",             "(GMT-06:00) Central America"),
33
-                        "035" => array("Eastern Standard Time",                     "(GMT-05:00) Eastern Time (US and Canada)"),
34
-                        "040" => array("US Eastern Standard Time",                  "(GMT-05:00) Indiana (East)"),
35
-                        "045" => array("SA Pacific Standard Time",                  "(GMT-05:00) Bogota, Lima, Quito"),
36
-                        "uk1" => array("Venezuela Standard Time",                   "(GMT-04:30) Caracas"),                     // added
37
-                        "050" => array("Atlantic Standard Time",                    "(GMT-04:00) Atlantic Time (Canada)"),
38
-                        "055" => array("SA Western Standard Time",                  "(GMT-04:00) Caracas, La Paz"),
39
-                        "056" => array("Pacific SA Standard Time",                  "(GMT-04:00) Santiago"),
40
-                        "060" => array("Newfoundland and Labrador Standard Time",   "(GMT-03:30) Newfoundland and Labrador"),
41
-                        "065" => array("E South America Standard Time" ,            "(GMT-03:00) Brasilia"),
42
-                        "070" => array("SA Eastern Standard Time",                  "(GMT-03:00) Buenos Aires, Georgetown"),
43
-                        "073" => array("Greenland Standard Time",                   "(GMT-03:00) Greenland"),
44
-                        "075" => array("Mid-Atlantic Standard Time",                "(GMT-02:00) Mid-Atlantic"),
45
-                        "080" => array("Azores Standard Time",                      "(GMT-01:00) Azores"),
46
-                        "083" => array("Cape Verde Standard Time",                  "(GMT-01:00) Cape Verde Islands"),
47
-                        "085" => array("GMT Standard Time",                         "(GMT) Greenwich Mean Time: Dublin, Edinburgh, Lisbon, London"),
48
-                        "090" => array("Greenwich Standard Time",                   "(GMT) Casablanca, Monrovia"),
49
-                        "095" => array("Central Europe Standard Time",              "(GMT+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague"),
50
-                        "100" => array("Central European Standard Time",            "(GMT+01:00) Sarajevo, Skopje, Warsaw, Zagreb"),
51
-                        "105" => array("Romance Standard Time",                     "(GMT+01:00) Brussels, Copenhagen, Madrid, Paris"),
52
-                        "110" => array("W Europe Standard Time",                    "(GMT+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna"),
53
-                        "111" => array("W. Europe Standard Time",                   "(GMT+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna"),
54
-                        "113" => array("W Central Africa Standard Time",            "(GMT+01:00) West Central Africa"),
55
-                        "115" => array("E Europe Standard Time",                    "(GMT+02:00) Bucharest"),
56
-                        "120" => array("Egypt Standard Time",                       "(GMT+02:00) Cairo"),
57
-                        "125" => array("FLE Standard Time",                         "(GMT+02:00) Helsinki, Kiev, Riga, Sofia, Tallinn, Vilnius"),
58
-                        "130" => array("GTB Standard Time",                         "(GMT+02:00) Athens, Istanbul, Minsk"),
59
-                        "135" => array("Israel Standard Time",                      "(GMT+02:00) Jerusalem"),
60
-                        "140" => array("South Africa Standard Time",                "(GMT+02:00) Harare, Pretoria"),
61
-                        "145" => array("Russian Standard Time",                     "(GMT+03:00) Moscow, St. Petersburg, Volgograd"),
62
-                        "150" => array("Arab Standard Time",                        "(GMT+03:00) Kuwait, Riyadh"),
63
-                        "155" => array("E Africa Standard Time",                    "(GMT+03:00) Nairobi"),
64
-                        "158" => array("Arabic Standard Time",                      "(GMT+03:00) Baghdad"),
65
-                        "160" => array("Iran Standard Time",                        "(GMT+03:30) Tehran"),
66
-                        "165" => array("Arabian Standard Time",                     "(GMT+04:00) Abu Dhabi, Muscat"),
67
-                        "170" => array("Caucasus Standard Time",                    "(GMT+04:00) Baku, Tbilisi, Yerevan"),
68
-                        "175" => array("Transitional Islamic State of Afghanistan Standard Time","(GMT+04:30) Kabul"),
69
-                        "180" => array("Ekaterinburg Standard Time",                "(GMT+05:00) Ekaterinburg"),
70
-                        "185" => array("West Asia Standard Time",                   "(GMT+05:00) Islamabad, Karachi, Tashkent"),
71
-                        "190" => array("India Standard Time",                       "(GMT+05:30) Chennai, Kolkata, Mumbai, New Delhi"),
72
-                        "193" => array("Nepal Standard Time",                       "(GMT+05:45) Kathmandu"),
73
-                        "195" => array("Central Asia Standard Time",                "(GMT+06:00) Astana, Dhaka"),
74
-                        "200" => array("Sri Lanka Standard Time",                   "(GMT+06:00) Sri Jayawardenepura"),
75
-                        "201" => array("N Central Asia Standard Time",              "(GMT+06:00) Almaty, Novosibirsk"),
76
-                        "203" => array("Myanmar Standard Time",                     "(GMT+06:30) Yangon Rangoon"),
77
-                        "205" => array("SE Asia Standard Time",                     "(GMT+07:00) Bangkok, Hanoi, Jakarta"),
78
-                        "207" => array("North Asia Standard Time",                  "(GMT+07:00) Krasnoyarsk"),
79
-                        "210" => array("China Standard Time",                       "(GMT+08:00) Beijing, Chongqing, Hong Kong SAR, Urumqi"),
80
-                        "215" => array("Singapore Standard Time",                   "(GMT+08:00) Kuala Lumpur, Singapore"),
81
-                        "220" => array("Taipei Standard Time",                      "(GMT+08:00) Taipei"),
82
-                        "225" => array("W Australia Standard Time",                 "(GMT+08:00) Perth"),
83
-                        "227" => array("North Asia East Standard Time",             "(GMT+08:00) Irkutsk, Ulaanbaatar"),
84
-                        "230" => array("Korea Standard Time",                       "(GMT+09:00) Seoul"),
85
-                        "235" => array("Tokyo Standard Time",                       "(GMT+09:00) Osaka, Sapporo, Tokyo"),
86
-                        "240" => array("Yakutsk Standard Time",                     "(GMT+09:00) Yakutsk"),
87
-                        "245" => array("AUS Central Standard Time",                 "(GMT+09:30) Darwin"),
88
-                        "250" => array("Cen Australia Standard Time",               "(GMT+09:30) Adelaide"),
89
-                        "255" => array("AUS Eastern Standard Time",                 "(GMT+10:00) Canberra, Melbourne, Sydney"),
90
-                        "260" => array("E Australia Standard Time",                 "(GMT+10:00) Brisbane"),
91
-                        "265" => array("Tasmania Standard Time",                    "(GMT+10:00) Hobart"),
92
-                        "270" => array("Vladivostok Standard Time",                 "(GMT+10:00) Vladivostok"),
93
-                        "275" => array("West Pacific Standard Time",                "(GMT+10:00) Guam, Port Moresby"),
94
-                        "280" => array("Central Pacific Standard Time",             "(GMT+11:00) Magadan, Solomon Islands, New Caledonia"),
95
-                        "285" => array("Fiji Islands Standard Time",                "(GMT+12:00) Fiji Islands, Kamchatka, Marshall Islands"),
96
-                        "290" => array("New Zealand Standard Time",                 "(GMT+12:00) Auckland, Wellington"),
97
-                        "300" => array("Tonga Standard Time",                       "(GMT+13:00) Nuku'alofa"),
21
+                        "000" => array("Dateline Standard Time", "(GMT-12:00) International Date Line West"),
22
+                        "001" => array("Samoa Standard Time", "(GMT-11:00) Midway Island, Samoa"),
23
+                        "002" => array("Hawaiian Standard Time", "(GMT-10:00) Hawaii"),
24
+                        "003" => array("Alaskan Standard Time", "(GMT-09:00) Alaska"),
25
+                        "004" => array("Pacific Standard Time", "(GMT-08:00) Pacific Time (US and Canada); Tijuana"),
26
+                        "010" => array("Mountain Standard Time", "(GMT-07:00) Mountain Time (US and Canada)"),
27
+                        "013" => array("Mexico Standard Time 2", "(GMT-07:00) Chihuahua, La Paz, Mazatlan"),
28
+                        "015" => array("US Mountain Standard Time", "(GMT-07:00) Arizona"),
29
+                        "020" => array("Central Standard Time", "(GMT-06:00) Central Time (US and Canada"),
30
+                        "025" => array("Canada Central Standard Time", "(GMT-06:00) Saskatchewan"),
31
+                        "030" => array("Mexico Standard Time", "(GMT-06:00) Guadalajara, Mexico City, Monterrey"),
32
+                        "033" => array("Central America Standard Time", "(GMT-06:00) Central America"),
33
+                        "035" => array("Eastern Standard Time", "(GMT-05:00) Eastern Time (US and Canada)"),
34
+                        "040" => array("US Eastern Standard Time", "(GMT-05:00) Indiana (East)"),
35
+                        "045" => array("SA Pacific Standard Time", "(GMT-05:00) Bogota, Lima, Quito"),
36
+                        "uk1" => array("Venezuela Standard Time", "(GMT-04:30) Caracas"), // added
37
+                        "050" => array("Atlantic Standard Time", "(GMT-04:00) Atlantic Time (Canada)"),
38
+                        "055" => array("SA Western Standard Time", "(GMT-04:00) Caracas, La Paz"),
39
+                        "056" => array("Pacific SA Standard Time", "(GMT-04:00) Santiago"),
40
+                        "060" => array("Newfoundland and Labrador Standard Time", "(GMT-03:30) Newfoundland and Labrador"),
41
+                        "065" => array("E South America Standard Time", "(GMT-03:00) Brasilia"),
42
+                        "070" => array("SA Eastern Standard Time", "(GMT-03:00) Buenos Aires, Georgetown"),
43
+                        "073" => array("Greenland Standard Time", "(GMT-03:00) Greenland"),
44
+                        "075" => array("Mid-Atlantic Standard Time", "(GMT-02:00) Mid-Atlantic"),
45
+                        "080" => array("Azores Standard Time", "(GMT-01:00) Azores"),
46
+                        "083" => array("Cape Verde Standard Time", "(GMT-01:00) Cape Verde Islands"),
47
+                        "085" => array("GMT Standard Time", "(GMT) Greenwich Mean Time: Dublin, Edinburgh, Lisbon, London"),
48
+                        "090" => array("Greenwich Standard Time", "(GMT) Casablanca, Monrovia"),
49
+                        "095" => array("Central Europe Standard Time", "(GMT+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague"),
50
+                        "100" => array("Central European Standard Time", "(GMT+01:00) Sarajevo, Skopje, Warsaw, Zagreb"),
51
+                        "105" => array("Romance Standard Time", "(GMT+01:00) Brussels, Copenhagen, Madrid, Paris"),
52
+                        "110" => array("W Europe Standard Time", "(GMT+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna"),
53
+                        "111" => array("W. Europe Standard Time", "(GMT+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna"),
54
+                        "113" => array("W Central Africa Standard Time", "(GMT+01:00) West Central Africa"),
55
+                        "115" => array("E Europe Standard Time", "(GMT+02:00) Bucharest"),
56
+                        "120" => array("Egypt Standard Time", "(GMT+02:00) Cairo"),
57
+                        "125" => array("FLE Standard Time", "(GMT+02:00) Helsinki, Kiev, Riga, Sofia, Tallinn, Vilnius"),
58
+                        "130" => array("GTB Standard Time", "(GMT+02:00) Athens, Istanbul, Minsk"),
59
+                        "135" => array("Israel Standard Time", "(GMT+02:00) Jerusalem"),
60
+                        "140" => array("South Africa Standard Time", "(GMT+02:00) Harare, Pretoria"),
61
+                        "145" => array("Russian Standard Time", "(GMT+03:00) Moscow, St. Petersburg, Volgograd"),
62
+                        "150" => array("Arab Standard Time", "(GMT+03:00) Kuwait, Riyadh"),
63
+                        "155" => array("E Africa Standard Time", "(GMT+03:00) Nairobi"),
64
+                        "158" => array("Arabic Standard Time", "(GMT+03:00) Baghdad"),
65
+                        "160" => array("Iran Standard Time", "(GMT+03:30) Tehran"),
66
+                        "165" => array("Arabian Standard Time", "(GMT+04:00) Abu Dhabi, Muscat"),
67
+                        "170" => array("Caucasus Standard Time", "(GMT+04:00) Baku, Tbilisi, Yerevan"),
68
+                        "175" => array("Transitional Islamic State of Afghanistan Standard Time", "(GMT+04:30) Kabul"),
69
+                        "180" => array("Ekaterinburg Standard Time", "(GMT+05:00) Ekaterinburg"),
70
+                        "185" => array("West Asia Standard Time", "(GMT+05:00) Islamabad, Karachi, Tashkent"),
71
+                        "190" => array("India Standard Time", "(GMT+05:30) Chennai, Kolkata, Mumbai, New Delhi"),
72
+                        "193" => array("Nepal Standard Time", "(GMT+05:45) Kathmandu"),
73
+                        "195" => array("Central Asia Standard Time", "(GMT+06:00) Astana, Dhaka"),
74
+                        "200" => array("Sri Lanka Standard Time", "(GMT+06:00) Sri Jayawardenepura"),
75
+                        "201" => array("N Central Asia Standard Time", "(GMT+06:00) Almaty, Novosibirsk"),
76
+                        "203" => array("Myanmar Standard Time", "(GMT+06:30) Yangon Rangoon"),
77
+                        "205" => array("SE Asia Standard Time", "(GMT+07:00) Bangkok, Hanoi, Jakarta"),
78
+                        "207" => array("North Asia Standard Time", "(GMT+07:00) Krasnoyarsk"),
79
+                        "210" => array("China Standard Time", "(GMT+08:00) Beijing, Chongqing, Hong Kong SAR, Urumqi"),
80
+                        "215" => array("Singapore Standard Time", "(GMT+08:00) Kuala Lumpur, Singapore"),
81
+                        "220" => array("Taipei Standard Time", "(GMT+08:00) Taipei"),
82
+                        "225" => array("W Australia Standard Time", "(GMT+08:00) Perth"),
83
+                        "227" => array("North Asia East Standard Time", "(GMT+08:00) Irkutsk, Ulaanbaatar"),
84
+                        "230" => array("Korea Standard Time", "(GMT+09:00) Seoul"),
85
+                        "235" => array("Tokyo Standard Time", "(GMT+09:00) Osaka, Sapporo, Tokyo"),
86
+                        "240" => array("Yakutsk Standard Time", "(GMT+09:00) Yakutsk"),
87
+                        "245" => array("AUS Central Standard Time", "(GMT+09:30) Darwin"),
88
+                        "250" => array("Cen Australia Standard Time", "(GMT+09:30) Adelaide"),
89
+                        "255" => array("AUS Eastern Standard Time", "(GMT+10:00) Canberra, Melbourne, Sydney"),
90
+                        "260" => array("E Australia Standard Time", "(GMT+10:00) Brisbane"),
91
+                        "265" => array("Tasmania Standard Time", "(GMT+10:00) Hobart"),
92
+                        "270" => array("Vladivostok Standard Time", "(GMT+10:00) Vladivostok"),
93
+                        "275" => array("West Pacific Standard Time", "(GMT+10:00) Guam, Port Moresby"),
94
+                        "280" => array("Central Pacific Standard Time", "(GMT+11:00) Magadan, Solomon Islands, New Caledonia"),
95
+                        "285" => array("Fiji Islands Standard Time", "(GMT+12:00) Fiji Islands, Kamchatka, Marshall Islands"),
96
+                        "290" => array("New Zealand Standard Time", "(GMT+12:00) Auckland, Wellington"),
97
+                        "300" => array("Tonga Standard Time", "(GMT+13:00) Nuku'alofa"),
98 98
                 );
99 99
 
100 100
     /**
@@ -129,104 +129,104 @@  discard block
 block discarded – undo
129 129
      */
130 130
     private static $tzonesoffsets = array(
131 131
                         "Transitional Islamic State of Afghanistan Standard Time"
132
-                                                                    => array(-270, 0, -60,  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0),
133
-                        "Alaskan Standard Time"                     => array(540, 0, -60,  0, 11, 0, 1, 2, 0, 0, 0,  0, 3, 0, 2, 2, 0, 0, 0),
134
-                        "Arab Standard Time"                        => array(-180, 0, -60,  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0),
135
-                        "Arabian Standard Time"                     => array(-240, 0, -60,  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0),
136
-                        "Arabic Standard Time"                      => array(-180, 0, -60,  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0),
132
+                                                                    => array(-270, 0, -60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
133
+                        "Alaskan Standard Time"                     => array(540, 0, -60, 0, 11, 0, 1, 2, 0, 0, 0, 0, 3, 0, 2, 2, 0, 0, 0),
134
+                        "Arab Standard Time"                        => array(-180, 0, -60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
135
+                        "Arabian Standard Time"                     => array(-240, 0, -60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
136
+                        "Arabic Standard Time"                      => array(-180, 0, -60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
137 137
                         //"Argentina Standard Time"                   => array(180, 0, -60,  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0),
138
-                        "Atlantic Standard Time"                    => array(240, 0, -60,  0, 11, 0, 1, 2, 0, 0, 0,  0, 3, 0, 2, 2, 0, 0, 0),
139
-                        "AUS Central Standard Time"                 => array(-570, 0, -60,  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0),
140
-                        "AUS Eastern Standard Time"                 => array(-600, 0, -60,  0, 4, 0, 1, 3, 0, 0, 0,  0, 10, 0, 1, 2, 0, 0, 0),
138
+                        "Atlantic Standard Time"                    => array(240, 0, -60, 0, 11, 0, 1, 2, 0, 0, 0, 0, 3, 0, 2, 2, 0, 0, 0),
139
+                        "AUS Central Standard Time"                 => array(-570, 0, -60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
140
+                        "AUS Eastern Standard Time"                 => array(-600, 0, -60, 0, 4, 0, 1, 3, 0, 0, 0, 0, 10, 0, 1, 2, 0, 0, 0),
141 141
                         //"Azerbaijan Standard Time"                  => array(-240, 0, -60,  0, 10, 0, 5, 5, 0, 0, 0,  0, 3, 0, 5, 4, 0, 0, 0),
142
-                        "Azores Standard Time"                      => array(60, 0, -60,  0, 10, 0, 5, 3, 0, 0, 0,  0, 3, 0, 5, 2, 0, 0, 0),
142
+                        "Azores Standard Time"                      => array(60, 0, -60, 0, 10, 0, 5, 3, 0, 0, 0, 0, 3, 0, 5, 2, 0, 0, 0),
143 143
                         //"Bangladesh Standard Time"                  => array(-360, 0, -60,  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0),
144
-                        "Canada Central Standard Time"              => array(360, 0, -60,  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0),
145
-                        "Cape Verde Standard Time"                  => array(60, 0, -60,  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0),
146
-                        "Caucasus Standard Time"                    => array(-240, 0, -60,  0, 10, 0, 5, 3, 0, 0, 0,  0, 3, 0, 5, 2, 0, 0, 0),
147
-                        "Cen Australia Standard Time"               => array(-570, 0, -60,  0, 4, 0, 1, 3, 0, 0, 0,  0, 10, 0, 1, 2, 0, 0, 0),
148
-                        "Central America Standard Time"             => array(360, 0, -60,  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0),
149
-                        "Central Asia Standard Time"                => array(-360, 0, -60,  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0),
144
+                        "Canada Central Standard Time"              => array(360, 0, -60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
145
+                        "Cape Verde Standard Time"                  => array(60, 0, -60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
146
+                        "Caucasus Standard Time"                    => array(-240, 0, -60, 0, 10, 0, 5, 3, 0, 0, 0, 0, 3, 0, 5, 2, 0, 0, 0),
147
+                        "Cen Australia Standard Time"               => array(-570, 0, -60, 0, 4, 0, 1, 3, 0, 0, 0, 0, 10, 0, 1, 2, 0, 0, 0),
148
+                        "Central America Standard Time"             => array(360, 0, -60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
149
+                        "Central Asia Standard Time"                => array(-360, 0, -60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
150 150
                         //"Central Brazilian Standard Time"           => array(240, 0, -60,  0, 2, 6, 4, 23, 59, 59, 999,  0, 10, 6, 3, 23, 59, 59, 999),
151
-                        "Central Europe Standard Time"              => array(-60, 0, -60,  0, 10, 0, 5, 3, 0, 0, 0,  0, 3, 0, 5, 2, 0, 0, 0),
152
-                        "Central European Standard Time"            => array(-60, 0, -60,  0, 10, 0, 5, 3, 0, 0, 0,  0, 3, 0, 5, 2, 0, 0, 0),
153
-                        "Central Pacific Standard Time"             => array(-660, 0, -60,  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0),
154
-                        "Central Standard Time"                     => array(360, 0, -60,  0, 11, 0, 1, 2, 0, 0, 0,  0, 3, 0, 2, 2, 0, 0, 0),
155
-                        "Mexico Standard Time"                      => array(360, 0, -60,  0, 10, 0, 5, 2, 0, 0, 0,  0, 4, 0, 1, 2, 0, 0, 0),
156
-                        "China Standard Time"                       => array(-480, 0, -60,  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0),
157
-                        "Dateline Standard Time"                    => array(720, 0, -60,  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0),
158
-                        "E Africa Standard Time"                    => array(-180, 0, -60,  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0),
159
-                        "E Australia Standard Time"                 => array(-600, 0, -60,  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0),
160
-                        "E Europe Standard Time"                    => array(-120, 0, -60,  0, 10, 0, 5, 3, 0, 0, 0,  0, 3, 0, 5, 2, 0, 0, 0),
161
-                        "E South America Standard Time"             => array(180, 0, -60,  0, 2, 6, 4, 23, 59, 59, 999,  0, 10, 6, 3, 23, 59, 59, 999),
162
-                        "Eastern Standard Time"                     => array(300, 0, -60,  0, 11, 0, 1, 2, 0, 0, 0,  0, 3, 0, 2, 2, 0, 0, 0),
163
-                        "Egypt Standard Time"                       => array(-120, 0, -60,  0, 9, 4, 5, 23, 59, 59, 999,  0, 4, 4, 5, 23, 59, 59, 999),
164
-                        "Ekaterinburg Standard Time"                => array(-300, 0, -60,  0, 10, 0, 5, 3, 0, 0, 0,  0, 3, 0, 5, 2, 0, 0, 0),
165
-                        "Fiji Islands Standard Time"                => array(-720, 0, -60,  0, 3, 0, 5, 3, 0, 0, 0,  0, 10, 0, 4, 2, 0, 0, 0),
166
-                        "FLE Standard Time"                         => array(-120, 0, -60,  0, 10, 0, 5, 4, 0, 0, 0,  0, 3, 0, 5, 3, 0, 0, 0),
151
+                        "Central Europe Standard Time"              => array(-60, 0, -60, 0, 10, 0, 5, 3, 0, 0, 0, 0, 3, 0, 5, 2, 0, 0, 0),
152
+                        "Central European Standard Time"            => array(-60, 0, -60, 0, 10, 0, 5, 3, 0, 0, 0, 0, 3, 0, 5, 2, 0, 0, 0),
153
+                        "Central Pacific Standard Time"             => array(-660, 0, -60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
154
+                        "Central Standard Time"                     => array(360, 0, -60, 0, 11, 0, 1, 2, 0, 0, 0, 0, 3, 0, 2, 2, 0, 0, 0),
155
+                        "Mexico Standard Time"                      => array(360, 0, -60, 0, 10, 0, 5, 2, 0, 0, 0, 0, 4, 0, 1, 2, 0, 0, 0),
156
+                        "China Standard Time"                       => array(-480, 0, -60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
157
+                        "Dateline Standard Time"                    => array(720, 0, -60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
158
+                        "E Africa Standard Time"                    => array(-180, 0, -60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
159
+                        "E Australia Standard Time"                 => array(-600, 0, -60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
160
+                        "E Europe Standard Time"                    => array(-120, 0, -60, 0, 10, 0, 5, 3, 0, 0, 0, 0, 3, 0, 5, 2, 0, 0, 0),
161
+                        "E South America Standard Time"             => array(180, 0, -60, 0, 2, 6, 4, 23, 59, 59, 999, 0, 10, 6, 3, 23, 59, 59, 999),
162
+                        "Eastern Standard Time"                     => array(300, 0, -60, 0, 11, 0, 1, 2, 0, 0, 0, 0, 3, 0, 2, 2, 0, 0, 0),
163
+                        "Egypt Standard Time"                       => array(-120, 0, -60, 0, 9, 4, 5, 23, 59, 59, 999, 0, 4, 4, 5, 23, 59, 59, 999),
164
+                        "Ekaterinburg Standard Time"                => array(-300, 0, -60, 0, 10, 0, 5, 3, 0, 0, 0, 0, 3, 0, 5, 2, 0, 0, 0),
165
+                        "Fiji Islands Standard Time"                => array(-720, 0, -60, 0, 3, 0, 5, 3, 0, 0, 0, 0, 10, 0, 4, 2, 0, 0, 0),
166
+                        "FLE Standard Time"                         => array(-120, 0, -60, 0, 10, 0, 5, 4, 0, 0, 0, 0, 3, 0, 5, 3, 0, 0, 0),
167 167
                         //"Georgian Standard Time"                    => array(-240, 0, -60,  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0),
168
-                        "GMT Standard Time"                         => array(0, 0, -60,  0, 10, 0, 5, 2, 0, 0, 0,  0, 3, 0, 5, 1, 0, 0, 0),
169
-                        "Greenland Standard Time"                   => array(180, 0, -60,  0, 10, 6, 5, 23, 0, 0, 0,  0, 3, 6, 4, 22, 0, 0, 0),
170
-                        "Greenwich Standard Time"                   => array(0, 0, -60,  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0),
171
-                        "GTB Standard Time"                         => array(-120, 0, -60,  0, 10, 0, 5, 4, 0, 0, 0,  0, 3, 0, 5, 3, 0, 0, 0),
172
-                        "Hawaiian Standard Time"                    => array(600, 0, -60,  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0),
173
-                        "India Standard Time"                       => array(-330, 0, -60,  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0),
174
-                        "Iran Standard Time"                        => array(-210, 0, -60,  0, 9, 1, 3, 23, 59, 59, 999,  0, 3, 6, 3, 23, 59, 59, 999),
175
-                        "Israel Standard Time"                      => array(-120, 0, -60,  0, 9, 0, 4, 2, 0, 0, 0,  0, 3, 5, 5, 2, 0, 0, 0),
168
+                        "GMT Standard Time"                         => array(0, 0, -60, 0, 10, 0, 5, 2, 0, 0, 0, 0, 3, 0, 5, 1, 0, 0, 0),
169
+                        "Greenland Standard Time"                   => array(180, 0, -60, 0, 10, 6, 5, 23, 0, 0, 0, 0, 3, 6, 4, 22, 0, 0, 0),
170
+                        "Greenwich Standard Time"                   => array(0, 0, -60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
171
+                        "GTB Standard Time"                         => array(-120, 0, -60, 0, 10, 0, 5, 4, 0, 0, 0, 0, 3, 0, 5, 3, 0, 0, 0),
172
+                        "Hawaiian Standard Time"                    => array(600, 0, -60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
173
+                        "India Standard Time"                       => array(-330, 0, -60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
174
+                        "Iran Standard Time"                        => array(-210, 0, -60, 0, 9, 1, 3, 23, 59, 59, 999, 0, 3, 6, 3, 23, 59, 59, 999),
175
+                        "Israel Standard Time"                      => array(-120, 0, -60, 0, 9, 0, 4, 2, 0, 0, 0, 0, 3, 5, 5, 2, 0, 0, 0),
176 176
                         //"Jordan Standard Time"                      => array(-120, 0, -60,  0, 10, 5, 5, 1, 0, 0, 0,  0, 3, 4, 5, 23, 59, 59, 999),
177 177
                         //"Kamchatka Standard Time"                   => array(-720, 0, -60,  0, 10, 0, 5, 3, 0, 0, 0,  0, 3, 0, 5, 2, 0, 0, 0),
178
-                        "Korea Standard Time"                       => array(-540, 0, -60,  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0),
178
+                        "Korea Standard Time"                       => array(-540, 0, -60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
179 179
                         //"Magadan Standard Time"                     => array(-660, 0, -60,  0, 10, 0, 5, 3, 0, 0, 0,  0, 3, 0, 5, 2, 0, 0, 0),
180 180
                         //"Mauritius Standard Time"                   => array(-240, 0, -60,  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0),
181
-                        "Mid-Atlantic Standard Time"                => array(120, 0, -60,  0, 9, 0, 5, 2, 0, 0, 0,  0, 3, 0, 5, 2, 0, 0, 0),
181
+                        "Mid-Atlantic Standard Time"                => array(120, 0, -60, 0, 9, 0, 5, 2, 0, 0, 0, 0, 3, 0, 5, 2, 0, 0, 0),
182 182
                         //"Middle East Standard Time"                 => array(-120, 0, -60,  0, 10, 6, 5, 23, 59, 59, 999,  0, 3, 6, 4, 23, 59, 59, 999),
183 183
                         //"Montevideo Standard Time"                  => array(180, 0, -60,  0, 3, 0, 2, 2, 0, 0, 0,  0, 10, 0, 1, 2, 0, 0, 0),
184 184
                         //"Morocco Standard Time"                     => array(0, 0, -60,  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0),
185
-                        "Mountain Standard Time"                    => array(420, 0, -60,  0, 11, 0, 1, 2, 0, 0, 0,  0, 3, 0, 2, 2, 0, 0, 0),
186
-                        "Mexico Standard Time 2"                    => array(420, 0, -60,  0, 10, 0, 5, 2, 0, 0, 0,  0, 4, 0, 1, 2, 0, 0, 0),
187
-                        "Myanmar Standard Time"                     => array(-390, 0, -60,  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0),
188
-                        "N Central Asia Standard Time"              => array(-360, 0, -60,  0, 10, 0, 5, 3, 0, 0, 0,  0, 3, 0, 5, 2, 0, 0, 0),
185
+                        "Mountain Standard Time"                    => array(420, 0, -60, 0, 11, 0, 1, 2, 0, 0, 0, 0, 3, 0, 2, 2, 0, 0, 0),
186
+                        "Mexico Standard Time 2"                    => array(420, 0, -60, 0, 10, 0, 5, 2, 0, 0, 0, 0, 4, 0, 1, 2, 0, 0, 0),
187
+                        "Myanmar Standard Time"                     => array(-390, 0, -60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
188
+                        "N Central Asia Standard Time"              => array(-360, 0, -60, 0, 10, 0, 5, 3, 0, 0, 0, 0, 3, 0, 5, 2, 0, 0, 0),
189 189
                         //"Namibia Standard Time"                     => array(-60, 0, -60,  0, 4, 0, 1, 2, 0, 0, 0,  0, 9, 0, 1, 2, 0, 0, 0),
190
-                        "Nepal Standard Time"                       => array(-345, 0, -60,  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0),
191
-                        "New Zealand Standard Time"                 => array(-720, 0, -60,  0, 4, 0, 1, 3, 0, 0, 0,  0, 9, 0, 5, 2, 0, 0, 0),
192
-                        "Newfoundland and Labrador Standard Time"   => array(210, 0, -60,  0, 11, 0, 1, 0, 1, 0, 0,  0, 3, 0, 2, 0, 1, 0, 0),
193
-                        "North Asia East Standard Time"             => array(-480, 0, -60,  0, 10, 0, 5, 3, 0, 0, 0,  0, 3, 0, 5, 2, 0, 0, 0),
194
-                        "North Asia Standard Time"                  => array(-420, 0, -60,  0, 10, 0, 5, 3, 0, 0, 0,  0, 3, 0, 5, 2, 0, 0, 0),
195
-                        "Pacific SA Standard Time"                  => array(240, 0, -60,  0, 3, 6, 2, 23, 59, 59, 999,  0, 10, 6, 2, 23, 59, 59, 999),
196
-                        "Pacific Standard Time"                     => array(480, 0, -60,  0, 11, 0, 1, 2, 0, 0, 0,  0, 3, 0, 2, 2, 0, 0, 0),
190
+                        "Nepal Standard Time"                       => array(-345, 0, -60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
191
+                        "New Zealand Standard Time"                 => array(-720, 0, -60, 0, 4, 0, 1, 3, 0, 0, 0, 0, 9, 0, 5, 2, 0, 0, 0),
192
+                        "Newfoundland and Labrador Standard Time"   => array(210, 0, -60, 0, 11, 0, 1, 0, 1, 0, 0, 0, 3, 0, 2, 0, 1, 0, 0),
193
+                        "North Asia East Standard Time"             => array(-480, 0, -60, 0, 10, 0, 5, 3, 0, 0, 0, 0, 3, 0, 5, 2, 0, 0, 0),
194
+                        "North Asia Standard Time"                  => array(-420, 0, -60, 0, 10, 0, 5, 3, 0, 0, 0, 0, 3, 0, 5, 2, 0, 0, 0),
195
+                        "Pacific SA Standard Time"                  => array(240, 0, -60, 0, 3, 6, 2, 23, 59, 59, 999, 0, 10, 6, 2, 23, 59, 59, 999),
196
+                        "Pacific Standard Time"                     => array(480, 0, -60, 0, 11, 0, 1, 2, 0, 0, 0, 0, 3, 0, 2, 2, 0, 0, 0),
197 197
                         //"Pacific Standard Time (Mexico)"            => array(480, 0, -60,  0, 10, 0, 5, 2, 0, 0, 0,  0, 4, 0, 1, 2, 0, 0, 0),
198 198
                         //"Pakistan Standard Time"                    => array(-300, 0, -60,  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0),
199 199
                         //"Paraguay Standard Time"                    => array(240, 0, -60,  0, 4, 6, 1, 23, 59, 59, 999,  0, 10, 6, 1, 23, 59, 59, 999),
200
-                        "Romance Standard Time"                     => array(-60, 0, -60,  0, 10, 0, 5, 3, 0, 0, 0,  0, 3, 0, 5, 2, 0, 0, 0),
201
-                        "Russian Standard Time"                     => array(-180, 0, -60,  0, 10, 0, 5, 3, 0, 0, 0,  0, 3, 0, 5, 2, 0, 0, 0),
202
-                        "SA Eastern Standard Time"                  => array(180, 0, -60,  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0),
203
-                        "SA Pacific Standard Time"                  => array(300, 0, -60,  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0),
204
-                        "SA Western Standard Time"                  => array(240, 0, -60,  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0),
205
-                        "Samoa Standard Time"                       => array(660, 0, -60,  0, 3, 6, 5, 23, 59, 59, 999,  0, 9, 6, 5, 23, 59, 59, 999),
206
-                        "SE Asia Standard Time"                     => array(-420, 0, -60,  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0),
207
-                        "Singapore Standard Time"                   => array(-480, 0, -60,  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0),
208
-                        "South Africa Standard Time"                => array(-120, 0, -60,  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0),
209
-                        "Sri Lanka Standard Time"                   => array(-330, 0, -60,  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0),
200
+                        "Romance Standard Time"                     => array(-60, 0, -60, 0, 10, 0, 5, 3, 0, 0, 0, 0, 3, 0, 5, 2, 0, 0, 0),
201
+                        "Russian Standard Time"                     => array(-180, 0, -60, 0, 10, 0, 5, 3, 0, 0, 0, 0, 3, 0, 5, 2, 0, 0, 0),
202
+                        "SA Eastern Standard Time"                  => array(180, 0, -60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
203
+                        "SA Pacific Standard Time"                  => array(300, 0, -60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
204
+                        "SA Western Standard Time"                  => array(240, 0, -60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
205
+                        "Samoa Standard Time"                       => array(660, 0, -60, 0, 3, 6, 5, 23, 59, 59, 999, 0, 9, 6, 5, 23, 59, 59, 999),
206
+                        "SE Asia Standard Time"                     => array(-420, 0, -60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
207
+                        "Singapore Standard Time"                   => array(-480, 0, -60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
208
+                        "South Africa Standard Time"                => array(-120, 0, -60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
209
+                        "Sri Lanka Standard Time"                   => array(-330, 0, -60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
210 210
                         //"Syria Standard Time"                       => array(-120, 0, -60,  0, 10, 4, 5, 23, 59, 59, 999,  0, 4, 4, 1, 23, 59, 59, 999),
211
-                        "Taipei Standard Time"                      => array(-480, 0, -60,  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0),
212
-                        "Tasmania Standard Time"                    => array(-600, 0, -60,  0, 4, 0, 1, 3, 0, 0, 0,  0, 10, 0, 1, 2, 0, 0, 0),
213
-                        "Tokyo Standard Time"                       => array(-540, 0, -60,  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0),
214
-                        "Tonga Standard Time"                       => array(-780, 0, -60,  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0),
211
+                        "Taipei Standard Time"                      => array(-480, 0, -60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
212
+                        "Tasmania Standard Time"                    => array(-600, 0, -60, 0, 4, 0, 1, 3, 0, 0, 0, 0, 10, 0, 1, 2, 0, 0, 0),
213
+                        "Tokyo Standard Time"                       => array(-540, 0, -60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
214
+                        "Tonga Standard Time"                       => array(-780, 0, -60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
215 215
                         //"Ulaanbaatar Standard Time"                 => array(-480, 0, -60,  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0),
216
-                        "US Eastern Standard Time"                  => array(300, 0, -60,  0, 11, 0, 1, 2, 0, 0, 0,  0, 3, 0, 2, 2, 0, 0, 0),
217
-                        "US Mountain Standard Time"                 => array(420, 0, -60,  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0),
216
+                        "US Eastern Standard Time"                  => array(300, 0, -60, 0, 11, 0, 1, 2, 0, 0, 0, 0, 3, 0, 2, 2, 0, 0, 0),
217
+                        "US Mountain Standard Time"                 => array(420, 0, -60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
218 218
                         //"UTC"                                       => array(0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0),
219 219
                         //"UTC+12"                                    => array(-720, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0),
220 220
                         //"UTC-02"                                    => array(120, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0),
221 221
                         //"UTC-11"                                    => array(660, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0),
222
-                        "Venezuela Standard Time"                   => array(270, 0, -60,  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0),
223
-                        "Vladivostok Standard Time"                 => array(-600, 0, -60,  0, 10, 0, 5, 3, 0, 0, 0,  0, 3, 0, 5, 2, 0, 0, 0),
224
-                        "W Australia Standard Time"                 => array(-480, 0, -60,  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0),
225
-                        "W Central Africa Standard Time"            => array(-60, 0, -60,  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0),
226
-                        "W Europe Standard Time"                    => array(-60, 0, -60,  0, 10, 0, 5, 3, 0, 0, 0,  0, 3, 0, 5, 2, 0, 0, 0),
227
-                        "West Asia Standard Time"                   => array(-300, 0, -60,  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0),
228
-                        "West Pacific Standard Time"                => array(-600, 0, -60,  0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0),
229
-                        "Yakutsk Standard Time"                     => array(-540, 0, -60,  0, 10, 0, 5, 3, 0, 0, 0,  0, 3, 0, 5, 2, 0, 0, 0),
222
+                        "Venezuela Standard Time"                   => array(270, 0, -60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
223
+                        "Vladivostok Standard Time"                 => array(-600, 0, -60, 0, 10, 0, 5, 3, 0, 0, 0, 0, 3, 0, 5, 2, 0, 0, 0),
224
+                        "W Australia Standard Time"                 => array(-480, 0, -60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
225
+                        "W Central Africa Standard Time"            => array(-60, 0, -60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
226
+                        "W Europe Standard Time"                    => array(-60, 0, -60, 0, 10, 0, 5, 3, 0, 0, 0, 0, 3, 0, 5, 2, 0, 0, 0),
227
+                        "West Asia Standard Time"                   => array(-300, 0, -60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
228
+                        "West Pacific Standard Time"                => array(-600, 0, -60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
229
+                        "Yakutsk Standard Time"                     => array(-540, 0, -60, 0, 10, 0, 5, 3, 0, 0, 0, 0, 3, 0, 5, 2, 0, 0, 0),
230 230
                 );
231 231
 
232 232
     /**
@@ -1063,7 +1063,7 @@  discard block
 block discarded – undo
1063 1063
         if ($phptimezone === false)
1064 1064
             $phptimezone = date_default_timezone_get();
1065 1065
 
1066
-        ZLog::Write(LOGLEVEL_DEBUG, "TimezoneUtil::GetFullTZ() for ". $phptimezone);
1066
+        ZLog::Write(LOGLEVEL_DEBUG, "TimezoneUtil::GetFullTZ() for ".$phptimezone);
1067 1067
 
1068 1068
         $servertzname = self::guessTZNameFromPHPName($phptimezone);
1069 1069
         return self::GetFullTZFromTZName($servertzname);
@@ -1121,7 +1121,7 @@  discard block
 block discarded – undo
1121 1121
      * @return array
1122 1122
      */
1123 1123
     static public function FillTZNames($tz) {
1124
-        ZLog::Write(LOGLEVEL_DEBUG, "TimezoneUtil::FillTZNames() filling up bias ". $tz["bias"]);
1124
+        ZLog::Write(LOGLEVEL_DEBUG, "TimezoneUtil::FillTZNames() filling up bias ".$tz["bias"]);
1125 1125
         if (!isset($tz["bias"]))
1126 1126
             ZLog::Write(LOGLEVEL_WARN, "TimezoneUtil::FillTZNames() submitted TZ array does not have a bias");
1127 1127
         else {
@@ -1143,10 +1143,10 @@  discard block
 block discarded – undo
1143 1143
         // try to find a quite exact match
1144 1144
         foreach (self::$tzonesoffsets as $tzname => $tzoffset) {
1145 1145
             if ($offset["bias"] == $tzoffset[0] &&
1146
-                isset($offset["dstendmonth"])   && $offset["dstendmonth"] == $tzoffset[4] &&
1147
-                isset($offset["dstendday"])     && $offset["dstendday"] == $tzoffset[6] &&
1146
+                isset($offset["dstendmonth"]) && $offset["dstendmonth"] == $tzoffset[4] &&
1147
+                isset($offset["dstendday"]) && $offset["dstendday"] == $tzoffset[6] &&
1148 1148
                 isset($offset["dststartmonth"]) && $offset["dststartmonth"] == $tzoffset[12] &&
1149
-                isset($offset["dststartday"])   && $offset["dststartday"] == $tzoffset[14])
1149
+                isset($offset["dststartday"]) && $offset["dststartday"] == $tzoffset[14])
1150 1150
                 return $tzname;
1151 1151
         }
1152 1152
 
@@ -1235,7 +1235,7 @@  discard block
 block discarded – undo
1235 1235
      * @return string
1236 1236
      */
1237 1237
     static private function encodeTZName($name) {
1238
-        return substr(iconv('UTF-8', 'UTF-16', $name),2,-1);
1238
+        return substr(iconv('UTF-8', 'UTF-16', $name), 2, -1);
1239 1239
     }
1240 1240
 
1241 1241
     /**
@@ -1248,7 +1248,7 @@  discard block
 block discarded – undo
1248 1248
     static public function TZtest() {
1249 1249
         foreach (self::$mstzones as $mskey => $msdefs) {
1250 1250
             if (!array_key_exists($msdefs[0], self::$tzonesoffsets))
1251
-                echo "key   '". $msdefs[0]. "'   not found in tzonesoffsets\n";
1251
+                echo "key   '".$msdefs[0]."'   not found in tzonesoffsets\n";
1252 1252
         }
1253 1253
 
1254 1254
         foreach (self::$tzonesoffsets as $tzname => $offset) {
@@ -1277,7 +1277,7 @@  discard block
 block discarded – undo
1277 1277
         if (!isset($tz["tzname"]) || !$tz["tzname"] || !isset($tz["tznamedst"]) || !$tz["tznamedst"])
1278 1278
             $tz = TimezoneUtil::FillTZNames($tz);
1279 1279
 
1280
-        $packed = pack("la64vvvvvvvv" . "la64vvvvvvvv" . "l",
1280
+        $packed = pack("la64vvvvvvvv"."la64vvvvvvvv"."l",
1281 1281
                 $tz["bias"], $tz["tzname"], 0, $tz["dstendmonth"], $tz["dstendday"], $tz["dstendweek"], $tz["dstendhour"], $tz["dstendminute"], $tz["dstendsecond"], $tz["dstendmillis"],
1282 1282
                 $tz["stdbias"], $tz["tznamedst"], 0, $tz["dststartmonth"], $tz["dststartday"], $tz["dststartweek"], $tz["dststarthour"], $tz["dststartminute"], $tz["dststartsecond"], $tz["dststartmillis"],
1283 1283
                 $tz["dstbias"]);
@@ -1311,7 +1311,7 @@  discard block
 block discarded – undo
1311 1311
         }
1312 1312
         if (!$date) {
1313 1313
             //20110930 (Append T000000Z to the date, so it starts at midnight)
1314
-            $date = date_create_from_format('Ymd\THis\Z', $value . "T000000Z", $tz);
1314
+            $date = date_create_from_format('Ymd\THis\Z', $value."T000000Z", $tz);
1315 1315
         }
1316 1316
         return date_timestamp_get($date);
1317 1317
     }
@@ -1328,15 +1328,15 @@  discard block
 block discarded – undo
1328 1328
     public static function ParseTimezone($timezone) {
1329 1329
         //(GMT+01.00) Amsterdam / Berlin / Bern / Rome / Stockholm / Vienna
1330 1330
         if (preg_match('/GMT(\\+|\\-)0(\d)/', $timezone, $matches)) {
1331
-            return "Etc/GMT" . $matches[1] . $matches[2];
1331
+            return "Etc/GMT".$matches[1].$matches[2];
1332 1332
         }
1333 1333
         //(GMT+10.00) XXX / XXX / XXX / XXX
1334 1334
         if (preg_match('/GMT(\\+|\\-)1(\d)/', $timezone, $matches)) {
1335
-            return "Etc/GMT" . $matches[1] . "1" . $matches[2];
1335
+            return "Etc/GMT".$matches[1]."1".$matches[2];
1336 1336
         }
1337 1337
         ///inverse.ca/20101018_1/Europe/Amsterdam or /inverse.ca/20101018_1/America/Argentina/Buenos_Aires
1338 1338
         if (preg_match('/\/[.[:word:]]+\/\w+\/(\w+)\/([\w\/]+)/', $timezone, $matches)) {
1339
-            return $matches[1] . "/" . $matches[2];
1339
+            return $matches[1]."/".$matches[2];
1340 1340
         }
1341 1341
         return self::getMSTZnameFromTZName(trim($timezone, '"'));
1342 1342
     }
Please login to merge, or discard this patch.
lib/exceptions/httpreturncodeexception.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,6 +14,6 @@
 block discarded – undo
14 14
     public function __construct($message = "", $code = 0, $previous = NULL, $logLevel = false) {
15 15
         if ($code)
16 16
             $this->httpReturnCode = $code;
17
-        parent::__construct($message, (int) $code, $previous, $logLevel);
17
+        parent::__construct($message, (int)$code, $previous, $logLevel);
18 18
     }
19 19
 }
Please login to merge, or discard this patch.
lib/exceptions/zpushexception.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -15,18 +15,18 @@
 block discarded – undo
15 15
     protected $showLegal = true;
16 16
 
17 17
     public function __construct($message = "", $code = 0, $previous = NULL, $logLevel = false) {
18
-        if (! $message)
18
+        if (!$message)
19 19
             $message = $this->httpReturnMessage;
20 20
 
21 21
         if (!$logLevel)
22 22
             $logLevel = $this->defaultLogLevel;
23 23
 
24
-        parent::__construct($message, (int) $code);
25
-        ZLog::Write($logLevel, get_class($this) .': '. $message . ' - code: '.$code. ' - file: '. $this->getFile().':'.$this->getLine(), false);
24
+        parent::__construct($message, (int)$code);
25
+        ZLog::Write($logLevel, get_class($this).': '.$message.' - code: '.$code.' - file: '.$this->getFile().':'.$this->getLine(), false);
26 26
     }
27 27
 
28 28
     public function getHTTPCodeString() {
29
-        return $this->httpReturnCode . " ". $this->httpReturnMessage;
29
+        return $this->httpReturnCode." ".$this->httpReturnMessage;
30 30
     }
31 31
 
32 32
     public function getHTTPHeaders() {
Please login to merge, or discard this patch.
lib/exceptions/serviceunavailableexception.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
 	public function __construct($message = "", $code = 0, $previous = NULL, $logLevel = false) {
18 18
 		parent::__construct($message, $code, $previous, $logLevel);
19 19
 		if (RETRY_AFTER_DELAY !== false) {
20
-			$this->httpHeaders[] = 'Retry-After: ' . RETRY_AFTER_DELAY;
20
+			$this->httpHeaders[] = 'Retry-After: '.RETRY_AFTER_DELAY;
21 21
 		}
22 22
 	}
23 23
 }
Please login to merge, or discard this patch.
grommunio-sync-top.php 1 patch
Spacing   +69 added lines, -69 removed lines patch added patch discarded remove patch
@@ -16,11 +16,11 @@  discard block
 block discarded – undo
16 16
 /************************************************
17 17
  * MAIN
18 18
  */
19
-    declare(ticks = 1);
20
-    define('BASE_PATH_CLI',  dirname(__FILE__) ."/");
21
-    set_include_path(get_include_path() . PATH_SEPARATOR . BASE_PATH_CLI);
19
+    declare(ticks=1);
20
+    define('BASE_PATH_CLI', dirname(__FILE__)."/");
21
+    set_include_path(get_include_path().PATH_SEPARATOR.BASE_PATH_CLI);
22 22
 
23
-    if (!defined('ZPUSH_CONFIG')) define('ZPUSH_CONFIG', BASE_PATH_CLI . 'config.php');
23
+    if (!defined('ZPUSH_CONFIG')) define('ZPUSH_CONFIG', BASE_PATH_CLI.'config.php');
24 24
     include_once(ZPUSH_CONFIG);
25 25
 
26 26
     try {
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
             echo "grommunio-sync interprocess communication (IPC) is not available or TopCollector is disabled.\n";
50 50
     }
51 51
     catch (ZPushException $zpe) {
52
-        fwrite(STDERR, get_class($zpe) . ": ". $zpe->getMessage() . "\n");
52
+        fwrite(STDERR, get_class($zpe).": ".$zpe->getMessage()."\n");
53 53
         exit(1);
54 54
     }
55 55
 
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
             // wait for user input
178 178
             $this->readLineProcess();
179 179
         }
180
-        while($this->terminate != true);
180
+        while ($this->terminate != true);
181 181
     }
182 182
 
183 183
     /**
@@ -233,20 +233,20 @@  discard block
 block discarded – undo
233 233
                         if ($line['push'] === true) $this->pushConn += 1;
234 234
 
235 235
                         // ignore push connections
236
-                        if ($line['push'] === true && ! $this->showPush)
236
+                        if ($line['push'] === true && !$this->showPush)
237 237
                             continue;
238 238
 
239 239
                         if ($this->filter !== false) {
240 240
                             $f = $this->filter;
241 241
                             if (!($line["pid"] == $f || $line["ip"] == $f || strtolower($line['command']) == strtolower($f) || preg_match("/.*?$f.*?/i", $line['user']) ||
242
-                                preg_match("/.*?$f.*?/i", $line['devagent']) || preg_match("/.*?$f.*?/i", $line['devid']) || preg_match("/.*?$f.*?/i", $line['addinfo']) ))
242
+                                preg_match("/.*?$f.*?/i", $line['devagent']) || preg_match("/.*?$f.*?/i", $line['devid']) || preg_match("/.*?$f.*?/i", $line['addinfo'])))
243 243
                                 continue;
244 244
                         }
245 245
 
246 246
                         $lastUpdate = $this->currenttime - $line["update"];
247 247
                         if ($this->currenttime - $line["update"] < 2)
248 248
                             $this->linesActive[$line["update"].$line["pid"]] = $line;
249
-                        else if (($line['push'] === true  && $lastUpdate > ($this->pingInterval+2)) || ($line['push'] !== true  && $lastUpdate > 4))
249
+                        else if (($line['push'] === true && $lastUpdate > ($this->pingInterval + 2)) || ($line['push'] !== true && $lastUpdate > 4))
250 250
                             $this->linesUnknown[$line["update"].$line["pid"]] = $line;
251 251
                         else
252 252
                             $this->linesOpen[$line["update"].$line["pid"]] = $line;
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
                         if ($this->filter !== false) {
260 260
                             $f = $this->filter;
261 261
                             if (!($line['pid'] == $f || $line['ip'] == $f || strtolower($line['command']) == strtolower($f) || preg_match("/.*?$f.*?/i", $line['user']) ||
262
-                                preg_match("/.*?$f.*?/i", $line['devagent']) || preg_match("/.*?$f.*?/i", $line['devid']) || preg_match("/.*?$f.*?/i", $line['addinfo']) ))
262
+                                preg_match("/.*?$f.*?/i", $line['devagent']) || preg_match("/.*?$f.*?/i", $line['devid']) || preg_match("/.*?$f.*?/i", $line['addinfo'])))
263 263
                                 continue;
264 264
                         }
265 265
 
@@ -286,23 +286,23 @@  discard block
 block discarded – undo
286 286
     private function scrOverview() {
287 287
         $linesAvail = $this->scrSize['height'] - 8;
288 288
         $lc = 1;
289
-        $this->scrPrintAt($lc,0, "\033[1mgrommunio-sync-top live statistics\033[0m\t\t\t\t\t". @strftime("%d/%m/%Y %T")."\n"); $lc++;
289
+        $this->scrPrintAt($lc, 0, "\033[1mgrommunio-sync-top live statistics\033[0m\t\t\t\t\t".@strftime("%d/%m/%Y %T")."\n"); $lc++;
290 290
 
291
-        $this->scrPrintAt($lc,0, sprintf("Open connections: %d\t\t\t\tUsers:\t %d\tgrommunio-sync:   %s ",count($this->activeConn),count($this->activeUsers), $this->getVersion())); $lc++;
292
-        $this->scrPrintAt($lc,0, sprintf("Push connections: %d\t\t\t\tDevices: %d\tPHP-MAPI: %s", $this->pushConn, count($this->activeDevices),phpversion("mapi"))); $lc++;
293
-        $this->scrPrintAt($lc,0, sprintf("                                                Hosts:\t %d", count($this->activeHosts))); $lc++;
291
+        $this->scrPrintAt($lc, 0, sprintf("Open connections: %d\t\t\t\tUsers:\t %d\tgrommunio-sync:   %s ", count($this->activeConn), count($this->activeUsers), $this->getVersion())); $lc++;
292
+        $this->scrPrintAt($lc, 0, sprintf("Push connections: %d\t\t\t\tDevices: %d\tPHP-MAPI: %s", $this->pushConn, count($this->activeDevices), phpversion("mapi"))); $lc++;
293
+        $this->scrPrintAt($lc, 0, sprintf("                                                Hosts:\t %d", count($this->activeHosts))); $lc++;
294 294
         $lc++;
295 295
 
296
-        $this->scrPrintAt($lc,0, "\033[4m". $this->getLine(array('pid'=>'PID', 'ip'=>'IP', 'user'=>'USER', 'command'=>'COMMAND', 'time'=>'TIME', 'devagent'=>'AGENT', 'devid'=>'DEVID', 'addinfo'=>'Additional Information')). str_repeat(" ",20)."\033[0m"); $lc++;
296
+        $this->scrPrintAt($lc, 0, "\033[4m".$this->getLine(array('pid'=>'PID', 'ip'=>'IP', 'user'=>'USER', 'command'=>'COMMAND', 'time'=>'TIME', 'devagent'=>'AGENT', 'devid'=>'DEVID', 'addinfo'=>'Additional Information')).str_repeat(" ", 20)."\033[0m"); $lc++;
297 297
 
298 298
         // print help text if requested
299 299
         $hl = 0;
300 300
         if ($this->helpexpire > $this->currenttime) {
301 301
             $help = $this->scrHelp();
302 302
             $linesAvail -= count($help);
303
-            $hl = $this->scrSize['height'] - count($help) -1;
303
+            $hl = $this->scrSize['height'] - count($help) - 1;
304 304
             foreach ($help as $h) {
305
-                $this->scrPrintAt($hl,0, $h);
305
+                $this->scrPrintAt($hl, 0, $h);
306 306
                 $hl++;
307 307
             }
308 308
         }
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
         if (count($this->linesActive) + count($this->linesOpen) + count($this->linesUnknown) > $linesAvail) {
317 317
             $toPrintUnknown = count($this->linesUnknown);
318 318
             $toPrintActive = count($this->linesActive);
319
-            $toPrintOpen = $linesAvail-$toPrintUnknown-$toPrintActive;
319
+            $toPrintOpen = $linesAvail - $toPrintUnknown - $toPrintActive;
320 320
             $toPrintTerm = 0;
321 321
         }
322 322
 
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
             if ($linesprinted >= $toPrintActive)
340 340
                 break;
341 341
 
342
-            $this->scrPrintAt($lc,0, "\033[01m" . $this->getLine($l)  ."\033[0m");
342
+            $this->scrPrintAt($lc, 0, "\033[01m".$this->getLine($l)."\033[0m");
343 343
             $lc++;
344 344
             $linesprinted++;
345 345
         }
@@ -349,7 +349,7 @@  discard block
 block discarded – undo
349 349
             if ($linesprinted >= $toPrintOpen)
350 350
                 break;
351 351
 
352
-            $this->scrPrintAt($lc,0, $this->getLine($l));
352
+            $this->scrPrintAt($lc, 0, $this->getLine($l));
353 353
             $lc++;
354 354
             $linesprinted++;
355 355
         }
@@ -362,28 +362,28 @@  discard block
 block discarded – undo
362 362
             $color = "0;31m";
363 363
             if ($l['push'] == false && $time - $l["start"] > 30)
364 364
                 $color = "1;31m";
365
-            $this->scrPrintAt($lc,0, "\033[0". $color . $this->getLine($l)  ."\033[0m");
365
+            $this->scrPrintAt($lc, 0, "\033[0".$color.$this->getLine($l)."\033[0m");
366 366
             $lc++;
367 367
             $linesprinted++;
368 368
         }
369 369
 
370 370
         if ($toPrintTerm > 0)
371
-            $toPrintTerm = $linesAvail - $lc +6;
371
+            $toPrintTerm = $linesAvail - $lc + 6;
372 372
 
373 373
         $linesprinted = 0;
374
-        foreach ($this->linesTerm as $time=>$l){
374
+        foreach ($this->linesTerm as $time=>$l) {
375 375
             if ($linesprinted >= $toPrintTerm)
376 376
                 break;
377 377
 
378
-            $this->scrPrintAt($lc,0, "\033[01;30m" . $this->getLine($l)  ."\033[0m");
378
+            $this->scrPrintAt($lc, 0, "\033[01;30m".$this->getLine($l)."\033[0m");
379 379
             $lc++;
380 380
             $linesprinted++;
381 381
         }
382 382
 
383 383
         // add the lines used when displaying the help text
384 384
         $lc += $hl;
385
-        $this->scrPrintAt($lc,0, "\033[K"); $lc++;
386
-        $this->scrPrintAt($lc,0, "Colorscheme: \033[01mActive  \033[0mOpen  \033[01;31mUnknown  \033[01;30mTerminated\033[0m");
385
+        $this->scrPrintAt($lc, 0, "\033[K"); $lc++;
386
+        $this->scrPrintAt($lc, 0, "Colorscheme: \033[01mActive  \033[0mOpen  \033[01;31mUnknown  \033[01;30mTerminated\033[0m");
387 387
 
388 388
         // remove old status
389 389
         if ($this->statusexpire < $this->currenttime)
@@ -391,13 +391,13 @@  discard block
 block discarded – undo
391 391
 
392 392
         // show request information and help command
393 393
         if ($this->starttime + 6 > $this->currenttime) {
394
-            $this->status = sprintf("Requesting information (takes up to %dsecs)", $this->pingInterval). str_repeat(".", ($this->currenttime-$this->starttime)) . "  type \033[01;31mh\033[00;31m or \033[01;31mhelp\033[00;31m for usage instructions";
395
-            $this->statusexpire = $this->currenttime+1;
394
+            $this->status = sprintf("Requesting information (takes up to %dsecs)", $this->pingInterval).str_repeat(".", ($this->currenttime - $this->starttime))."  type \033[01;31mh\033[00;31m or \033[01;31mhelp\033[00;31m for usage instructions";
395
+            $this->statusexpire = $this->currenttime + 1;
396 396
         }
397 397
 
398 398
 
399 399
         $str = "";
400
-        if (! $this->showPush)
400
+        if (!$this->showPush)
401 401
             $str .= "\033[00;32mPush: \033[01;32mNo\033[0m   ";
402 402
 
403 403
         if ($this->showOption == self::SHOW_ACTIVE_ONLY)
@@ -407,7 +407,7 @@  discard block
 block discarded – undo
407 407
             $str .= "\033[01;32mUnknown only\033[0m   ";
408 408
 
409 409
         if ($this->showTermSec != self::SHOW_TERM_DEFAULT_TIME)
410
-            $str .= "\033[01;32mTerminated: ". $this->showTermSec. "s\033[0m   ";
410
+            $str .= "\033[01;32mTerminated: ".$this->showTermSec."s\033[0m   ";
411 411
 
412 412
         if ($this->filter !== false || ($this->status !== false && $this->statusexpire > $this->currenttime)) {
413 413
             // print filter in green
@@ -417,9 +417,9 @@  discard block
 block discarded – undo
417 417
             if ($this->status !== false)
418 418
                 $str .= "\033[00;31m$this->status\033[0m";
419 419
         }
420
-        $this->scrPrintAt(5,0, $str);
420
+        $this->scrPrintAt(5, 0, $str);
421 421
 
422
-        $this->scrPrintAt(4,0,"Action: \033[01m".$this->action . "\033[0m");
422
+        $this->scrPrintAt(4, 0, "Action: \033[01m".$this->action."\033[0m");
423 423
     }
424 424
 
425 425
     /**
@@ -433,14 +433,14 @@  discard block
 block discarded – undo
433 433
 
434 434
         if ($ans[0] < 128) {
435 435
             if (isset($ans[1]) && bin2hex(trim($ans[1])) == "7f") {
436
-                $this->action = substr($this->action,0,-1);
436
+                $this->action = substr($this->action, 0, -1);
437 437
             }
438 438
 
439
-            if (isset($ans[1]) && $ans[1] != "" ){
440
-                $this->action .= trim(preg_replace("/[^A-Za-z0-9:]/","",$ans[1]));
439
+            if (isset($ans[1]) && $ans[1] != "") {
440
+                $this->action .= trim(preg_replace("/[^A-Za-z0-9:]/", "", $ans[1]));
441 441
             }
442 442
 
443
-            if (bin2hex($ans[0]) == "30" && bin2hex($ans[1]) == "0a")  {
443
+            if (bin2hex($ans[0]) == "30" && bin2hex($ans[1]) == "0a") {
444 444
                 $cmds = explode(':', $this->action);
445 445
                 if ($cmds[0] == "quit" || $cmds[0] == "q" || (isset($cmds[1]) && $cmds[0] == "" && $cmds[1] == "q")) {
446 446
                     $this->topCollector->CollectData(true);
@@ -448,7 +448,7 @@  discard block
 block discarded – undo
448 448
 
449 449
                     $this->terminate = true;
450 450
                 }
451
-                else if ($cmds[0] == "clear" ) {
451
+                else if ($cmds[0] == "clear") {
452 452
                     $this->topCollector->ClearLatest(true);
453 453
                     $this->topCollector->CollectData(true);
454 454
                     $this->topCollector->ReInitIPC();
@@ -457,7 +457,7 @@  discard block
 block discarded – undo
457 457
                     if (!isset($cmds[1]) || $cmds[1] == "") {
458 458
                         $this->filter = false;
459 459
                         $this->status = "No filter";
460
-                        $this->statusexpire = $this->currenttime+5;
460
+                        $this->statusexpire = $this->currenttime + 5;
461 461
                     }
462 462
                     else {
463 463
                         $this->filter = $cmds[1];
@@ -467,7 +467,7 @@  discard block
 block discarded – undo
467 467
                 else if ($cmds[0] == "option" || $cmds[0] == "o") {
468 468
                     if (!isset($cmds[1]) || $cmds[1] == "") {
469 469
                         $this->status = "Option value needs to be specified. See 'help' or 'h' for instructions";
470
-                        $this->statusexpire = $this->currenttime+5;
470
+                        $this->statusexpire = $this->currenttime + 5;
471 471
                     }
472 472
                     else if ($cmds[1] == "p" || $cmds[1] == "push" || $cmds[1] == "ping")
473 473
                         $this->showPush = !$this->showPush;
@@ -484,7 +484,7 @@  discard block
 block discarded – undo
484 484
                         $this->showTermSec = $cmds[1];
485 485
                     else {
486 486
                         $this->status = sprintf("Option '%s' unknown", $cmds[1]);
487
-                        $this->statusexpire = $this->currenttime+5;
487
+                        $this->statusexpire = $this->currenttime + 5;
488 488
                     }
489 489
                 }
490 490
                 else if ($cmds[0] == "reset" || $cmds[0] == "r") {
@@ -492,66 +492,66 @@  discard block
 block discarded – undo
492 492
                     $this->wide = false;
493 493
                     $this->helpexpire = 0;
494 494
                     $this->status = "reset";
495
-                    $this->statusexpire = $this->currenttime+2;
495
+                    $this->statusexpire = $this->currenttime + 2;
496 496
                 }
497 497
                 // enable/disable wide view
498 498
                 else if ($cmds[0] == "wide" || $cmds[0] == "w") {
499
-                    $this->wide = ! $this->wide;
500
-                    $this->status = ($this->wide)?"w i d e  view" : "normal view";
501
-                    $this->statusexpire = $this->currenttime+2;
499
+                    $this->wide = !$this->wide;
500
+                    $this->status = ($this->wide) ? "w i d e  view" : "normal view";
501
+                    $this->statusexpire = $this->currenttime + 2;
502 502
                 }
503 503
                 else if ($cmds[0] == "help" || $cmds[0] == "h") {
504
-                    $this->helpexpire = $this->currenttime+20;
504
+                    $this->helpexpire = $this->currenttime + 20;
505 505
                 }
506 506
                 // grep the log file
507
-                else if (($cmds[0] == "log" || $cmds[0] == "l") && isset($cmds[1]) ) {
507
+                else if (($cmds[0] == "log" || $cmds[0] == "l") && isset($cmds[1])) {
508 508
                     if (!file_exists(LOGFILE)) {
509
-                        $this->status = "Logfile can not be found: ". LOGFILE;
509
+                        $this->status = "Logfile can not be found: ".LOGFILE;
510 510
                     }
511 511
                     else {
512
-                        system('bash -c "fgrep -a '.escapeshellarg($cmds[1]).' '. LOGFILE .' | less +G" > `tty`');
512
+                        system('bash -c "fgrep -a '.escapeshellarg($cmds[1]).' '.LOGFILE.' | less +G" > `tty`');
513 513
                         $this->status = "Returning from log, updating data";
514 514
                     }
515
-                    $this->statusexpire = time()+5; // it might be much "later" now
515
+                    $this->statusexpire = time() + 5; // it might be much "later" now
516 516
                 }
517 517
                 // tail the log file
518 518
                 else if (($cmds[0] == "tail" || $cmds[0] == "t")) {
519 519
                     if (!file_exists(LOGFILE)) {
520
-                        $this->status = "Logfile can not be found: ". LOGFILE;
520
+                        $this->status = "Logfile can not be found: ".LOGFILE;
521 521
                     }
522 522
                     else {
523 523
                         $this->doingTail = true;
524 524
                         $this->scrClear();
525
-                        $this->scrPrintAt(1,0,$this->scrAsBold("Press CTRL+C to return to grommunio-sync-top\n\n"));
525
+                        $this->scrPrintAt(1, 0, $this->scrAsBold("Press CTRL+C to return to grommunio-sync-top\n\n"));
526 526
                         $secondary = "";
527
-                        if (isset($cmds[1])) $secondary =  " -n 200 | grep ".escapeshellarg($cmds[1]);
528
-                        system('bash -c "tail -f '. LOGFILE . $secondary . '" > `tty`');
527
+                        if (isset($cmds[1])) $secondary = " -n 200 | grep ".escapeshellarg($cmds[1]);
528
+                        system('bash -c "tail -f '.LOGFILE.$secondary.'" > `tty`');
529 529
                         $this->doingTail = false;
530 530
                         $this->status = "Returning from tail, updating data";
531 531
                     }
532
-                    $this->statusexpire = time()+5; // it might be much "later" now
532
+                    $this->statusexpire = time() + 5; // it might be much "later" now
533 533
                 }
534 534
                 // tail the error log file
535 535
                 else if (($cmds[0] == "error" || $cmds[0] == "e")) {
536 536
                     if (!file_exists(LOGERRORFILE)) {
537
-                        $this->status = "Error logfile can not be found: ". LOGERRORFILE;
537
+                        $this->status = "Error logfile can not be found: ".LOGERRORFILE;
538 538
                     }
539 539
                     else {
540 540
                         $this->doingTail = true;
541 541
                         $this->scrClear();
542
-                        $this->scrPrintAt(1,0,$this->scrAsBold("Press CTRL+C to return to grommunio-sync-top\n\n"));
542
+                        $this->scrPrintAt(1, 0, $this->scrAsBold("Press CTRL+C to return to grommunio-sync-top\n\n"));
543 543
                         $secondary = "";
544
-                        if (isset($cmds[1])) $secondary =  " -n 200 | grep ".escapeshellarg($cmds[1]);
545
-                        system('bash -c "tail -f '. LOGERRORFILE . $secondary . '" > `tty`');
544
+                        if (isset($cmds[1])) $secondary = " -n 200 | grep ".escapeshellarg($cmds[1]);
545
+                        system('bash -c "tail -f '.LOGERRORFILE.$secondary.'" > `tty`');
546 546
                         $this->doingTail = false;
547 547
                         $this->status = "Returning from tail, updating data";
548 548
                     }
549
-                    $this->statusexpire = time()+5; // it might be much "later" now
549
+                    $this->statusexpire = time() + 5; // it might be much "later" now
550 550
                 }
551 551
 
552 552
                 else if ($cmds[0] != "") {
553 553
                     $this->status = sprintf("Command '%s' unknown", $cmds[0]);
554
-                    $this->statusexpire = $this->currenttime+8;
554
+                    $this->statusexpire = $this->currenttime + 8;
555 555
                 }
556 556
                 $this->action = "";
557 557
             }
@@ -582,7 +582,7 @@  discard block
 block discarded – undo
582 582
      * @access public
583 583
      */
584 584
     public function UsageInstructions() {
585
-        $help = "Usage:\n\tgrommunio-sync-top.php\n\n" .
585
+        $help = "Usage:\n\tgrommunio-sync-top.php\n\n".
586 586
                 "  grommunio-sync-top is a live top-like overview of what grommunio-sync is doing. It does not have specific command line options.\n\n".
587 587
                 "  When grommunio-sync-top is running you can specify certain actions and options which can be executed (listed below).\n".
588 588
                 "  This help information can also be shown inside grommunio-sync-top by hitting 'help' or 'h'.\n\n";
@@ -634,7 +634,7 @@  discard block
 block discarded – undo
634 634
      * @return string       same text as bold
635 635
      */
636 636
     private function scrAsBold($text) {
637
-        return "\033[01m" . $text  ."\033[0m";
637
+        return "\033[01m".$text."\033[0m";
638 638
     }
639 639
 
640 640
     /**
@@ -647,9 +647,9 @@  discard block
 block discarded – undo
647 647
      */
648 648
     private function getLine($l) {
649 649
         if ($this->wide === true)
650
-            return sprintf("%s%s%s%s%s%s%s%s", $this->ptStr($l['pid'],6), $this->ptStr($l['ip'],16), $this->ptStr($l['user'],24), $this->ptStr($l['command'],16), $this->ptStr($this->sec2min($l['time']),8), $this->ptStr($l['devagent'],28), $this->ptStr($l['devid'],33, true), $l['addinfo']);
650
+            return sprintf("%s%s%s%s%s%s%s%s", $this->ptStr($l['pid'], 6), $this->ptStr($l['ip'], 16), $this->ptStr($l['user'], 24), $this->ptStr($l['command'], 16), $this->ptStr($this->sec2min($l['time']), 8), $this->ptStr($l['devagent'], 28), $this->ptStr($l['devid'], 33, true), $l['addinfo']);
651 651
         else
652
-            return sprintf("%s%s%s%s%s%s%s%s", $this->ptStr($l['pid'],6), $this->ptStr($l['ip'],16), $this->ptStr($l['user'],8), $this->ptStr($l['command'],8), $this->ptStr($this->sec2min($l['time']),6), $this->ptStr($l['devagent'],20), $this->ptStr($l['devid'],12, true), $l['addinfo']);
652
+            return sprintf("%s%s%s%s%s%s%s%s", $this->ptStr($l['pid'], 6), $this->ptStr($l['ip'], 16), $this->ptStr($l['user'], 8), $this->ptStr($l['command'], 8), $this->ptStr($this->sec2min($l['time']), 6), $this->ptStr($l['devagent'], 20), $this->ptStr($l['devid'], 12, true), $l['addinfo']);
653 653
     }
654 654
 
655 655
     /**
@@ -667,11 +667,11 @@  discard block
 block discarded – undo
667 667
         if (strlen($str) < $size)
668 668
             return str_pad($str, $size);
669 669
         else if ($cutmiddle == true) {
670
-            $cut = ($size-2)/2;
671
-            return $this->ptStr(substr($str,0,$cut) ."..". substr($str,(-1)*($cut-1)), $size);
670
+            $cut = ($size - 2) / 2;
671
+            return $this->ptStr(substr($str, 0, $cut)."..".substr($str, (-1) * ($cut - 1)), $size);
672 672
         }
673 673
         else {
674
-            return substr($str,0,$size-3).".. ";
674
+            return substr($str, 0, $size - 3).".. ";
675 675
         }
676 676
     }
677 677
 
@@ -711,7 +711,7 @@  discard block
 block discarded – undo
711 711
     private function sec2min($s) {
712 712
         if (!is_int($s))
713 713
             return $s;
714
-        return sprintf("%02.2d:%02.2d", floor($s/60), $s%60);
714
+        return sprintf("%02.2d:%02.2d", floor($s / 60), $s % 60);
715 715
     }
716 716
 
717 717
     /**
@@ -746,7 +746,7 @@  discard block
 block discarded – undo
746 746
      * @access private
747 747
      * @return
748 748
      */
749
-    private function scrPrintAt($row, $col, $text="") {
749
+    private function scrPrintAt($row, $col, $text = "") {
750 750
         echo "\033[".$row.";".$col."H".$text;
751 751
     }
752 752
 
Please login to merge, or discard this patch.
config.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
     define('TIMEZONE', '');
15 15
 
16 16
     // Defines the base path on the server
17
-    define('BASE_PATH', dirname($_SERVER['SCRIPT_FILENAME']). '/');
17
+    define('BASE_PATH', dirname($_SERVER['SCRIPT_FILENAME']).'/');
18 18
 
19 19
     // Try to set unlimited timeout
20 20
     define('SCRIPT_TIMEOUT', 0);
@@ -80,8 +80,8 @@  discard block
 block discarded – undo
80 80
 
81 81
     // Filelog settings
82 82
     define('LOGFILEDIR', '/var/log/grommunio-sync/');
83
-    define('LOGFILE', LOGFILEDIR . 'grommunio-sync.log');
84
-    define('LOGERRORFILE', LOGFILEDIR . 'grommunio-sync-error.log');
83
+    define('LOGFILE', LOGFILEDIR.'grommunio-sync.log');
84
+    define('LOGERRORFILE', LOGFILEDIR.'grommunio-sync-error.log');
85 85
 
86 86
     // Syslog settings
87 87
     // false will log to local syslog, otherwise put the remote syslog IP here
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
     // point. You can add DeviceType strings to the categories.
217 217
     // In general longer timeouts are better, because more data can be streamed at once.
218 218
     define('SYNC_TIMEOUT_MEDIUM_DEVICETYPES', "SAMSUNGGTI");
219
-    define('SYNC_TIMEOUT_LONG_DEVICETYPES',   "iPod, iPad, iPhone, WP, WindowsOutlook, WindowsMail");
219
+    define('SYNC_TIMEOUT_LONG_DEVICETYPES', "iPod, iPad, iPhone, WP, WindowsOutlook, WindowsMail");
220 220
 
221 221
     // Time in seconds the device should wait whenever the service is unavailable,
222 222
     // e.g. when a backend service is unavailable.
Please login to merge, or discard this patch.
mapi/class.taskrequest.php 1 patch
Spacing   +82 added lines, -82 removed lines patch added patch discarded remove patch
@@ -23,12 +23,12 @@  discard block
 block discarded – undo
23 23
      * carried in the IPM.TaskRequest item (although this information seems
24 24
      * redundant due to that information already being available in PR_MESSAGE_CLASS).
25 25
      */
26
-    define('tdmtNothing', 0);            // Value in IPM.Task items
27
-    define('tdmtTaskReq', 1);            // Assigner -> Assignee
28
-    define('tdmtTaskAcc', 2);            // Assignee -> Assigner
29
-    define('tdmtTaskDec', 3);            // Assignee -> Assigner
30
-    define('tdmtTaskUpd', 4);            // Assignee -> Assigner
31
-    define('tdmtTaskSELF', 5);            // Assigner -> Assigner (?)
26
+    define('tdmtNothing', 0); // Value in IPM.Task items
27
+    define('tdmtTaskReq', 1); // Assigner -> Assignee
28
+    define('tdmtTaskAcc', 2); // Assignee -> Assigner
29
+    define('tdmtTaskDec', 3); // Assignee -> Assigner
30
+    define('tdmtTaskUpd', 4); // Assignee -> Assigner
31
+    define('tdmtTaskSELF', 5); // Assigner -> Assigner (?)
32 32
 
33 33
     /* The TaskHistory is used to show the last action on the task
34 34
      * on both the assigner and the assignee's side.
@@ -38,22 +38,22 @@  discard block
 block discarded – undo
38 38
      * the format 'Accepted by <user> on 01-01-2010 11:00'.
39 39
      */
40 40
     define('thNone', 0);
41
-    define('thAccepted', 1);            // Set by assignee
42
-    define('thDeclined', 2);            // Set by assignee
43
-    define('thUpdated', 3);                // Set by assignee
41
+    define('thAccepted', 1); // Set by assignee
42
+    define('thDeclined', 2); // Set by assignee
43
+    define('thUpdated', 3); // Set by assignee
44 44
     define('thDueDateChanged', 4);
45
-    define('thAssigned', 5);            // Set by assigner
45
+    define('thAssigned', 5); // Set by assigner
46 46
 
47 47
     /* The TaskState value is used to differentiate the version of a task
48 48
      * in the assigner's folder and the version in the
49 49
      * assignee's folder. The buttons shown depend on this and
50 50
      * the 'taskaccepted' boolean (for the assignee)
51 51
      */
52
-    define('tdsNOM', 0);        // Got a response to a deleted task, and re-created the task for the assigner
53
-    define('tdsOWNNEW', 1);        // Not assigned
54
-    define('tdsOWN', 2);        // Assignee version
55
-    define('tdsACC', 3);        // Assigner version
56
-    define('tdsDEC', 4);        // Assigner version, but assignee declined
52
+    define('tdsNOM', 0); // Got a response to a deleted task, and re-created the task for the assigner
53
+    define('tdsOWNNEW', 1); // Not assigned
54
+    define('tdsOWN', 2); // Assignee version
55
+    define('tdsACC', 3); // Assigner version
56
+    define('tdsDEC', 4); // Assigner version, but assignee declined
57 57
 
58 58
     /* The TaskAcceptanceState is used for the assigner to indicate state */
59 59
     define('olTaskNotDelegated', 0);
@@ -63,13 +63,13 @@  discard block
 block discarded – undo
63 63
 
64 64
     /* The task ownership indicates the role of the current user relative to the task. */
65 65
     define('olNewTask', 0);
66
-    define('olDelegatedTask', 1);    // Task has been assigned
67
-    define('olOwnTask', 2);            // Task owned
66
+    define('olDelegatedTask', 1); // Task has been assigned
67
+    define('olOwnTask', 2); // Task owned
68 68
 
69 69
     /* taskmultrecips indicates whether the task request sent or received has multiple assignees or not. */
70 70
     define('tmrNone', 0);
71
-    define('tmrSent', 1);        // Task has been sent to multiple assignee
72
-    define('tmrReceived', 2);    // Task Request received has multiple assignee
71
+    define('tmrSent', 1); // Task has been sent to multiple assignee
72
+    define('tmrReceived', 2); // Task Request received has multiple assignee
73 73
 
74 74
     //Task icon index.
75 75
     define('ICON_TASK_ASSIGNEE', 0x00000502);
@@ -165,12 +165,12 @@  discard block
 block discarded – undo
165 165
          */
166 166
         function isTaskRequest($messageClass = false)
167 167
         {
168
-            if($messageClass === false) {
168
+            if ($messageClass === false) {
169 169
                 $props = mapi_getprops($this->message, Array(PR_MESSAGE_CLASS));
170 170
                 $messageClass = isset($props[PR_MESSAGE_CLASS]) ? $props[PR_MESSAGE_CLASS] : false;
171 171
             }
172 172
 
173
-            if($messageClass !== false &&  $messageClass === "IPM.TaskRequest") {
173
+            if ($messageClass !== false && $messageClass === "IPM.TaskRequest") {
174 174
                 return true;
175 175
             }
176 176
 
@@ -184,12 +184,12 @@  discard block
 block discarded – undo
184 184
          */
185 185
         function isTaskRequestResponse($messageClass = false)
186 186
         {
187
-            if($messageClass === false) {
187
+            if ($messageClass === false) {
188 188
                 $props = mapi_getprops($this->message, Array(PR_MESSAGE_CLASS));
189 189
                 $messageClass = isset($props[PR_MESSAGE_CLASS]) ? $props[PR_MESSAGE_CLASS] : false;
190 190
             }
191 191
 
192
-            if($messageClass !== false &&  strpos($messageClass, "IPM.TaskRequest.") === 0) {
192
+            if ($messageClass !== false && strpos($messageClass, "IPM.TaskRequest.") === 0) {
193 193
                 return true;
194 194
             }
195 195
 
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
         {
223 223
             $props = mapi_getprops($this->message, array(PR_MESSAGE_CLASS, $this->props['task_goid']));
224 224
 
225
-            if($props[PR_MESSAGE_CLASS] == "IPM.Task") {
225
+            if ($props[PR_MESSAGE_CLASS] == "IPM.Task") {
226 226
                 // Message itself is task, so return that
227 227
                 return $this->message;
228 228
             }
@@ -240,9 +240,9 @@  discard block
 block discarded – undo
240 240
 
241 241
             $rows = mapi_table_queryallrows($contents, array(PR_ENTRYID), $restriction);
242 242
 
243
-            if(empty($rows)) {
243
+            if (empty($rows)) {
244 244
                 // None found, create one if possible
245
-                if(!$create) {
245
+                if (!$create) {
246 246
                     return false;
247 247
                 }
248 248
 
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
             $result = false;
289 289
             $associatedTask = $this->getAssociatedTask(false);
290 290
             if ($this->isTaskRequest($props[PR_MESSAGE_CLASS])) {
291
-                if($associatedTask) {
291
+                if ($associatedTask) {
292 292
                     return true;
293 293
                 } else {
294 294
                     $folder = $this->getDefaultTasksFolder();
@@ -300,7 +300,7 @@  discard block
 block discarded – undo
300 300
                         VALUE => $goid)
301 301
                     );
302 302
 
303
-                    $table = mapi_folder_getcontentstable($folder, MAPI_DEFERRED_ERRORS | SHOW_SOFT_DELETES);
303
+                    $table = mapi_folder_getcontentstable($folder, MAPI_DEFERRED_ERRORS|SHOW_SOFT_DELETES);
304 304
                     $softDeletedItems = mapi_table_queryallrows($table, array(PR_ENTRYID), $restriction);
305 305
                     if (!empty($softDeletedItems)) {
306 306
                         return true;
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
                  * if(message_counter >= task_counter) task is not updated, do normal processing
316 316
                  */
317 317
                 if (isset($taskItemProps[$this->props['updatecount']], $props[$this->props['updatecount']])) {
318
-                    if($props[$this->props['updatecount']] < $taskItemProps[$this->props['updatecount']]) {
318
+                    if ($props[$this->props['updatecount']] < $taskItemProps[$this->props['updatecount']]) {
319 319
                         $result = true;
320 320
                     }
321 321
                 }
@@ -345,7 +345,7 @@  discard block
 block discarded – undo
345 345
 
346 346
             // If task is updated in task folder then we don't need to process
347 347
             // old response
348
-            if($this->isTaskRequestUpdated()) {
348
+            if ($this->isTaskRequestUpdated()) {
349 349
                 return true;
350 350
             }
351 351
 
@@ -379,7 +379,7 @@  discard block
 block discarded – undo
379 379
                     break;
380 380
             }
381 381
 
382
-            $props =  array($this->props['taskhistory'] => $taskHistory,
382
+            $props = array($this->props['taskhistory'] => $taskHistory,
383 383
                 $this->props['taskstate'] => $taskState,
384 384
                 $this->props['task_acceptance_state'] => $taskAcceptanceState,
385 385
                 $this->props['ownership'] => $taskOwner);
@@ -391,7 +391,7 @@  discard block
 block discarded – undo
391 391
                 // all attachments from associated task.
392 392
                 $taskAttachTable = mapi_message_getattachmenttable($task);
393 393
                 $taskAttachments = mapi_table_queryallrows($taskAttachTable, array(PR_ATTACH_NUM));
394
-                foreach($taskAttachments as $taskAttach) {
394
+                foreach ($taskAttachments as $taskAttach) {
395 395
                     mapi_message_deleteattach($task, $taskAttach[PR_ATTACH_NUM]);
396 396
                 }
397 397
 
@@ -426,7 +426,7 @@  discard block
 block discarded – undo
426 426
                 mapi_setprops($task, $senderProps);
427 427
 
428 428
                 // Update taskstate and task history (last action done by the assignee)
429
-                mapi_setprops($task,$props);
429
+                mapi_setprops($task, $props);
430 430
 
431 431
                 mapi_savechanges($task);
432 432
             }
@@ -434,7 +434,7 @@  discard block
 block discarded – undo
434 434
             mapi_setprops($this->message, $props);
435 435
             mapi_savechanges($this->message);
436 436
 
437
-            if($isReceivedItem) {
437
+            if ($isReceivedItem) {
438 438
                 $this->updateSentTaskRequest();
439 439
             }
440 440
             return true;
@@ -458,7 +458,7 @@  discard block
 block discarded – undo
458 458
             $storeProps = mapi_getprops($store, array(PR_IPM_SENTMAIL_ENTRYID));
459 459
 
460 460
             $sentFolder = mapi_msgstore_openentry($store, $storeProps[PR_IPM_SENTMAIL_ENTRYID]);
461
-            if(!$sentFolder) {
461
+            if (!$sentFolder) {
462 462
                 return false;
463 463
             }
464 464
 
@@ -472,7 +472,7 @@  discard block
 block discarded – undo
472 472
 
473 473
             $rows = mapi_table_queryallrows($contentsTable, array(PR_ENTRYID), $restriction);
474 474
 
475
-            if(!empty($rows)) {
475
+            if (!empty($rows)) {
476 476
                 foreach ($rows as $row) {
477 477
                     $sentTaskRequest = mapi_msgstore_openentry($store, $row[PR_ENTRYID]);
478 478
                     mapi_setprops($sentTaskRequest, $props);
@@ -496,12 +496,12 @@  discard block
 block discarded – undo
496 496
             // Set properties on Task Request
497 497
             mapi_setprops($this->message, array(
498 498
                 $this->props['task_goid'] => $taskid, /* our new task_goid */
499
-                $this->props['taskstate'] => tdsACC,         /* state for our outgoing request */
500
-                $this->props['taskmode'] => tdmtNothing,     /* we're not sending a change */
501
-                $this->props['updatecount'] => 2,            /* version 2 (no idea) */
499
+                $this->props['taskstate'] => tdsACC, /* state for our outgoing request */
500
+                $this->props['taskmode'] => tdmtNothing, /* we're not sending a change */
501
+                $this->props['updatecount'] => 2, /* version 2 (no idea) */
502 502
                 $this->props['task_acceptance_state'] => olTaskDelegationUnknown, /* no reply yet */
503 503
                 $this->props['ownership'] => olDelegatedTask, /* Task has been assigned */
504
-                $this->props['taskhistory'] => thAssigned,    /* Task has been assigned */
504
+                $this->props['taskhistory'] => thAssigned, /* Task has been assigned */
505 505
                 PR_CONVERSATION_TOPIC => $messageprops[PR_SUBJECT],
506 506
                 PR_ICON_INDEX => ICON_TASK_ASSIGNER         /* Task request icon*/
507 507
             ));
@@ -518,12 +518,12 @@  discard block
 block discarded – undo
518 518
 
519 519
             // Make it a task request, and put it in sent items after it is sent
520 520
             mapi_setprops($outgoing, array(
521
-                PR_MESSAGE_CLASS => "IPM.TaskRequest",         /* class is task request */
522
-                $this->props['taskstate'] => tdsOWN,         /* for the recipient he is the task owner */
523
-                $this->props['taskmode'] => tdmtTaskReq,    /* for the recipient it's a request */
524
-                $this->props['updatecount'] => 1,            /* version 2 is in the attachment */
521
+                PR_MESSAGE_CLASS => "IPM.TaskRequest", /* class is task request */
522
+                $this->props['taskstate'] => tdsOWN, /* for the recipient he is the task owner */
523
+                $this->props['taskmode'] => tdmtTaskReq, /* for the recipient it's a request */
524
+                $this->props['updatecount'] => 1, /* version 2 is in the attachment */
525 525
                 PR_SUBJECT_PREFIX => $prefix,
526
-                PR_SUBJECT => $prefix . $messageprops[PR_SUBJECT]
526
+                PR_SUBJECT => $prefix.$messageprops[PR_SUBJECT]
527 527
             ));
528 528
 
529 529
             $attach = mapi_message_createattach($outgoing);
@@ -532,7 +532,7 @@  discard block
 block discarded – undo
532 532
                     PR_ATTACHMENT_HIDDEN => true,
533 533
                     PR_DISPLAY_NAME => $messageprops[PR_SUBJECT]));
534 534
 
535
-            $sub = mapi_attach_openproperty($attach, PR_ATTACH_DATA_OBJ, IID_IMessage, 0, MAPI_MODIFY | MAPI_CREATE);
535
+            $sub = mapi_attach_openproperty($attach, PR_ATTACH_DATA_OBJ, IID_IMessage, 0, MAPI_MODIFY|MAPI_CREATE);
536 536
 
537 537
             mapi_copyto($this->message, array(), array(), $sub);
538 538
             mapi_savechanges($sub);
@@ -553,7 +553,7 @@  discard block
 block discarded – undo
553 553
         function updateTaskRequest() {
554 554
             $messageprops = mapi_getprops($this->message, array($this->props['updatecount']));
555 555
 
556
-            if(isset($messageprops)) {
556
+            if (isset($messageprops)) {
557 557
                 $messageprops[$this->props['updatecount']]++;
558 558
             } else {
559 559
                 $messageprops[$this->props['updatecount']] = 1;
@@ -578,7 +578,7 @@  discard block
 block discarded – undo
578 578
 
579 579
             // if task is updated in task folder then we don't need to process
580 580
             // old request.
581
-            if($this->isTaskRequestUpdated()) {
581
+            if ($this->isTaskRequestUpdated()) {
582 582
                 return true;
583 583
             }
584 584
 
@@ -629,10 +629,10 @@  discard block
 block discarded – undo
629 629
          * @return entryid EntryID of the accepted task
630 630
          */
631 631
         function doAccept() {
632
-            $prefix = _("Task Accepted:") . " ";
632
+            $prefix = _("Task Accepted:")." ";
633 633
             $messageProps = mapi_getprops($this->message, array(PR_MESSAGE_CLASS, $this->props['taskstate']));
634 634
 
635
-            if(!isset($messageProps[$this->props['taskstate']]) || $messageProps[$this->props['taskstate']] != tdsOWN) {
635
+            if (!isset($messageProps[$this->props['taskstate']]) || $messageProps[$this->props['taskstate']] != tdsOWN) {
636 636
                 // Can only accept assignee task
637 637
                 return false;
638 638
             }
@@ -678,10 +678,10 @@  discard block
 block discarded – undo
678 678
          * @return boolean TRUE on success, FALSE on failure
679 679
          */
680 680
         function doDecline() {
681
-            $prefix = _("Task Declined:") . " ";
681
+            $prefix = _("Task Declined:")." ";
682 682
             $messageProps = mapi_getprops($this->message, array($this->props['taskstate']));
683 683
 
684
-            if(!isset($messageProps[$this->props['taskstate']]) || $messageProps[$this->props['taskstate']] != tdsOWN) {
684
+            if (!isset($messageProps[$this->props['taskstate']]) || $messageProps[$this->props['taskstate']] != tdsOWN) {
685 685
                 return false; // Can only decline assignee task
686 686
             }
687 687
 
@@ -718,7 +718,7 @@  discard block
 block discarded – undo
718 718
         function doUpdate() {
719 719
             $messageProps = mapi_getprops($this->message, array($this->props['taskstate'], PR_SUBJECT));
720 720
 
721
-            if(!isset($messageProps[$this->props['taskstate']]) || $messageProps[$this->props['taskstate']] != tdsOWN) {
721
+            if (!isset($messageProps[$this->props['taskstate']]) || $messageProps[$this->props['taskstate']] != tdsOWN) {
722 722
                 return false; // Can only update assignee task
723 723
             }
724 724
 
@@ -732,9 +732,9 @@  discard block
 block discarded – undo
732 732
 
733 733
             $props = mapi_getprops($this->message, array($this->props['taskupdates'], $this->props['tasksoc'], $this->props['recurring'], $this->props['complete']));
734 734
             if (!$props[$this->props['complete']] && $props[$this->props['taskupdates']] && !(isset($props[$this->props['recurring']]) && $props[$this->props['recurring']])) {
735
-                $this->sendResponse(tdmtTaskUpd, _("Task Updated:") . " ");
736
-            } else if($props[$this->props['complete']]) {
737
-                $this->sendResponse(tdmtTaskUpd, _("Task Completed:") . " ");
735
+                $this->sendResponse(tdmtTaskUpd, _("Task Updated:")." ");
736
+            } else if ($props[$this->props['complete']]) {
737
+                $this->sendResponse(tdmtTaskUpd, _("Task Completed:")." ");
738 738
             }
739 739
             return true;
740 740
         }
@@ -750,21 +750,21 @@  discard block
 block discarded – undo
750 750
             $ownerentryid = false;
751 751
 
752 752
             $rcvdprops = mapi_getprops($this->message, array(PR_RCVD_REPRESENTING_ENTRYID));
753
-            if(isset($rcvdprops[PR_RCVD_REPRESENTING_ENTRYID])) {
753
+            if (isset($rcvdprops[PR_RCVD_REPRESENTING_ENTRYID])) {
754 754
                 $ownerentryid = $rcvdprops;
755 755
             }
756 756
 
757
-            if(!$ownerentryid) {
757
+            if (!$ownerentryid) {
758 758
                 $store = $this->store;
759 759
             } else {
760 760
                 $ab = mapi_openaddressbook($this->session);
761
-                if(!$ab) return false;
761
+                if (!$ab) return false;
762 762
 
763 763
                 $mailuser = mapi_ab_openentry($ab, $ownerentryid);
764
-                if(!$mailuser) return false;
764
+                if (!$mailuser) return false;
765 765
 
766 766
                 $mailuserprops = mapi_getprops($mailuser, array(PR_EMAIL_ADDRESS));
767
-                if(!isset($mailuserprops[PR_EMAIL_ADDRESS])) return false;
767
+                if (!isset($mailuserprops[PR_EMAIL_ADDRESS])) return false;
768 768
 
769 769
                 $storeid = mapi_msgstore_createentryid($this->store, $mailuserprops[PR_EMAIL_ADDRESS]);
770 770
 
@@ -783,7 +783,7 @@  discard block
 block discarded – undo
783 783
 
784 784
             $inbox = mapi_msgstore_getreceivefolder($store);
785 785
             $inboxprops = mapi_getprops($inbox, Array(PR_IPM_TASK_ENTRYID));
786
-            if(!isset($inboxprops[PR_IPM_TASK_ENTRYID]))
786
+            if (!isset($inboxprops[PR_IPM_TASK_ENTRYID]))
787 787
                 return false;
788 788
 
789 789
             return mapi_msgstore_openentry($store, $inboxprops[PR_IPM_TASK_ENTRYID]);
@@ -827,10 +827,10 @@  discard block
 block discarded – undo
827 827
             $storeprops = mapi_getprops($store, array(PR_IPM_OUTBOX_ENTRYID, PR_IPM_SENTMAIL_ENTRYID));
828 828
 
829 829
             $outbox = mapi_msgstore_openentry($store, $storeprops[PR_IPM_OUTBOX_ENTRYID]);
830
-            if(!$outbox) return false;
830
+            if (!$outbox) return false;
831 831
 
832 832
             $outgoing = mapi_folder_createmessage($outbox);
833
-            if(!$outgoing) return false;
833
+            if (!$outgoing) return false;
834 834
 
835 835
             // Set SENT_REPRESENTING in case we're sending as a delegate
836 836
             $ownerstore = $this->getTaskFolderStore();
@@ -856,7 +856,7 @@  discard block
 block discarded – undo
856 856
 
857 857
             $attach = mapi_message_createattach($outgoing);
858 858
             mapi_setprops($attach, array(PR_ATTACH_METHOD => ATTACH_EMBEDDED_MSG, PR_DISPLAY_NAME => $messageprops[PR_CONVERSATION_TOPIC], PR_ATTACHMENT_HIDDEN => true));
859
-            $sub = mapi_attach_openproperty($attach, PR_ATTACH_DATA_OBJ, IID_IMessage, 0, MAPI_CREATE | MAPI_MODIFY);
859
+            $sub = mapi_attach_openproperty($attach, PR_ATTACH_DATA_OBJ, IID_IMessage, 0, MAPI_CREATE|MAPI_MODIFY);
860 860
 
861 861
             $message = !$this->isTaskRequest() ? $this->message : $this->getAssociatedTask(false);
862 862
 
@@ -870,7 +870,7 @@  discard block
 block discarded – undo
870 870
             }
871 871
 
872 872
             $props = array();
873
-            switch($type) {
873
+            switch ($type) {
874 874
                 case tdmtTaskAcc:
875 875
                     $props[PR_MESSAGE_CLASS] = "IPM.TaskRequest.Accept";
876 876
                     mapi_setprops($sub, array(PR_ICON_INDEX => ICON_TASK_ASSIGNER));
@@ -881,7 +881,7 @@  discard block
 block discarded – undo
881 881
                     break;
882 882
                 case tdmtTaskUpd:
883 883
                     mapi_setprops($sub, array(PR_ICON_INDEX => ICON_TASK_ASSIGNER));
884
-                    if($messageprops[$this->props['complete']]) {
884
+                    if ($messageprops[$this->props['complete']]) {
885 885
                         $props[PR_MESSAGE_CLASS] = "IPM.TaskRequest.Complete";
886 886
                     } else {
887 887
                         $props[PR_MESSAGE_CLASS] = "IPM.TaskRequest.Update";
@@ -893,7 +893,7 @@  discard block
 block discarded – undo
893 893
             mapi_savechanges($sub);
894 894
             mapi_savechanges($attach);
895 895
 
896
-            $props[PR_SUBJECT] = $prefix . $messageprops[PR_CONVERSATION_TOPIC];
896
+            $props[PR_SUBJECT] = $prefix.$messageprops[PR_CONVERSATION_TOPIC];
897 897
             $props[$this->props['taskmode']] = $type;
898 898
             $props[$this->props['task_assigned_time']] = time();
899 899
 
@@ -903,7 +903,7 @@  discard block
 block discarded – undo
903 903
             // edit response before sending task response.
904 904
             if ($this->taskCommentsInfo) {
905 905
                 $comments = $this->getTaskCommentsInfo();
906
-                $stream = mapi_openproperty($outgoing, PR_BODY, IID_IStream, STGM_TRANSACTED, MAPI_CREATE | MAPI_MODIFY);
906
+                $stream = mapi_openproperty($outgoing, PR_BODY, IID_IStream, STGM_TRANSACTED, MAPI_CREATE|MAPI_MODIFY);
907 907
                 mapi_stream_setsize($stream, strlen($comments));
908 908
                 mapi_stream_write($stream, $comments);
909 909
                 mapi_stream_commit($stream);
@@ -919,8 +919,8 @@  discard block
 block discarded – undo
919 919
             $table = mapi_getmsgstorestable($this->session);
920 920
             $rows = mapi_table_queryallrows($table, array(PR_DEFAULT_STORE, PR_ENTRYID));
921 921
 
922
-            foreach($rows as $row) {
923
-                if($row[PR_DEFAULT_STORE])
922
+            foreach ($rows as $row) {
923
+                if ($row[PR_DEFAULT_STORE])
924 924
                     return mapi_openmsgstore($this->session, $row[PR_ENTRYID]);
925 925
             }
926 926
 
@@ -935,7 +935,7 @@  discard block
 block discarded – undo
935 935
         function createTGOID()
936 936
         {
937 937
             $goid = "";
938
-            for($i=0;$i<16;$i++) {
938
+            for ($i = 0; $i < 16; $i++) {
939 939
                 $goid .= chr(rand(0, 255));
940 940
             }
941 941
             return $goid;
@@ -959,7 +959,7 @@  discard block
 block discarded – undo
959 959
                             );
960 960
             $rows = mapi_table_queryallrows($attachmentTable, array(PR_ATTACH_NUM), $restriction);
961 961
 
962
-            if(empty($rows)) {
962
+            if (empty($rows)) {
963 963
                 return $task;
964 964
             }
965 965
 
@@ -972,7 +972,7 @@  discard block
 block discarded – undo
972 972
                 }
973 973
 
974 974
                 $taskGoid = mapi_getprops($task, array($this->props["task_goid"]));
975
-                if($goid[$this->props["task_goid"]] === $taskGoid[$this->props["task_goid"]]) {
975
+                if ($goid[$this->props["task_goid"]] === $taskGoid[$this->props["task_goid"]]) {
976 976
                     mapi_setprops($attach, array(PR_ATTACHMENT_HIDDEN => true));
977 977
                     mapi_savechanges($attach);
978 978
                     mapi_savechanges($message);
@@ -1042,11 +1042,11 @@  discard block
 block discarded – undo
1042 1042
 
1043 1043
             // Delete all MAPI_TO recipients
1044 1044
             $recips = mapi_table_queryallrows($recipTable, array(PR_ROWID), array(RES_PROPERTY,
1045
-                                                                                array(    RELOP => RELOP_EQ,
1045
+                                                                                array(RELOP => RELOP_EQ,
1046 1046
                                                                                         ULPROPTAG => PR_RECIPIENT_TYPE,
1047 1047
                                                                                         VALUE => MAPI_TO
1048 1048
                                                                                 )));
1049
-            foreach($recips as $recip) {
1049
+            foreach ($recips as $recip) {
1050 1050
                 mapi_message_modifyrecipients($task, MODRECIP_REMOVE, array($recip));
1051 1051
             }
1052 1052
 
@@ -1112,7 +1112,7 @@  discard block
 block discarded – undo
1112 1112
 
1113 1113
             $rows = mapi_table_queryallrows($contents, array(PR_ENTRYID, PR_PARENT_ENTRYID, PR_STORE_ENTRYID), $restriction);
1114 1114
 
1115
-            if(!empty($rows)) {
1115
+            if (!empty($rows)) {
1116 1116
                 // If there are multiple, just use the first
1117 1117
                 $entryid = $rows[0][PR_ENTRYID];
1118 1118
                 $wastebasket = mapi_msgstore_openentry($store, $storeProps[PR_IPM_WASTEBASKET_ENTRYID]);
@@ -1146,7 +1146,7 @@  discard block
 block discarded – undo
1146 1146
 
1147 1147
                 $recipTable = mapi_message_getrecipienttable($this->message);
1148 1148
                 $recips = mapi_table_queryallrows($recipTable, $this->recipProps, array(RES_PROPERTY,
1149
-                                                                                        array(    RELOP => RELOP_EQ,
1149
+                                                                                        array(RELOP => RELOP_EQ,
1150 1150
                                                                                                 ULPROPTAG => PR_RECIPIENT_TYPE,
1151 1151
                                                                                                 VALUE => ($isComplete ? MAPI_BCC : MAPI_CC)
1152 1152
                                                                                         )
@@ -1157,8 +1157,8 @@  discard block
 block discarded – undo
1157 1157
                     return false;
1158 1158
                 }
1159 1159
 
1160
-                foreach($recips as $recip) {
1161
-                    $recip[PR_RECIPIENT_TYPE] = MAPI_TO;    // Change recipient type to MAPI_TO
1160
+                foreach ($recips as $recip) {
1161
+                    $recip[PR_RECIPIENT_TYPE] = MAPI_TO; // Change recipient type to MAPI_TO
1162 1162
                     mapi_message_modifyrecipients($outgoing, MODRECIP_ADD, array($recip));
1163 1163
                 }
1164 1164
                 return true;
@@ -1187,7 +1187,7 @@  discard block
 block discarded – undo
1187 1187
             $recipTable = mapi_message_getrecipienttable($message);
1188 1188
             $recipRows = mapi_table_queryallrows($recipTable, array(PR_ROWID));
1189 1189
 
1190
-            foreach($recipRows as $recipient) {
1190
+            foreach ($recipRows as $recipient) {
1191 1191
                 mapi_message_modifyrecipients($message, MODRECIP_REMOVE, array($recipient));
1192 1192
             }
1193 1193
         }
@@ -1202,7 +1202,7 @@  discard block
 block discarded – undo
1202 1202
         {
1203 1203
             $messageprops = mapi_getprops($this->message, array($this->props['taskstate']));
1204 1204
 
1205
-            if(!isset($messageprops[$this->props['taskstate']]) || $messageprops[$this->props['taskstate']] != tdsOWN) {
1205
+            if (!isset($messageprops[$this->props['taskstate']]) || $messageprops[$this->props['taskstate']] != tdsOWN) {
1206 1206
                 return false; // Can only decline assignee task
1207 1207
             }
1208 1208
 
Please login to merge, or discard this patch.
mapi/class.recurrence.php 1 patch
Spacing   +112 added lines, -112 removed lines patch added patch discarded remove patch
@@ -114,17 +114,17 @@  discard block
 block discarded – undo
114 114
             $basetime = $baseday + $this->recur["startocc"] * 60;
115 115
 
116 116
             // Remove any pre-existing exception on this base date
117
-            if($this->isException($baseday)) {
117
+            if ($this->isException($baseday)) {
118 118
                 $this->deleteException($baseday); // note that deleting an exception is different from creating a deleted exception (deleting an occurrence).
119 119
             }
120 120
 
121
-            if(!$delete) {
122
-                if(isset($exception_props[$this->proptags["startdate"]]) && !$this->isValidExceptionDate($base_date, $this->fromGMT($this->tz, $exception_props[$this->proptags["startdate"]]))) {
121
+            if (!$delete) {
122
+                if (isset($exception_props[$this->proptags["startdate"]]) && !$this->isValidExceptionDate($base_date, $this->fromGMT($this->tz, $exception_props[$this->proptags["startdate"]]))) {
123 123
                     return false;
124 124
                 }
125 125
                 // Properties in the attachment are the properties of the base object, plus $exception_props plus the base date
126 126
                 foreach (array("subject", "location", "label", "reminder", "reminder_minutes", "alldayevent", "busystatus") as $propname) {
127
-                    if(isset($this->messageprops[$this->proptags[$propname]]))
127
+                    if (isset($this->messageprops[$this->proptags[$propname]]))
128 128
                         $props[$this->proptags[$propname]] = $this->messageprops[$this->proptags[$propname]];
129 129
                 }
130 130
 
@@ -145,11 +145,11 @@  discard block
 block discarded – undo
145 145
                 }
146 146
 
147 147
                 // synchronize commonstart/commonend with startdate/duedate
148
-                if(isset($props[$this->proptags["startdate"]])) {
148
+                if (isset($props[$this->proptags["startdate"]])) {
149 149
                     $props[$this->proptags["commonstart"]] = $props[$this->proptags["startdate"]];
150 150
                 }
151 151
 
152
-                if(isset($props[$this->proptags["duedate"]])) {
152
+                if (isset($props[$this->proptags["duedate"]])) {
153 153
                     $props[$this->proptags["commonend"]] = $props[$this->proptags["duedate"]];
154 154
                 }
155 155
 
@@ -162,31 +162,31 @@  discard block
 block discarded – undo
162 162
                 $changed_item["start"] = $this->fromGMT($this->tz, $props[$this->proptags["startdate"]]);
163 163
                 $changed_item["end"] = $this->fromGMT($this->tz, $props[$this->proptags["duedate"]]);
164 164
 
165
-                if(array_key_exists($this->proptags["subject"], $exception_props)) {
165
+                if (array_key_exists($this->proptags["subject"], $exception_props)) {
166 166
                     $changed_item["subject"] = $exception_props[$this->proptags["subject"]];
167 167
                 }
168 168
 
169
-                if(array_key_exists($this->proptags["location"], $exception_props)) {
169
+                if (array_key_exists($this->proptags["location"], $exception_props)) {
170 170
                     $changed_item["location"] = $exception_props[$this->proptags["location"]];
171 171
                 }
172 172
 
173
-                if(array_key_exists($this->proptags["label"], $exception_props)) {
173
+                if (array_key_exists($this->proptags["label"], $exception_props)) {
174 174
                     $changed_item["label"] = $exception_props[$this->proptags["label"]];
175 175
                 }
176 176
 
177
-                if(array_key_exists($this->proptags["reminder"], $exception_props)) {
177
+                if (array_key_exists($this->proptags["reminder"], $exception_props)) {
178 178
                     $changed_item["reminder_set"] = $exception_props[$this->proptags["reminder"]];
179 179
                 }
180 180
 
181
-                if(array_key_exists($this->proptags["reminder_minutes"], $exception_props)) {
181
+                if (array_key_exists($this->proptags["reminder_minutes"], $exception_props)) {
182 182
                     $changed_item["remind_before"] = $exception_props[$this->proptags["reminder_minutes"]];
183 183
                 }
184 184
 
185
-                if(array_key_exists($this->proptags["alldayevent"], $exception_props)) {
185
+                if (array_key_exists($this->proptags["alldayevent"], $exception_props)) {
186 186
                     $changed_item["alldayevent"] = $exception_props[$this->proptags["alldayevent"]];
187 187
                 }
188 188
 
189
-                if(array_key_exists($this->proptags["busystatus"], $exception_props)) {
189
+                if (array_key_exists($this->proptags["busystatus"], $exception_props)) {
190 190
                     $changed_item["busystatus"] = $exception_props[$this->proptags["busystatus"]];
191 191
                 }
192 192
 
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
             }
199 199
 
200 200
             // Turn on hideattachments, because the attachments in this item are the exceptions
201
-            mapi_setprops($this->message, array ( $this->proptags["hideattachments"] => true ));
201
+            mapi_setprops($this->message, array($this->proptags["hideattachments"] => true));
202 202
 
203 203
             // Save recurrence data to message
204 204
             $this->saveRecurrence();
@@ -212,74 +212,74 @@  discard block
 block discarded – undo
212 212
          */
213 213
         function modifyException($exception_props, $base_date, $exception_recips = array(), $copy_attach_from = false)
214 214
         {
215
-            if(isset($exception_props[$this->proptags["startdate"]]) && !$this->isValidExceptionDate($base_date, $this->fromGMT($this->tz, $exception_props[$this->proptags["startdate"]]))) {
215
+            if (isset($exception_props[$this->proptags["startdate"]]) && !$this->isValidExceptionDate($base_date, $this->fromGMT($this->tz, $exception_props[$this->proptags["startdate"]]))) {
216 216
                 return false;
217 217
             }
218 218
 
219 219
             $baseday = $this->dayStartOf($base_date);
220 220
             $extomodify = false;
221 221
 
222
-            for($i = 0, $len = count($this->recur["changed_occurences"]); $i < $len; $i++) {
223
-                if($this->isSameDay($this->recur["changed_occurences"][$i]["basedate"], $baseday))
222
+            for ($i = 0, $len = count($this->recur["changed_occurences"]); $i < $len; $i++) {
223
+                if ($this->isSameDay($this->recur["changed_occurences"][$i]["basedate"], $baseday))
224 224
                     $extomodify = &$this->recur["changed_occurences"][$i];
225 225
             }
226 226
 
227
-            if(!$extomodify)
227
+            if (!$extomodify)
228 228
                 return false;
229 229
 
230 230
             // remove basedate property as we want to preserve the old value
231 231
             // client will send basedate with time part as zero, so discard that value
232 232
             unset($exception_props[$this->proptags["basedate"]]);
233 233
 
234
-            if(array_key_exists($this->proptags["startdate"], $exception_props)) {
234
+            if (array_key_exists($this->proptags["startdate"], $exception_props)) {
235 235
                 $extomodify["start"] = $this->fromGMT($this->tz, $exception_props[$this->proptags["startdate"]]);
236 236
             }
237 237
 
238
-            if(array_key_exists($this->proptags["duedate"], $exception_props)) {
239
-                $extomodify["end"] =   $this->fromGMT($this->tz, $exception_props[$this->proptags["duedate"]]);
238
+            if (array_key_exists($this->proptags["duedate"], $exception_props)) {
239
+                $extomodify["end"] = $this->fromGMT($this->tz, $exception_props[$this->proptags["duedate"]]);
240 240
             }
241 241
 
242
-            if(array_key_exists($this->proptags["subject"], $exception_props)) {
242
+            if (array_key_exists($this->proptags["subject"], $exception_props)) {
243 243
                 $extomodify["subject"] = $exception_props[$this->proptags["subject"]];
244 244
             }
245 245
 
246
-            if(array_key_exists($this->proptags["location"], $exception_props)) {
246
+            if (array_key_exists($this->proptags["location"], $exception_props)) {
247 247
                 $extomodify["location"] = $exception_props[$this->proptags["location"]];
248 248
             }
249 249
 
250
-            if(array_key_exists($this->proptags["label"], $exception_props)) {
250
+            if (array_key_exists($this->proptags["label"], $exception_props)) {
251 251
                 $extomodify["label"] = $exception_props[$this->proptags["label"]];
252 252
             }
253 253
 
254
-            if(array_key_exists($this->proptags["reminder"], $exception_props)) {
254
+            if (array_key_exists($this->proptags["reminder"], $exception_props)) {
255 255
                 $extomodify["reminder_set"] = $exception_props[$this->proptags["reminder"]];
256 256
             }
257 257
 
258
-            if(array_key_exists($this->proptags["reminder_minutes"], $exception_props)) {
258
+            if (array_key_exists($this->proptags["reminder_minutes"], $exception_props)) {
259 259
                 $extomodify["remind_before"] = $exception_props[$this->proptags["reminder_minutes"]];
260 260
             }
261 261
 
262
-            if(array_key_exists($this->proptags["alldayevent"], $exception_props)) {
262
+            if (array_key_exists($this->proptags["alldayevent"], $exception_props)) {
263 263
                 $extomodify["alldayevent"] = $exception_props[$this->proptags["alldayevent"]];
264 264
             }
265 265
 
266
-            if(array_key_exists($this->proptags["busystatus"], $exception_props)) {
266
+            if (array_key_exists($this->proptags["busystatus"], $exception_props)) {
267 267
                 $extomodify["busystatus"] = $exception_props[$this->proptags["busystatus"]];
268 268
             }
269 269
 
270 270
             $exception_props[PR_MESSAGE_CLASS] = "IPM.OLE.CLASS.{00061055-0000-0000-C000-000000000046}";
271 271
 
272 272
             // synchronize commonstart/commonend with startdate/duedate
273
-            if(isset($exception_props[$this->proptags["startdate"]])) {
273
+            if (isset($exception_props[$this->proptags["startdate"]])) {
274 274
                 $exception_props[$this->proptags["commonstart"]] = $exception_props[$this->proptags["startdate"]];
275 275
             }
276 276
 
277
-            if(isset($exception_props[$this->proptags["duedate"]])) {
277
+            if (isset($exception_props[$this->proptags["duedate"]])) {
278 278
                 $exception_props[$this->proptags["commonend"]] = $exception_props[$this->proptags["duedate"]];
279 279
             }
280 280
 
281 281
             $attach = $this->getExceptionAttachment($baseday);
282
-            if(!$attach) {
282
+            if (!$attach) {
283 283
                 if ($copy_attach_from) {
284 284
                     $this->deleteExceptionAttachment($base_date);
285 285
                     $this->createException($exception_props, $base_date, false, $exception_recips, $copy_attach_from);
@@ -326,7 +326,7 @@  discard block
 block discarded – undo
326 326
             // The way we do this is to look at the days that we're 'moving' the item in the exception. Each
327 327
             // of these days may only contain the item that we're modifying. Any other item violates the rules.
328 328
 
329
-            if($this->isException($basedate)) {
329
+            if ($this->isException($basedate)) {
330 330
                 // If we're modifying an exception, we want to look at the days that we're 'moving' compared to where
331 331
                 // the exception used to be.
332 332
                 $oldexception = $this->getChangeException($basedate);
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
             $startday = $this->dayStartOf($start);
340 340
 
341 341
             // Get all the occurrences on the days between the basedate (may be reversed)
342
-            if($prevday < $startday)
342
+            if ($prevday < $startday)
343 343
                 $items = $this->getItems($this->toGMT($this->tz, $prevday), $this->toGMT($this->tz, $startday + 24 * 60 * 60));
344 344
             else
345 345
                 $items = $this->getItems($this->toGMT($this->tz, $startday), $this->toGMT($this->tz, $prevday + 24 * 60 * 60));
@@ -366,12 +366,12 @@  discard block
 block discarded – undo
366 366
             // get all occurence items before the seleceted items occurence starttime
367 367
             $occitems = $this->getItems($this->messageprops[$this->proptags["startdate"]], $this->toGMT($this->tz, $basedate));
368 368
 
369
-            if(!empty($occitems)) {
369
+            if (!empty($occitems)) {
370 370
                 // as occitems array is sorted in ascending order of startdate, to get the previous occurence we take the last items in occitems .
371 371
                 $previousitem_startdate = $occitems[count($occitems) - 1][$this->proptags["startdate"]];
372 372
 
373 373
                 // if our reminder is set before or equal to the beginning of the previous occurrence, then that's not allowed
374
-                if($startdate - ($reminderminutes*60) <= $previousitem_startdate)
374
+                if ($startdate - ($reminderminutes * 60) <= $previousitem_startdate)
375 375
                     return false;
376 376
             }
377 377
 
@@ -380,12 +380,12 @@  discard block
 block discarded – undo
380 380
 
381 381
             // If there are another two occurrences, then the first is the current occurrence, and the one after that
382 382
             // is the next occurrence.
383
-            if(count($currentOcc) > 1) {
383
+            if (count($currentOcc) > 1) {
384 384
                 $next = $currentOcc[1];
385 385
                 // Get reminder time of the next occurrence.
386 386
                 $nextOccReminderTime = $next[$this->proptags["startdate"]] - ($next[$this->proptags["reminder_minutes"]] * 60);
387 387
                 // If the reminder time of the next item is before the start of this item, then that's not allowed
388
-                if($nextOccReminderTime <= $startdate)
388
+                if ($nextOccReminderTime <= $startdate)
389 389
                     return false;
390 390
             }
391 391
 
@@ -396,15 +396,15 @@  discard block
 block discarded – undo
396 396
         function setRecurrence($tz, $recur)
397 397
         {
398 398
             // only reset timezone if specified
399
-            if($tz)
399
+            if ($tz)
400 400
                 $this->tz = $tz;
401 401
 
402 402
             $this->recur = $recur;
403 403
 
404
-            if(!isset($this->recur["changed_occurences"]))
404
+            if (!isset($this->recur["changed_occurences"]))
405 405
                 $this->recur["changed_occurences"] = Array();
406 406
 
407
-            if(!isset($this->recur["deleted_occurences"]))
407
+            if (!isset($this->recur["deleted_occurences"]))
408 408
                 $this->recur["deleted_occurences"] = Array();
409 409
 
410 410
             $this->deleteAttachments();
@@ -412,29 +412,29 @@  discard block
 block discarded – undo
412 412
 
413 413
             // if client has not set the recurring_pattern then we should generate it and save it
414 414
             $messageProps = mapi_getprops($this->message, Array($this->proptags["recurring_pattern"]));
415
-            if(empty($messageProps[$this->proptags["recurring_pattern"]])) {
415
+            if (empty($messageProps[$this->proptags["recurring_pattern"]])) {
416 416
                 $this->saveRecurrencePattern();
417 417
             }
418 418
         }
419 419
 
420 420
         // Returns the start or end time of the occurrence on the given base date.
421 421
         // This assumes that the basedate you supply is in LOCAL time
422
-        function getOccurrenceStart($basedate)  {
422
+        function getOccurrenceStart($basedate) {
423 423
             $daystart = $this->dayStartOf($basedate);
424 424
             return $this->toGMT($this->tz, $daystart + $this->recur["startocc"] * 60);
425 425
         }
426 426
 
427
-        function getOccurrenceEnd($basedate)  {
427
+        function getOccurrenceEnd($basedate) {
428 428
             $daystart = $this->dayStartOf($basedate);
429 429
             return $this->toGMT($this->tz, $daystart + $this->recur["endocc"] * 60);
430 430
         }
431 431
 
432 432
 
433 433
         // Backwards compatible code
434
-        function getOccurenceStart($basedate)  {
434
+        function getOccurenceStart($basedate) {
435 435
             return $this->getOccurrenceStart($basedate);
436 436
         }
437
-        function getOccurenceEnd($basedate)  {
437
+        function getOccurenceEnd($basedate) {
438 438
             return $this->getOccurrenceEnd($basedate);
439 439
         }
440 440
 
@@ -464,13 +464,13 @@  discard block
 block discarded – undo
464 464
              * On the first occurence of greater nextreminder break the loop
465 465
              * and return the value to calling function.
466 466
              */
467
-            for($i = 0, $len = count($items); $i < $len; $i++)
467
+            for ($i = 0, $len = count($items); $i < $len; $i++)
468 468
             {
469 469
                 $item = $items[$i];
470
-                $tempnextreminder = $item[$this->proptags["startdate"]] - ( $item[$this->proptags["reminder_minutes"]] * 60 );
470
+                $tempnextreminder = $item[$this->proptags["startdate"]] - ($item[$this->proptags["reminder_minutes"]] * 60);
471 471
 
472 472
                 // If tempnextreminder is greater than timestamp then save it in nextreminder and break from the loop.
473
-                if($tempnextreminder > $timestamp)
473
+                if ($tempnextreminder > $timestamp)
474 474
                 {
475 475
                     $nextreminder = $tempnextreminder;
476 476
                     break;
@@ -575,8 +575,8 @@  discard block
 block discarded – undo
575 575
             }
576 576
 
577 577
             // get timings of the first occurence
578
-            $firstoccstartdate = isset($startocc) ? $start + (((int) $startocc) * 60) : $start;
579
-            $firstoccenddate = isset($endocc) ? $end + (((int) $endocc) * 60) : $end;
578
+            $firstoccstartdate = isset($startocc) ? $start + (((int)$startocc) * 60) : $start;
579
+            $firstoccenddate = isset($endocc) ? $end + (((int)$endocc) * 60) : $end;
580 580
 
581 581
             $start = gmdate(_('d-m-Y'), $firstoccstartdate);
582 582
             $end = gmdate(_('d-m-Y'), $firstoccenddate);
@@ -641,8 +641,8 @@  discard block
 block discarded – undo
641 641
                 }
642 642
             }
643 643
 
644
-            if(!empty($pattern)) {
645
-                mapi_setprops($this->message, Array($this->proptags["recurring_pattern"] => $pattern ));
644
+            if (!empty($pattern)) {
645
+                mapi_setprops($this->message, Array($this->proptags["recurring_pattern"] => $pattern));
646 646
             }
647 647
         }
648 648
 
@@ -656,16 +656,16 @@  discard block
 block discarded – undo
656 656
             // Remove all items in $todelete from deleted_occurences
657 657
             $new = Array();
658 658
 
659
-            foreach($this->recur["deleted_occurences"] as $entry) {
660
-                if($entry != $base_date)
659
+            foreach ($this->recur["deleted_occurences"] as $entry) {
660
+                if ($entry != $base_date)
661 661
                     $new[] = $entry;
662 662
             }
663 663
             $this->recur["deleted_occurences"] = $new;
664 664
 
665 665
             $new = Array();
666 666
 
667
-            foreach($this->recur["changed_occurences"] as $entry) {
668
-                if(!$this->isSameDay($entry["basedate"], $base_date))
667
+            foreach ($this->recur["changed_occurences"] as $entry) {
668
+                if (!$this->isSameDay($entry["basedate"], $base_date))
669 669
                     $new[] = $entry;
670 670
                 else
671 671
                     $this->deleteExceptionAttachment($this->toGMT($this->tz, $base_date + $this->recur["startocc"] * 60));
@@ -696,15 +696,15 @@  discard block
 block discarded – undo
696 696
               $props[PR_EXCEPTION_ENDTIME] = $this->fromGMT($this->tz, $exception_props[$this->proptags["duedate"]]);
697 697
               mapi_setprops($attachment, $props);
698 698
 
699
-            $imessage = mapi_attach_openobj($attachment, MAPI_CREATE | MAPI_MODIFY);
699
+            $imessage = mapi_attach_openobj($attachment, MAPI_CREATE|MAPI_MODIFY);
700 700
 
701 701
             if ($copy_attach_from) {
702 702
                 $attachmentTable = mapi_message_getattachmenttable($copy_attach_from);
703
-                if($attachmentTable) {
703
+                if ($attachmentTable) {
704 704
                     $attachments = mapi_table_queryallrows($attachmentTable, array(PR_ATTACH_NUM, PR_ATTACH_SIZE, PR_ATTACH_LONG_FILENAME, PR_ATTACHMENT_HIDDEN, PR_DISPLAY_NAME, PR_ATTACH_METHOD));
705 705
 
706
-                    foreach($attachments as $attach_props){
707
-                        $attach_old = mapi_message_openattach($copy_attach_from, (int) $attach_props[PR_ATTACH_NUM]);
706
+                    foreach ($attachments as $attach_props) {
707
+                        $attach_old = mapi_message_openattach($copy_attach_from, (int)$attach_props[PR_ATTACH_NUM]);
708 708
                         $attach_newResourceMsg = mapi_message_createattach($imessage);
709 709
                         mapi_copyto($attach_old, array(), array(), $attach_newResourceMsg, 0);
710 710
                         mapi_savechanges($attach_newResourceMsg);
@@ -718,8 +718,8 @@  discard block
 block discarded – undo
718 718
             // of an exception. This is only a quickfix as it is not yet possible
719 719
             // to change an existing exception.
720 720
             // remove mv properties when needed
721
-            foreach($props as $propTag=>$propVal){
722
-                if ((mapi_prop_type($propTag) & MV_FLAG) == MV_FLAG && is_null($propVal)){
721
+            foreach ($props as $propTag=>$propVal) {
722
+                if ((mapi_prop_type($propTag) & MV_FLAG) == MV_FLAG && is_null($propVal)) {
723 723
                     unset($props[$propTag]);
724 724
                 }
725 725
             }
@@ -743,14 +743,14 @@  discard block
 block discarded – undo
743 743
             $attachments = mapi_message_getattachmenttable($this->message);
744 744
             $attachTable = mapi_table_queryallrows($attachments, Array(PR_ATTACH_NUM));
745 745
 
746
-            foreach($attachTable as $attachRow)
746
+            foreach ($attachTable as $attachRow)
747 747
             {
748 748
                 $tempattach = mapi_message_openattach($this->message, $attachRow[PR_ATTACH_NUM]);
749 749
                 $exception = mapi_attach_openobj($tempattach);
750 750
 
751 751
                   $data = mapi_message_getprops($exception, array($this->proptags["basedate"]));
752 752
 
753
-                  if($this->dayStartOf($this->fromGMT($this->tz, $data[$this->proptags["basedate"]])) == $this->dayStartOf($base_date)) {
753
+                  if ($this->dayStartOf($this->fromGMT($this->tz, $data[$this->proptags["basedate"]])) == $this->dayStartOf($base_date)) {
754 754
                       mapi_message_deleteattach($this->message, $attachRow[PR_ATTACH_NUM]);
755 755
                   }
756 756
             }
@@ -764,9 +764,9 @@  discard block
 block discarded – undo
764 764
             $attachments = mapi_message_getattachmenttable($this->message);
765 765
             $attachTable = mapi_table_queryallrows($attachments, Array(PR_ATTACH_NUM, PR_ATTACHMENT_HIDDEN));
766 766
 
767
-            foreach($attachTable as $attachRow)
767
+            foreach ($attachTable as $attachRow)
768 768
             {
769
-                if(isset($attachRow[PR_ATTACHMENT_HIDDEN]) && $attachRow[PR_ATTACHMENT_HIDDEN]) {
769
+                if (isset($attachRow[PR_ATTACHMENT_HIDDEN]) && $attachRow[PR_ATTACHMENT_HIDDEN]) {
770 770
                     mapi_message_deleteattach($this->message, $attachRow[PR_ATTACH_NUM]);
771 771
                 }
772 772
             }
@@ -792,21 +792,21 @@  discard block
 block discarded – undo
792 792
             $attachments = mapi_message_getattachmenttable($this->message);
793 793
             $attachRows = mapi_table_queryallrows($attachments, Array(PR_ATTACH_NUM), $attach_res);
794 794
 
795
-            if(is_array($attachRows)) {
796
-                foreach($attachRows as $attachRow)
795
+            if (is_array($attachRows)) {
796
+                foreach ($attachRows as $attachRow)
797 797
                 {
798 798
                     $tempattach = mapi_message_openattach($this->message, $attachRow[PR_ATTACH_NUM]);
799 799
                     $exception = mapi_attach_openobj($tempattach);
800 800
 
801 801
                     $data = mapi_message_getprops($exception, array($this->proptags["basedate"]));
802 802
 
803
-                    if(!isset($data[$this->proptags["basedate"]])) {
803
+                    if (!isset($data[$this->proptags["basedate"]])) {
804 804
                         // if no basedate found then it could be embedded message so ignore it
805 805
                         // we need proper restriction to exclude embedded messages as well
806 806
                         continue;
807 807
                     }
808 808
 
809
-                    if($this->isSameDay($this->fromGMT($this->tz, $data[$this->proptags["basedate"]]), $base_date)) {
809
+                    if ($this->isSameDay($this->fromGMT($this->tz, $data[$this->proptags["basedate"]]), $base_date)) {
810 810
                         return $tempattach;
811 811
                     }
812 812
                 }
@@ -831,9 +831,9 @@  discard block
 block discarded – undo
831 831
         function processOccurrenceItem(&$items, $start, $end, $basedate, $startocc, $endocc, $tz, $reminderonly)
832 832
         {
833 833
             $exception = $this->isException($basedate);
834
-            if($exception){
834
+            if ($exception) {
835 835
                 return false;
836
-            }else{
836
+            } else {
837 837
                 $occstart = $basedate + $startocc * 60;
838 838
                 $occend = $basedate + $endocc * 60;
839 839
 
@@ -849,7 +849,7 @@  discard block
 block discarded – undo
849 849
                  * starts at 00:00 and ends on 00:00. if it is so, then process
850 850
                  * the occurrence and send it in response.
851 851
                  */
852
-                if(($occstart  >= $end || $occend <=  $start) && !($occstart == $occend && $occstart == $start))
852
+                if (($occstart >= $end || $occend <= $start) && !($occstart == $occend && $occstart == $start))
853 853
                     return;
854 854
 
855 855
                 // Properties for this occurrence are the same as the main object,
@@ -863,7 +863,7 @@  discard block
 block discarded – undo
863 863
             }
864 864
 
865 865
             // If reminderonly is set, only add reminders
866
-            if($reminderonly && (!isset($newitem[$this->proptags["reminder"]]) || $newitem[$this->proptags["reminder"]] == false))
866
+            if ($reminderonly && (!isset($newitem[$this->proptags["reminder"]]) || $newitem[$this->proptags["reminder"]] == false))
867 867
                 return;
868 868
 
869 869
             $items[] = $newitem;
@@ -878,7 +878,7 @@  discard block
 block discarded – undo
878 878
         function processExceptionItems(&$items, $start, $end)
879 879
         {
880 880
             $limit = 0;
881
-            foreach($this->recur["changed_occurences"] as $exception) {
881
+            foreach ($this->recur["changed_occurences"] as $exception) {
882 882
 
883 883
                 // Convert to GMT
884 884
                 $occstart = $this->toGMT($this->tz, $exception["start"]);
@@ -886,11 +886,11 @@  discard block
 block discarded – undo
886 886
 
887 887
                 // Check range criterium. Exact matches (eg when $occstart == $end), do NOT match since you cannot
888 888
                 // see any part of the appointment. Partial overlaps DO match.
889
-                if($occstart >= $end || $occend <= $start)
889
+                if ($occstart >= $end || $occend <= $start)
890 890
                     continue;
891 891
 
892 892
                 array_push($items, $this->getExceptionProperties($exception));
893
-                if((count($items) == $limit))
893
+                if ((count($items) == $limit))
894 894
                     break;
895 895
                 }
896 896
         }
@@ -902,10 +902,10 @@  discard block
 block discarded – undo
902 902
          */
903 903
         function isException($basedate)
904 904
         {
905
-            if($this->isDeleteException($basedate))
905
+            if ($this->isDeleteException($basedate))
906 906
                 return true;
907 907
 
908
-            if($this->getChangeException($basedate) != false)
908
+            if ($this->getChangeException($basedate) != false)
909 909
                 return true;
910 910
 
911 911
             return false;
@@ -917,9 +917,9 @@  discard block
 block discarded – undo
917 917
         function isDeleteException($basedate)
918 918
         {
919 919
             // Check if the occurrence is deleted on the specified date
920
-            foreach($this->recur["deleted_occurences"] as $deleted)
920
+            foreach ($this->recur["deleted_occurences"] as $deleted)
921 921
             {
922
-                if($this->isSameDay($deleted, $basedate))
922
+                if ($this->isSameDay($deleted, $basedate))
923 923
                     return true;
924 924
             }
925 925
 
@@ -932,9 +932,9 @@  discard block
 block discarded – undo
932 932
         function getChangeException($basedate)
933 933
         {
934 934
             // Check if the occurrence is modified on the specified date
935
-            foreach($this->recur["changed_occurences"] as $changed)
935
+            foreach ($this->recur["changed_occurences"] as $changed)
936 936
             {
937
-                if($this->isSameDay($changed["basedate"], $basedate))
937
+                if ($this->isSameDay($changed["basedate"], $basedate))
938 938
                     return $changed;
939 939
             }
940 940
 
@@ -975,31 +975,31 @@  discard block
 block discarded – undo
975 975
             $item[$this->proptags["commonstart"]] = $item[$this->proptags["startdate"]];
976 976
             $item[$this->proptags["commonend"]] = $item[$this->proptags["duedate"]];
977 977
 
978
-            if(isset($exception["subject"])) {
978
+            if (isset($exception["subject"])) {
979 979
                 $item[$this->proptags["subject"]] = $exception["subject"];
980 980
             }
981 981
 
982
-            if(isset($exception["label"])) {
982
+            if (isset($exception["label"])) {
983 983
                 $item[$this->proptags["label"]] = $exception["label"];
984 984
             }
985 985
 
986
-            if(isset($exception["alldayevent"])) {
986
+            if (isset($exception["alldayevent"])) {
987 987
                 $item[$this->proptags["alldayevent"]] = $exception["alldayevent"];
988 988
             }
989 989
 
990
-            if(isset($exception["location"])) {
990
+            if (isset($exception["location"])) {
991 991
                 $item[$this->proptags["location"]] = $exception["location"];
992 992
             }
993 993
 
994
-            if(isset($exception["remind_before"])) {
994
+            if (isset($exception["remind_before"])) {
995 995
                 $item[$this->proptags["reminder_minutes"]] = $exception["remind_before"];
996 996
             }
997 997
 
998
-            if(isset($exception["reminder_set"])) {
998
+            if (isset($exception["reminder_set"])) {
999 999
                 $item[$this->proptags["reminder"]] = $exception["reminder_set"];
1000 1000
             }
1001 1001
 
1002
-            if(isset($exception["busystatus"])) {
1002
+            if (isset($exception["busystatus"])) {
1003 1003
                 $item[$this->proptags["busystatus"]] = $exception["busystatus"];
1004 1004
             }
1005 1005
 
@@ -1057,19 +1057,19 @@  discard block
 block discarded – undo
1057 1057
 
1058 1058
             // Add organizer to meeting only if it is not organized.
1059 1059
             $msgprops = mapi_getprops($exception, array(PR_SENT_REPRESENTING_ENTRYID, PR_SENT_REPRESENTING_EMAIL_ADDRESS, PR_SENT_REPRESENTING_NAME, PR_SENT_REPRESENTING_ADDRTYPE, PR_SENT_REPRESENTING_SEARCH_KEY, $this->proptags['responsestatus']));
1060
-            if (isset($msgprops[$this->proptags['responsestatus']]) && $msgprops[$this->proptags['responsestatus']] != olResponseOrganized){
1060
+            if (isset($msgprops[$this->proptags['responsestatus']]) && $msgprops[$this->proptags['responsestatus']] != olResponseOrganized) {
1061 1061
                 $this->addOrganizer($msgprops, $exception_recips['add']);
1062 1062
             }
1063 1063
 
1064 1064
             // Remove all deleted recipients
1065 1065
             if (isset($exception_recips['remove'])) {
1066 1066
                 foreach ($exception_recips['remove'] as &$recip) {
1067
-                    if (!isset($recip[PR_RECIPIENT_FLAGS]) || $recip[PR_RECIPIENT_FLAGS] != (recipReserved | recipExceptionalDeleted | recipSendable)) {
1068
-                        $recip[PR_RECIPIENT_FLAGS] = recipSendable | recipExceptionalDeleted;
1067
+                    if (!isset($recip[PR_RECIPIENT_FLAGS]) || $recip[PR_RECIPIENT_FLAGS] != (recipReserved|recipExceptionalDeleted|recipSendable)) {
1068
+                        $recip[PR_RECIPIENT_FLAGS] = recipSendable|recipExceptionalDeleted;
1069 1069
                     } else {
1070
-                        $recip[PR_RECIPIENT_FLAGS] = recipReserved | recipExceptionalDeleted | recipSendable;
1070
+                        $recip[PR_RECIPIENT_FLAGS] = recipReserved|recipExceptionalDeleted|recipSendable;
1071 1071
                     }
1072
-                    $recip[PR_RECIPIENT_TRACKSTATUS] = olResponseNone;        // No Response required
1072
+                    $recip[PR_RECIPIENT_TRACKSTATUS] = olResponseNone; // No Response required
1073 1073
                 }
1074 1074
                 unset($recip);
1075 1075
                 mapi_message_modifyrecipients($exception, MODRECIP_MODIFY, $exception_recips['remove']);
@@ -1112,14 +1112,14 @@  discard block
 block discarded – undo
1112 1112
 
1113 1113
             // Add organizer to meeting only if it is not organized.
1114 1114
             $msgprops = mapi_getprops($message, array(PR_SENT_REPRESENTING_ENTRYID, PR_SENT_REPRESENTING_EMAIL_ADDRESS, PR_SENT_REPRESENTING_NAME, PR_SENT_REPRESENTING_ADDRTYPE, PR_SENT_REPRESENTING_SEARCH_KEY, $this->proptags['responsestatus']));
1115
-            if (isset($msgprops[$this->proptags['responsestatus']]) && $msgprops[$this->proptags['responsestatus']] != olResponseOrganized){
1115
+            if (isset($msgprops[$this->proptags['responsestatus']]) && $msgprops[$this->proptags['responsestatus']] != olResponseOrganized) {
1116 1116
                 $this->addOrganizer($msgprops, $exception_recips);
1117 1117
             }
1118 1118
 
1119 1119
             if (!empty($exception_recips)) {
1120
-                foreach($recipientRows as $key => $recipient) {
1120
+                foreach ($recipientRows as $key => $recipient) {
1121 1121
                     $found = false;
1122
-                    foreach($exception_recips as $excep_recip) {
1122
+                    foreach ($exception_recips as $excep_recip) {
1123 1123
                         if (isset($recipient[PR_SEARCH_KEY], $excep_recip[PR_SEARCH_KEY]) && $recipient[PR_SEARCH_KEY] == $excep_recip[PR_SEARCH_KEY])
1124 1124
                             $found = true;
1125 1125
                     }
@@ -1128,8 +1128,8 @@  discard block
 block discarded – undo
1128 1128
                        $foundInDeletedRecipients = false;
1129 1129
                        // Look if the $recipient is in the list of deleted recipients
1130 1130
                        if (!empty($deletedRecipients)) {
1131
-                               foreach($deletedRecipients as $recip) {
1132
-                                   if ($recip[PR_SEARCH_KEY] == $recipient[PR_SEARCH_KEY]){
1131
+                               foreach ($deletedRecipients as $recip) {
1132
+                                   if ($recip[PR_SEARCH_KEY] == $recipient[PR_SEARCH_KEY]) {
1133 1133
                                        $foundInDeletedRecipients = true;
1134 1134
                                        break;
1135 1135
                                    }
@@ -1138,12 +1138,12 @@  discard block
 block discarded – undo
1138 1138
 
1139 1139
                        // If recipient is not in list of deleted recipient, add him
1140 1140
                        if (!$foundInDeletedRecipients) {
1141
-                            if (!isset($recipient[PR_RECIPIENT_FLAGS]) || $recipient[PR_RECIPIENT_FLAGS] != (recipReserved | recipExceptionalDeleted | recipSendable)) {
1142
-                                $recipient[PR_RECIPIENT_FLAGS] = recipSendable | recipExceptionalDeleted;
1141
+                            if (!isset($recipient[PR_RECIPIENT_FLAGS]) || $recipient[PR_RECIPIENT_FLAGS] != (recipReserved|recipExceptionalDeleted|recipSendable)) {
1142
+                                $recipient[PR_RECIPIENT_FLAGS] = recipSendable|recipExceptionalDeleted;
1143 1143
                             } else {
1144
-                                $recipient[PR_RECIPIENT_FLAGS] = recipReserved | recipExceptionalDeleted | recipSendable;
1144
+                                $recipient[PR_RECIPIENT_FLAGS] = recipReserved|recipExceptionalDeleted|recipSendable;
1145 1145
                             }
1146
-                            $recipient[PR_RECIPIENT_TRACKSTATUS] = olRecipientTrackStatusNone;    // No Response required
1146
+                            $recipient[PR_RECIPIENT_TRACKSTATUS] = olRecipientTrackStatusNone; // No Response required
1147 1147
                             $deletedRecipients[] = $recipient;
1148 1148
                         }
1149 1149
                     }
@@ -1180,7 +1180,7 @@  discard block
 block discarded – undo
1180 1180
             $result = false;
1181 1181
             if (!empty($this->recur["changed_occurences"])) {
1182 1182
                 $result = array();
1183
-                foreach($this->recur["changed_occurences"] as $exception) {
1183
+                foreach ($this->recur["changed_occurences"] as $exception) {
1184 1184
                     $result[] = $exception["basedate"];
1185 1185
                 }
1186 1186
                 return $result;
@@ -1200,16 +1200,16 @@  discard block
 block discarded – undo
1200 1200
         {
1201 1201
             $hasOrganizer = false;
1202 1202
             // Check if meeting already has an organizer.
1203
-            foreach ($recipients as $key => $recipient){
1204
-                if (isset($recipient[PR_RECIPIENT_FLAGS]) && $recipient[PR_RECIPIENT_FLAGS] == (recipSendable | recipOrganizer)) {
1203
+            foreach ($recipients as $key => $recipient) {
1204
+                if (isset($recipient[PR_RECIPIENT_FLAGS]) && $recipient[PR_RECIPIENT_FLAGS] == (recipSendable|recipOrganizer)) {
1205 1205
                     $hasOrganizer = true;
1206
-                } else if ($isException && !isset($recipient[PR_RECIPIENT_FLAGS])){
1206
+                } else if ($isException && !isset($recipient[PR_RECIPIENT_FLAGS])) {
1207 1207
                     // Recipients for an occurrence
1208
-                    $recipients[$key][PR_RECIPIENT_FLAGS] = recipSendable | recipExceptionalResponse;
1208
+                    $recipients[$key][PR_RECIPIENT_FLAGS] = recipSendable|recipExceptionalResponse;
1209 1209
                 }
1210 1210
             }
1211 1211
 
1212
-            if (!$hasOrganizer){
1212
+            if (!$hasOrganizer) {
1213 1213
                 // Create organizer.
1214 1214
                 $organizer = array();
1215 1215
                 $organizer[PR_ENTRYID] = $messageProps[PR_SENT_REPRESENTING_ENTRYID];
@@ -1217,9 +1217,9 @@  discard block
 block discarded – undo
1217 1217
                 $organizer[PR_EMAIL_ADDRESS] = $messageProps[PR_SENT_REPRESENTING_EMAIL_ADDRESS];
1218 1218
                 $organizer[PR_RECIPIENT_TYPE] = MAPI_TO;
1219 1219
                 $organizer[PR_RECIPIENT_DISPLAY_NAME] = $messageProps[PR_SENT_REPRESENTING_NAME];
1220
-                $organizer[PR_ADDRTYPE] = empty($messageProps[PR_SENT_REPRESENTING_ADDRTYPE])?'SMTP':$messageProps[PR_SENT_REPRESENTING_ADDRTYPE];
1220
+                $organizer[PR_ADDRTYPE] = empty($messageProps[PR_SENT_REPRESENTING_ADDRTYPE]) ? 'SMTP' : $messageProps[PR_SENT_REPRESENTING_ADDRTYPE];
1221 1221
                 $organizer[PR_RECIPIENT_TRACKSTATUS] = olRecipientTrackStatusNone;
1222
-                $organizer[PR_RECIPIENT_FLAGS] = recipSendable | recipOrganizer;
1222
+                $organizer[PR_RECIPIENT_FLAGS] = recipSendable|recipOrganizer;
1223 1223
                 $organizer[PR_SEARCH_KEY] = $messageProps[PR_SENT_REPRESENTING_SEARCH_KEY];
1224 1224
 
1225 1225
                 // Add organizer to recipients list.
Please login to merge, or discard this patch.
mapi/mapiguid.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -5,30 +5,30 @@
 block discarded – undo
5 5
  * SPDX-FileCopyrightText: Copyright 2020-2022 grommunio GmbH
6 6
  */
7 7
 
8
-define('IID_IStream',                           makeguid("{0000000c-0000-0000-c000-000000000046}"));
9
-define('IID_IMAPITable',                        makeguid("{00020301-0000-0000-c000-000000000046}"));
10
-define('IID_IMessage',                          makeguid("{00020307-0000-0000-c000-000000000046}"));
11
-define('IID_IExchangeExportChanges',            makeguid("{a3ea9cc0-d1b2-11cd-80fc-00aa004bba0b}"));
12
-define('IID_IExchangeImportContentsChanges',    makeguid("{f75abfa0-d0e0-11cd-80fc-00aa004bba0b}"));
13
-define('IID_IExchangeImportHierarchyChanges',   makeguid("{85a66cf0-d0e0-11cd-80fc-00aa004bba0b}"));
8
+define('IID_IStream', makeguid("{0000000c-0000-0000-c000-000000000046}"));
9
+define('IID_IMAPITable', makeguid("{00020301-0000-0000-c000-000000000046}"));
10
+define('IID_IMessage', makeguid("{00020307-0000-0000-c000-000000000046}"));
11
+define('IID_IExchangeExportChanges', makeguid("{a3ea9cc0-d1b2-11cd-80fc-00aa004bba0b}"));
12
+define('IID_IExchangeImportContentsChanges', makeguid("{f75abfa0-d0e0-11cd-80fc-00aa004bba0b}"));
13
+define('IID_IExchangeImportHierarchyChanges', makeguid("{85a66cf0-d0e0-11cd-80fc-00aa004bba0b}"));
14 14
 
15
-define('PSETID_Appointment',                    makeguid("{00062002-0000-0000-C000-000000000046}"));
16
-define('PSETID_Task',                           makeguid("{00062003-0000-0000-C000-000000000046}"));
17
-define('PSETID_Address',                        makeguid("{00062004-0000-0000-C000-000000000046}"));
18
-define('PSETID_Common',                         makeguid("{00062008-0000-0000-C000-000000000046}"));
19
-define('PSETID_Log',                            makeguid("{0006200A-0000-0000-C000-000000000046}"));
20
-define('PSETID_Note',                           makeguid("{0006200E-0000-0000-C000-000000000046}"));
21
-define('PSETID_Meeting',                        makeguid("{6ED8DA90-450B-101B-98DA-00AA003F1305}"));
22
-define('PSETID_Archive',                        makeguid("{72E98EBC-57D2-4AB5-B0AA-D50A7B531CB9}"));
15
+define('PSETID_Appointment', makeguid("{00062002-0000-0000-C000-000000000046}"));
16
+define('PSETID_Task', makeguid("{00062003-0000-0000-C000-000000000046}"));
17
+define('PSETID_Address', makeguid("{00062004-0000-0000-C000-000000000046}"));
18
+define('PSETID_Common', makeguid("{00062008-0000-0000-C000-000000000046}"));
19
+define('PSETID_Log', makeguid("{0006200A-0000-0000-C000-000000000046}"));
20
+define('PSETID_Note', makeguid("{0006200E-0000-0000-C000-000000000046}"));
21
+define('PSETID_Meeting', makeguid("{6ED8DA90-450B-101B-98DA-00AA003F1305}"));
22
+define('PSETID_Archive', makeguid("{72E98EBC-57D2-4AB5-B0AA-D50A7B531CB9}"));
23 23
 
24
-define('PS_MAPI',                               makeguid("{00020328-0000-0000-C000-000000000046}"));
25
-define('PS_PUBLIC_STRINGS',                     makeguid("{00020329-0000-0000-C000-000000000046}"));
26
-define('PS_INTERNET_HEADERS',                   makeguid("{00020386-0000-0000-c000-000000000046}"));
24
+define('PS_MAPI', makeguid("{00020328-0000-0000-C000-000000000046}"));
25
+define('PS_PUBLIC_STRINGS', makeguid("{00020329-0000-0000-C000-000000000046}"));
26
+define('PS_INTERNET_HEADERS', makeguid("{00020386-0000-0000-c000-000000000046}"));
27 27
 
28
-define('MUIDECSAB',                             makeguid("{50A921AC-D340-48ee-B319-FBA753304425}"));
28
+define('MUIDECSAB', makeguid("{50A921AC-D340-48ee-B319-FBA753304425}"));
29 29
 
30 30
 // grommunio Contact Provider GUIDs
31
-define('MUIDZCSAB',                             makeguid("{30047F72-92E3-DA4F-B86A-E52A7FE46571}"));
31
+define('MUIDZCSAB', makeguid("{30047F72-92E3-DA4F-B86A-E52A7FE46571}"));
32 32
 
33 33
 // sk added for grommunio-sync
34
-define ('PSETID_AirSync',                       makeguid("{71035549-0739-4DCB-9163-00F0580DBBDF}"));
34
+define('PSETID_AirSync', makeguid("{71035549-0739-4DCB-9163-00F0580DBBDF}"));
Please login to merge, or discard this patch.