@@ -88,39 +88,39 @@ discard block |
||
88 | 88 | |
89 | 89 | if ($event->getSubject() === self::SUBJECT_ADD) { |
90 | 90 | $subject = $this->l->t('{actor} created calendar {calendar}'); |
91 | - } else if ($event->getSubject() === self::SUBJECT_ADD . '_self') { |
|
91 | + } else if ($event->getSubject() === self::SUBJECT_ADD.'_self') { |
|
92 | 92 | $subject = $this->l->t('You created calendar {calendar}'); |
93 | 93 | } else if ($event->getSubject() === self::SUBJECT_DELETE) { |
94 | 94 | $subject = $this->l->t('{actor} deleted calendar {calendar}'); |
95 | - } else if ($event->getSubject() === self::SUBJECT_DELETE . '_self') { |
|
95 | + } else if ($event->getSubject() === self::SUBJECT_DELETE.'_self') { |
|
96 | 96 | $subject = $this->l->t('You deleted calendar {calendar}'); |
97 | 97 | } else if ($event->getSubject() === self::SUBJECT_UPDATE) { |
98 | 98 | $subject = $this->l->t('{actor} updated calendar {calendar}'); |
99 | - } else if ($event->getSubject() === self::SUBJECT_UPDATE . '_self') { |
|
99 | + } else if ($event->getSubject() === self::SUBJECT_UPDATE.'_self') { |
|
100 | 100 | $subject = $this->l->t('You updated calendar {calendar}'); |
101 | 101 | |
102 | 102 | } else if ($event->getSubject() === self::SUBJECT_SHARE_USER) { |
103 | 103 | $subject = $this->l->t('{actor} shared calendar {calendar} with you'); |
104 | - } else if ($event->getSubject() === self::SUBJECT_SHARE_USER . '_you') { |
|
104 | + } else if ($event->getSubject() === self::SUBJECT_SHARE_USER.'_you') { |
|
105 | 105 | $subject = $this->l->t('You shared calendar {calendar} with {user}'); |
106 | - } else if ($event->getSubject() === self::SUBJECT_SHARE_USER . '_by') { |
|
106 | + } else if ($event->getSubject() === self::SUBJECT_SHARE_USER.'_by') { |
|
107 | 107 | $subject = $this->l->t('{actor} shared calendar {calendar} with {user}'); |
108 | 108 | } else if ($event->getSubject() === self::SUBJECT_UNSHARE_USER) { |
109 | 109 | $subject = $this->l->t('{actor} unshared calendar {calendar} from you'); |
110 | - } else if ($event->getSubject() === self::SUBJECT_UNSHARE_USER . '_you') { |
|
110 | + } else if ($event->getSubject() === self::SUBJECT_UNSHARE_USER.'_you') { |
|
111 | 111 | $subject = $this->l->t('You unshared calendar {calendar} from {user}'); |
112 | - } else if ($event->getSubject() === self::SUBJECT_UNSHARE_USER . '_by') { |
|
112 | + } else if ($event->getSubject() === self::SUBJECT_UNSHARE_USER.'_by') { |
|
113 | 113 | $subject = $this->l->t('{actor} unshared calendar {calendar} from {user}'); |
114 | - } else if ($event->getSubject() === self::SUBJECT_UNSHARE_USER . '_self') { |
|
114 | + } else if ($event->getSubject() === self::SUBJECT_UNSHARE_USER.'_self') { |
|
115 | 115 | $subject = $this->l->t('{actor} unshared calendar {calendar} from themselves'); |
116 | 116 | |
117 | - } else if ($event->getSubject() === self::SUBJECT_SHARE_GROUP . '_you') { |
|
117 | + } else if ($event->getSubject() === self::SUBJECT_SHARE_GROUP.'_you') { |
|
118 | 118 | $subject = $this->l->t('You shared calendar {calendar} with group {group}'); |
119 | - } else if ($event->getSubject() === self::SUBJECT_SHARE_GROUP . '_by') { |
|
119 | + } else if ($event->getSubject() === self::SUBJECT_SHARE_GROUP.'_by') { |
|
120 | 120 | $subject = $this->l->t('{actor} shared calendar {calendar} with group {group}'); |
121 | - } else if ($event->getSubject() === self::SUBJECT_UNSHARE_GROUP . '_you') { |
|
121 | + } else if ($event->getSubject() === self::SUBJECT_UNSHARE_GROUP.'_you') { |
|
122 | 122 | $subject = $this->l->t('You unshared calendar {calendar} from group {group}'); |
123 | - } else if ($event->getSubject() === self::SUBJECT_UNSHARE_GROUP . '_by') { |
|
123 | + } else if ($event->getSubject() === self::SUBJECT_UNSHARE_GROUP.'_by') { |
|
124 | 124 | $subject = $this->l->t('{actor} unshared calendar {calendar} from group {group}'); |
125 | 125 | } else { |
126 | 126 | throw new \InvalidArgumentException(); |
@@ -154,39 +154,39 @@ discard block |
||
154 | 154 | |
155 | 155 | switch ($subject) { |
156 | 156 | case self::SUBJECT_ADD: |
157 | - case self::SUBJECT_ADD . '_self': |
|
157 | + case self::SUBJECT_ADD.'_self': |
|
158 | 158 | case self::SUBJECT_DELETE: |
159 | - case self::SUBJECT_DELETE . '_self': |
|
159 | + case self::SUBJECT_DELETE.'_self': |
|
160 | 160 | case self::SUBJECT_UPDATE: |
161 | - case self::SUBJECT_UPDATE . '_self': |
|
161 | + case self::SUBJECT_UPDATE.'_self': |
|
162 | 162 | case self::SUBJECT_SHARE_USER: |
163 | 163 | case self::SUBJECT_UNSHARE_USER: |
164 | - case self::SUBJECT_UNSHARE_USER . '_self': |
|
164 | + case self::SUBJECT_UNSHARE_USER.'_self': |
|
165 | 165 | return [ |
166 | 166 | 'actor' => $this->generateUserParameter($parameters[0]), |
167 | 167 | 'calendar' => $this->generateCalendarParameter($event->getObjectId(), $parameters[1]), |
168 | 168 | ]; |
169 | - case self::SUBJECT_SHARE_USER . '_you': |
|
170 | - case self::SUBJECT_UNSHARE_USER . '_you': |
|
169 | + case self::SUBJECT_SHARE_USER.'_you': |
|
170 | + case self::SUBJECT_UNSHARE_USER.'_you': |
|
171 | 171 | return [ |
172 | 172 | 'user' => $this->generateUserParameter($parameters[0]), |
173 | 173 | 'calendar' => $this->generateCalendarParameter($event->getObjectId(), $parameters[1]), |
174 | 174 | ]; |
175 | - case self::SUBJECT_SHARE_USER . '_by': |
|
176 | - case self::SUBJECT_UNSHARE_USER . '_by': |
|
175 | + case self::SUBJECT_SHARE_USER.'_by': |
|
176 | + case self::SUBJECT_UNSHARE_USER.'_by': |
|
177 | 177 | return [ |
178 | 178 | 'user' => $this->generateUserParameter($parameters[0]), |
179 | 179 | 'calendar' => $this->generateCalendarParameter($event->getObjectId(), $parameters[1]), |
180 | 180 | 'actor' => $this->generateUserParameter($parameters[2]), |
181 | 181 | ]; |
182 | - case self::SUBJECT_SHARE_GROUP . '_you': |
|
183 | - case self::SUBJECT_UNSHARE_GROUP . '_you': |
|
182 | + case self::SUBJECT_SHARE_GROUP.'_you': |
|
183 | + case self::SUBJECT_UNSHARE_GROUP.'_you': |
|
184 | 184 | return [ |
185 | 185 | 'group' => $this->generateGroupParameter($parameters[0]), |
186 | 186 | 'calendar' => $this->generateCalendarParameter($event->getObjectId(), $parameters[1]), |
187 | 187 | ]; |
188 | - case self::SUBJECT_SHARE_GROUP . '_by': |
|
189 | - case self::SUBJECT_UNSHARE_GROUP . '_by': |
|
188 | + case self::SUBJECT_SHARE_GROUP.'_by': |
|
189 | + case self::SUBJECT_UNSHARE_GROUP.'_by': |
|
190 | 190 | return [ |
191 | 191 | 'group' => $this->generateGroupParameter($parameters[0]), |
192 | 192 | 'calendar' => $this->generateCalendarParameter($event->getObjectId(), $parameters[1]), |
@@ -49,7 +49,7 @@ |
||
49 | 49 | protected function setSubjects(IEvent $event, $subject, array $parameters) { |
50 | 50 | $placeholders = $replacements = []; |
51 | 51 | foreach ($parameters as $placeholder => $parameter) { |
52 | - $placeholders[] = '{' . $placeholder . '}'; |
|
52 | + $placeholders[] = '{'.$placeholder.'}'; |
|
53 | 53 | $replacements[] = $parameter['name']; |
54 | 54 | } |
55 | 55 |
@@ -82,17 +82,17 @@ discard block |
||
82 | 82 | |
83 | 83 | $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'places/calendar-dark.svg'))); |
84 | 84 | |
85 | - if ($event->getSubject() === self::SUBJECT_OBJECT_ADD . '_event') { |
|
85 | + if ($event->getSubject() === self::SUBJECT_OBJECT_ADD.'_event') { |
|
86 | 86 | $subject = $this->l->t('{actor} created event {event} in calendar {calendar}'); |
87 | - } else if ($event->getSubject() === self::SUBJECT_OBJECT_ADD . '_event_self') { |
|
87 | + } else if ($event->getSubject() === self::SUBJECT_OBJECT_ADD.'_event_self') { |
|
88 | 88 | $subject = $this->l->t('You created event {event} in calendar {calendar}'); |
89 | - } else if ($event->getSubject() === self::SUBJECT_OBJECT_DELETE . '_event') { |
|
89 | + } else if ($event->getSubject() === self::SUBJECT_OBJECT_DELETE.'_event') { |
|
90 | 90 | $subject = $this->l->t('{actor} deleted event {event} from calendar {calendar}'); |
91 | - } else if ($event->getSubject() === self::SUBJECT_OBJECT_DELETE . '_event_self') { |
|
91 | + } else if ($event->getSubject() === self::SUBJECT_OBJECT_DELETE.'_event_self') { |
|
92 | 92 | $subject = $this->l->t('You deleted event {event} from calendar {calendar}'); |
93 | - } else if ($event->getSubject() === self::SUBJECT_OBJECT_UPDATE . '_event') { |
|
93 | + } else if ($event->getSubject() === self::SUBJECT_OBJECT_UPDATE.'_event') { |
|
94 | 94 | $subject = $this->l->t('{actor} updated event {event} in calendar {calendar}'); |
95 | - } else if ($event->getSubject() === self::SUBJECT_OBJECT_UPDATE . '_event_self') { |
|
95 | + } else if ($event->getSubject() === self::SUBJECT_OBJECT_UPDATE.'_event_self') { |
|
96 | 96 | $subject = $this->l->t('You updated event {event} in calendar {calendar}'); |
97 | 97 | } else { |
98 | 98 | throw new \InvalidArgumentException(); |
@@ -115,17 +115,17 @@ discard block |
||
115 | 115 | $parameters = $event->getSubjectParameters(); |
116 | 116 | |
117 | 117 | switch ($subject) { |
118 | - case self::SUBJECT_OBJECT_ADD . '_event': |
|
119 | - case self::SUBJECT_OBJECT_DELETE . '_event': |
|
120 | - case self::SUBJECT_OBJECT_UPDATE . '_event': |
|
118 | + case self::SUBJECT_OBJECT_ADD.'_event': |
|
119 | + case self::SUBJECT_OBJECT_DELETE.'_event': |
|
120 | + case self::SUBJECT_OBJECT_UPDATE.'_event': |
|
121 | 121 | return [ |
122 | 122 | 'actor' => $this->generateUserParameter($parameters[0]), |
123 | 123 | 'calendar' => $this->generateCalendarParameter($event->getObjectId(), $parameters[1]), |
124 | 124 | 'event' => $this->generateObjectParameter($parameters[2]), |
125 | 125 | ]; |
126 | - case self::SUBJECT_OBJECT_ADD . '_event_self': |
|
127 | - case self::SUBJECT_OBJECT_DELETE . '_event_self': |
|
128 | - case self::SUBJECT_OBJECT_UPDATE . '_event_self': |
|
126 | + case self::SUBJECT_OBJECT_ADD.'_event_self': |
|
127 | + case self::SUBJECT_OBJECT_DELETE.'_event_self': |
|
128 | + case self::SUBJECT_OBJECT_UPDATE.'_event_self': |
|
129 | 129 | return [ |
130 | 130 | 'calendar' => $this->generateCalendarParameter($event->getObjectId(), $parameters[1]), |
131 | 131 | 'event' => $this->generateObjectParameter($parameters[2]), |
@@ -42,26 +42,26 @@ discard block |
||
42 | 42 | |
43 | 43 | $event->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/checkmark.svg'))); |
44 | 44 | |
45 | - if ($event->getSubject() === self::SUBJECT_OBJECT_ADD . '_todo') { |
|
45 | + if ($event->getSubject() === self::SUBJECT_OBJECT_ADD.'_todo') { |
|
46 | 46 | $subject = $this->l->t('{actor} created todo {todo} in list {calendar}'); |
47 | - } else if ($event->getSubject() === self::SUBJECT_OBJECT_ADD . '_todo_self') { |
|
47 | + } else if ($event->getSubject() === self::SUBJECT_OBJECT_ADD.'_todo_self') { |
|
48 | 48 | $subject = $this->l->t('You created todo {todo} in list {calendar}'); |
49 | - } else if ($event->getSubject() === self::SUBJECT_OBJECT_DELETE . '_todo') { |
|
49 | + } else if ($event->getSubject() === self::SUBJECT_OBJECT_DELETE.'_todo') { |
|
50 | 50 | $subject = $this->l->t('{actor} deleted todo {todo} from list {calendar}'); |
51 | - } else if ($event->getSubject() === self::SUBJECT_OBJECT_DELETE . '_todo_self') { |
|
51 | + } else if ($event->getSubject() === self::SUBJECT_OBJECT_DELETE.'_todo_self') { |
|
52 | 52 | $subject = $this->l->t('You deleted todo {todo} from list {calendar}'); |
53 | - } else if ($event->getSubject() === self::SUBJECT_OBJECT_UPDATE . '_todo') { |
|
53 | + } else if ($event->getSubject() === self::SUBJECT_OBJECT_UPDATE.'_todo') { |
|
54 | 54 | $subject = $this->l->t('{actor} updated todo {todo} in list {calendar}'); |
55 | - } else if ($event->getSubject() === self::SUBJECT_OBJECT_UPDATE . '_todo_self') { |
|
55 | + } else if ($event->getSubject() === self::SUBJECT_OBJECT_UPDATE.'_todo_self') { |
|
56 | 56 | $subject = $this->l->t('You updated todo {todo} in list {calendar}'); |
57 | 57 | |
58 | - } else if ($event->getSubject() === self::SUBJECT_OBJECT_UPDATE . '_todo_completed') { |
|
58 | + } else if ($event->getSubject() === self::SUBJECT_OBJECT_UPDATE.'_todo_completed') { |
|
59 | 59 | $subject = $this->l->t('{actor} solved todo {todo} in list {calendar}'); |
60 | - } else if ($event->getSubject() === self::SUBJECT_OBJECT_UPDATE . '_todo_completed_self') { |
|
60 | + } else if ($event->getSubject() === self::SUBJECT_OBJECT_UPDATE.'_todo_completed_self') { |
|
61 | 61 | $subject = $this->l->t('You solved todo {todo} in list {calendar}'); |
62 | - } else if ($event->getSubject() === self::SUBJECT_OBJECT_UPDATE . '_todo_needs_action') { |
|
62 | + } else if ($event->getSubject() === self::SUBJECT_OBJECT_UPDATE.'_todo_needs_action') { |
|
63 | 63 | $subject = $this->l->t('{actor} reopened todo {todo} in list {calendar}'); |
64 | - } else if ($event->getSubject() === self::SUBJECT_OBJECT_UPDATE . '_todo_needs_action_self') { |
|
64 | + } else if ($event->getSubject() === self::SUBJECT_OBJECT_UPDATE.'_todo_needs_action_self') { |
|
65 | 65 | $subject = $this->l->t('You reopened todo {todo} in list {calendar}'); |
66 | 66 | } else { |
67 | 67 | throw new \InvalidArgumentException(); |
@@ -84,21 +84,21 @@ discard block |
||
84 | 84 | $parameters = $event->getSubjectParameters(); |
85 | 85 | |
86 | 86 | switch ($subject) { |
87 | - case self::SUBJECT_OBJECT_ADD . '_todo': |
|
88 | - case self::SUBJECT_OBJECT_DELETE . '_todo': |
|
89 | - case self::SUBJECT_OBJECT_UPDATE . '_todo': |
|
90 | - case self::SUBJECT_OBJECT_UPDATE . '_todo_completed': |
|
91 | - case self::SUBJECT_OBJECT_UPDATE . '_todo_needs_action': |
|
87 | + case self::SUBJECT_OBJECT_ADD.'_todo': |
|
88 | + case self::SUBJECT_OBJECT_DELETE.'_todo': |
|
89 | + case self::SUBJECT_OBJECT_UPDATE.'_todo': |
|
90 | + case self::SUBJECT_OBJECT_UPDATE.'_todo_completed': |
|
91 | + case self::SUBJECT_OBJECT_UPDATE.'_todo_needs_action': |
|
92 | 92 | return [ |
93 | 93 | 'actor' => $this->generateUserParameter($parameters[0]), |
94 | 94 | 'calendar' => $this->generateCalendarParameter($event->getObjectId(), $parameters[1]), |
95 | 95 | 'todo' => $this->generateObjectParameter($parameters[2]), |
96 | 96 | ]; |
97 | - case self::SUBJECT_OBJECT_ADD . '_todo_self': |
|
98 | - case self::SUBJECT_OBJECT_DELETE . '_todo_self': |
|
99 | - case self::SUBJECT_OBJECT_UPDATE . '_todo_self': |
|
100 | - case self::SUBJECT_OBJECT_UPDATE . '_todo_completed_self': |
|
101 | - case self::SUBJECT_OBJECT_UPDATE . '_todo_needs_action_self': |
|
97 | + case self::SUBJECT_OBJECT_ADD.'_todo_self': |
|
98 | + case self::SUBJECT_OBJECT_DELETE.'_todo_self': |
|
99 | + case self::SUBJECT_OBJECT_UPDATE.'_todo_self': |
|
100 | + case self::SUBJECT_OBJECT_UPDATE.'_todo_completed_self': |
|
101 | + case self::SUBJECT_OBJECT_UPDATE.'_todo_needs_action_self': |
|
102 | 102 | return [ |
103 | 103 | 'calendar' => $this->generateCalendarParameter($event->getObjectId(), $parameters[1]), |
104 | 104 | 'todo' => $this->generateObjectParameter($parameters[2]), |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | foreach ($users as $user) { |
134 | 134 | $event->setAffectedUser($user) |
135 | 135 | ->setSubject( |
136 | - $user === $currentUser ? $action . '_self' : $action, |
|
136 | + $user === $currentUser ? $action.'_self' : $action, |
|
137 | 137 | [ |
138 | 138 | $currentUser, |
139 | 139 | $calendarData['{DAV:}displayname'], |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | $event, |
183 | 183 | $calendarData, |
184 | 184 | Calendar::SUBJECT_UNSHARE_USER, |
185 | - Calendar::SUBJECT_DELETE . '_self' |
|
185 | + Calendar::SUBJECT_DELETE.'_self' |
|
186 | 186 | ); |
187 | 187 | |
188 | 188 | if ($owner !== $principal[2]) { |
@@ -192,15 +192,15 @@ discard block |
||
192 | 192 | ]; |
193 | 193 | |
194 | 194 | if ($owner === $event->getAuthor()) { |
195 | - $subject = Calendar::SUBJECT_UNSHARE_USER . '_you'; |
|
195 | + $subject = Calendar::SUBJECT_UNSHARE_USER.'_you'; |
|
196 | 196 | } else if ($principal[2] === $event->getAuthor()) { |
197 | - $subject = Calendar::SUBJECT_UNSHARE_USER . '_self'; |
|
197 | + $subject = Calendar::SUBJECT_UNSHARE_USER.'_self'; |
|
198 | 198 | } else { |
199 | 199 | $event->setAffectedUser($event->getAuthor()) |
200 | - ->setSubject(Calendar::SUBJECT_UNSHARE_USER . '_you', $parameters); |
|
200 | + ->setSubject(Calendar::SUBJECT_UNSHARE_USER.'_you', $parameters); |
|
201 | 201 | $this->activityManager->publish($event); |
202 | 202 | |
203 | - $subject = Calendar::SUBJECT_UNSHARE_USER . '_by'; |
|
203 | + $subject = Calendar::SUBJECT_UNSHARE_USER.'_by'; |
|
204 | 204 | $parameters[] = $event->getAuthor(); |
205 | 205 | } |
206 | 206 | |
@@ -217,13 +217,13 @@ discard block |
||
217 | 217 | ]; |
218 | 218 | |
219 | 219 | if ($owner === $event->getAuthor()) { |
220 | - $subject = Calendar::SUBJECT_UNSHARE_GROUP . '_you'; |
|
220 | + $subject = Calendar::SUBJECT_UNSHARE_GROUP.'_you'; |
|
221 | 221 | } else { |
222 | 222 | $event->setAffectedUser($event->getAuthor()) |
223 | - ->setSubject(Calendar::SUBJECT_UNSHARE_GROUP . '_you', $parameters); |
|
223 | + ->setSubject(Calendar::SUBJECT_UNSHARE_GROUP.'_you', $parameters); |
|
224 | 224 | $this->activityManager->publish($event); |
225 | 225 | |
226 | - $subject = Calendar::SUBJECT_UNSHARE_GROUP . '_by'; |
|
226 | + $subject = Calendar::SUBJECT_UNSHARE_GROUP.'_by'; |
|
227 | 227 | $parameters[] = $event->getAuthor(); |
228 | 228 | } |
229 | 229 | |
@@ -255,13 +255,13 @@ discard block |
||
255 | 255 | ]; |
256 | 256 | |
257 | 257 | if ($owner === $event->getAuthor()) { |
258 | - $subject = Calendar::SUBJECT_SHARE_USER . '_you'; |
|
258 | + $subject = Calendar::SUBJECT_SHARE_USER.'_you'; |
|
259 | 259 | } else { |
260 | 260 | $event->setAffectedUser($event->getAuthor()) |
261 | - ->setSubject(Calendar::SUBJECT_SHARE_USER . '_you', $parameters); |
|
261 | + ->setSubject(Calendar::SUBJECT_SHARE_USER.'_you', $parameters); |
|
262 | 262 | $this->activityManager->publish($event); |
263 | 263 | |
264 | - $subject = Calendar::SUBJECT_SHARE_USER . '_by'; |
|
264 | + $subject = Calendar::SUBJECT_SHARE_USER.'_by'; |
|
265 | 265 | $parameters[] = $event->getAuthor(); |
266 | 266 | } |
267 | 267 | |
@@ -278,13 +278,13 @@ discard block |
||
278 | 278 | ]; |
279 | 279 | |
280 | 280 | if ($owner === $event->getAuthor()) { |
281 | - $subject = Calendar::SUBJECT_SHARE_GROUP . '_you'; |
|
281 | + $subject = Calendar::SUBJECT_SHARE_GROUP.'_you'; |
|
282 | 282 | } else { |
283 | 283 | $event->setAffectedUser($event->getAuthor()) |
284 | - ->setSubject(Calendar::SUBJECT_SHARE_GROUP . '_you', $parameters); |
|
284 | + ->setSubject(Calendar::SUBJECT_SHARE_GROUP.'_you', $parameters); |
|
285 | 285 | $this->activityManager->publish($event); |
286 | 286 | |
287 | - $subject = Calendar::SUBJECT_SHARE_GROUP . '_by'; |
|
287 | + $subject = Calendar::SUBJECT_SHARE_GROUP.'_by'; |
|
288 | 288 | $parameters[] = $event->getAuthor(); |
289 | 289 | } |
290 | 290 | |
@@ -379,7 +379,7 @@ discard block |
||
379 | 379 | } |
380 | 380 | |
381 | 381 | $object = $this->getObjectNameAndType($objectData); |
382 | - $action = $action . '_' . $object['type']; |
|
382 | + $action = $action.'_'.$object['type']; |
|
383 | 383 | |
384 | 384 | if ($object['type'] === 'todo' && strpos($action, Event::SUBJECT_OBJECT_UPDATE) === 0 && $object['status'] === 'COMPLETED') { |
385 | 385 | $action .= '_completed'; |
@@ -399,7 +399,7 @@ discard block |
||
399 | 399 | foreach ($users as $user) { |
400 | 400 | $event->setAffectedUser($user) |
401 | 401 | ->setSubject( |
402 | - $user === $currentUser ? $action . '_self' : $action, |
|
402 | + $user === $currentUser ? $action.'_self' : $action, |
|
403 | 403 | [ |
404 | 404 | $currentUser, |
405 | 405 | $calendarData['{DAV:}displayname'], |
@@ -420,7 +420,7 @@ discard block |
||
420 | 420 | protected function getObjectNameAndType(array $objectData) { |
421 | 421 | $vObject = Reader::read($objectData['calendardata']); |
422 | 422 | $component = $componentType = null; |
423 | - foreach($vObject->getComponents() as $component) { |
|
423 | + foreach ($vObject->getComponents() as $component) { |
|
424 | 424 | if (in_array($component->name, ['VEVENT', 'VTODO'])) { |
425 | 425 | $componentType = $component->name; |
426 | 426 | break; |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | } |
102 | 102 | |
103 | 103 | function getACL() { |
104 | - $acl = [ |
|
104 | + $acl = [ |
|
105 | 105 | [ |
106 | 106 | 'privilege' => '{DAV:}read', |
107 | 107 | 'principal' => $this->getOwner(), |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | ]; |
116 | 116 | } |
117 | 117 | if ($this->getOwner() !== parent::getOwner()) { |
118 | - $acl[] = [ |
|
118 | + $acl[] = [ |
|
119 | 119 | 'privilege' => '{DAV:}read', |
120 | 120 | 'principal' => parent::getOwner(), |
121 | 121 | 'protected' => true, |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | function delete() { |
156 | 156 | if (isset($this->calendarInfo['{http://owncloud.org/ns}owner-principal']) && |
157 | 157 | $this->calendarInfo['{http://owncloud.org/ns}owner-principal'] !== $this->calendarInfo['principaluri']) { |
158 | - $principal = 'principal:' . parent::getOwner(); |
|
158 | + $principal = 'principal:'.parent::getOwner(); |
|
159 | 159 | $shares = $this->getShares(); |
160 | 160 | $shares = array_filter($shares, function($share) use ($principal){ |
161 | 161 | return $share['href'] === $principal; |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | |
248 | 248 | $uris = $this->caldavBackend->calendarQuery($this->calendarInfo['id'], $filters); |
249 | 249 | if ($this->isShared()) { |
250 | - return array_filter($uris, function ($uri) { |
|
250 | + return array_filter($uris, function($uri) { |
|
251 | 251 | return $this->childExists($uri); |
252 | 252 | }); |
253 | 253 | } |
@@ -109,6 +109,6 @@ |
||
109 | 109 | |
110 | 110 | } |
111 | 111 | |
112 | - throw new NotFound('Node with name \'' . $name . '\' could not be found'); |
|
112 | + throw new NotFound('Node with name \''.$name.'\' could not be found'); |
|
113 | 113 | } |
114 | 114 | } |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | $query->andWhere($query->expr()->neq('uri', $query->createNamedParameter(BirthdayService::BIRTHDAY_CALENDAR_URI))); |
180 | 180 | } |
181 | 181 | |
182 | - return (int)$query->execute()->fetchColumn(); |
|
182 | + return (int) $query->execute()->fetchColumn(); |
|
183 | 183 | } |
184 | 184 | |
185 | 185 | /** |
@@ -226,25 +226,25 @@ discard block |
||
226 | 226 | $stmt = $query->execute(); |
227 | 227 | |
228 | 228 | $calendars = []; |
229 | - while($row = $stmt->fetch(\PDO::FETCH_ASSOC)) { |
|
229 | + while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) { |
|
230 | 230 | |
231 | 231 | $components = []; |
232 | 232 | if ($row['components']) { |
233 | - $components = explode(',',$row['components']); |
|
233 | + $components = explode(',', $row['components']); |
|
234 | 234 | } |
235 | 235 | |
236 | 236 | $calendar = [ |
237 | 237 | 'id' => $row['id'], |
238 | 238 | 'uri' => $row['uri'], |
239 | 239 | 'principaluri' => $this->convertPrincipal($row['principaluri'], !$this->legacyEndpoint), |
240 | - '{' . Plugin::NS_CALENDARSERVER . '}getctag' => 'http://sabre.io/ns/sync/' . ($row['synctoken']?$row['synctoken']:'0'), |
|
241 | - '{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0', |
|
242 | - '{' . Plugin::NS_CALDAV . '}supported-calendar-component-set' => new SupportedCalendarComponentSet($components), |
|
243 | - '{' . Plugin::NS_CALDAV . '}schedule-calendar-transp' => new ScheduleCalendarTransp($row['transparent']?'transparent':'opaque'), |
|
244 | - '{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}owner-principal' => $this->convertPrincipal($principalUri, !$this->legacyEndpoint), |
|
240 | + '{'.Plugin::NS_CALENDARSERVER.'}getctag' => 'http://sabre.io/ns/sync/'.($row['synctoken'] ? $row['synctoken'] : '0'), |
|
241 | + '{http://sabredav.org/ns}sync-token' => $row['synctoken'] ? $row['synctoken'] : '0', |
|
242 | + '{'.Plugin::NS_CALDAV.'}supported-calendar-component-set' => new SupportedCalendarComponentSet($components), |
|
243 | + '{'.Plugin::NS_CALDAV.'}schedule-calendar-transp' => new ScheduleCalendarTransp($row['transparent'] ? 'transparent' : 'opaque'), |
|
244 | + '{'.\OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD.'}owner-principal' => $this->convertPrincipal($principalUri, !$this->legacyEndpoint), |
|
245 | 245 | ]; |
246 | 246 | |
247 | - foreach($this->propertyMap as $xmlName=>$dbName) { |
|
247 | + foreach ($this->propertyMap as $xmlName=>$dbName) { |
|
248 | 248 | $calendar[$xmlName] = $row[$dbName]; |
249 | 249 | } |
250 | 250 | |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | |
258 | 258 | // query for shared calendars |
259 | 259 | $principals = $this->principalBackend->getGroupMembership($principalUriOriginal, true); |
260 | - $principals[]= $principalUri; |
|
260 | + $principals[] = $principalUri; |
|
261 | 261 | |
262 | 262 | $fields = array_values($this->propertyMap); |
263 | 263 | $fields[] = 'a.id'; |
@@ -277,27 +277,27 @@ discard block |
||
277 | 277 | ->setParameter('principaluri', $principals, \Doctrine\DBAL\Connection::PARAM_STR_ARRAY) |
278 | 278 | ->execute(); |
279 | 279 | |
280 | - while($row = $result->fetch()) { |
|
280 | + while ($row = $result->fetch()) { |
|
281 | 281 | list(, $name) = URLUtil::splitPath($row['principaluri']); |
282 | - $uri = $row['uri'] . '_shared_by_' . $name; |
|
283 | - $row['displayname'] = $row['displayname'] . ' (' . $this->getUserDisplayName($name) . ')'; |
|
282 | + $uri = $row['uri'].'_shared_by_'.$name; |
|
283 | + $row['displayname'] = $row['displayname'].' ('.$this->getUserDisplayName($name).')'; |
|
284 | 284 | $components = []; |
285 | 285 | if ($row['components']) { |
286 | - $components = explode(',',$row['components']); |
|
286 | + $components = explode(',', $row['components']); |
|
287 | 287 | } |
288 | 288 | $calendar = [ |
289 | 289 | 'id' => $row['id'], |
290 | 290 | 'uri' => $uri, |
291 | 291 | 'principaluri' => $this->convertPrincipal($principalUri, !$this->legacyEndpoint), |
292 | - '{' . Plugin::NS_CALENDARSERVER . '}getctag' => 'http://sabre.io/ns/sync/' . ($row['synctoken']?$row['synctoken']:'0'), |
|
293 | - '{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0', |
|
294 | - '{' . Plugin::NS_CALDAV . '}supported-calendar-component-set' => new SupportedCalendarComponentSet($components), |
|
295 | - '{' . Plugin::NS_CALDAV . '}schedule-calendar-transp' => new ScheduleCalendarTransp($row['transparent']?'transparent':'opaque'), |
|
296 | - '{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}owner-principal' => $this->convertPrincipal($row['principaluri'], !$this->legacyEndpoint), |
|
297 | - '{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}read-only' => (int)$row['access'] === Backend::ACCESS_READ, |
|
292 | + '{'.Plugin::NS_CALENDARSERVER.'}getctag' => 'http://sabre.io/ns/sync/'.($row['synctoken'] ? $row['synctoken'] : '0'), |
|
293 | + '{http://sabredav.org/ns}sync-token' => $row['synctoken'] ? $row['synctoken'] : '0', |
|
294 | + '{'.Plugin::NS_CALDAV.'}supported-calendar-component-set' => new SupportedCalendarComponentSet($components), |
|
295 | + '{'.Plugin::NS_CALDAV.'}schedule-calendar-transp' => new ScheduleCalendarTransp($row['transparent'] ? 'transparent' : 'opaque'), |
|
296 | + '{'.\OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD.'}owner-principal' => $this->convertPrincipal($row['principaluri'], !$this->legacyEndpoint), |
|
297 | + '{'.\OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD.'}read-only' => (int) $row['access'] === Backend::ACCESS_READ, |
|
298 | 298 | ]; |
299 | 299 | |
300 | - foreach($this->propertyMap as $xmlName=>$dbName) { |
|
300 | + foreach ($this->propertyMap as $xmlName=>$dbName) { |
|
301 | 301 | $calendar[$xmlName] = $row[$dbName]; |
302 | 302 | } |
303 | 303 | |
@@ -326,21 +326,21 @@ discard block |
||
326 | 326 | ->orderBy('calendarorder', 'ASC'); |
327 | 327 | $stmt = $query->execute(); |
328 | 328 | $calendars = []; |
329 | - while($row = $stmt->fetch(\PDO::FETCH_ASSOC)) { |
|
329 | + while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) { |
|
330 | 330 | $components = []; |
331 | 331 | if ($row['components']) { |
332 | - $components = explode(',',$row['components']); |
|
332 | + $components = explode(',', $row['components']); |
|
333 | 333 | } |
334 | 334 | $calendar = [ |
335 | 335 | 'id' => $row['id'], |
336 | 336 | 'uri' => $row['uri'], |
337 | 337 | 'principaluri' => $this->convertPrincipal($row['principaluri'], !$this->legacyEndpoint), |
338 | - '{' . Plugin::NS_CALENDARSERVER . '}getctag' => 'http://sabre.io/ns/sync/' . ($row['synctoken']?$row['synctoken']:'0'), |
|
339 | - '{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0', |
|
340 | - '{' . Plugin::NS_CALDAV . '}supported-calendar-component-set' => new SupportedCalendarComponentSet($components), |
|
341 | - '{' . Plugin::NS_CALDAV . '}schedule-calendar-transp' => new ScheduleCalendarTransp($row['transparent']?'transparent':'opaque'), |
|
338 | + '{'.Plugin::NS_CALENDARSERVER.'}getctag' => 'http://sabre.io/ns/sync/'.($row['synctoken'] ? $row['synctoken'] : '0'), |
|
339 | + '{http://sabredav.org/ns}sync-token' => $row['synctoken'] ? $row['synctoken'] : '0', |
|
340 | + '{'.Plugin::NS_CALDAV.'}supported-calendar-component-set' => new SupportedCalendarComponentSet($components), |
|
341 | + '{'.Plugin::NS_CALDAV.'}schedule-calendar-transp' => new ScheduleCalendarTransp($row['transparent'] ? 'transparent' : 'opaque'), |
|
342 | 342 | ]; |
343 | - foreach($this->propertyMap as $xmlName=>$dbName) { |
|
343 | + foreach ($this->propertyMap as $xmlName=>$dbName) { |
|
344 | 344 | $calendar[$xmlName] = $row[$dbName]; |
345 | 345 | } |
346 | 346 | if (!isset($calendars[$calendar['id']])) { |
@@ -388,27 +388,27 @@ discard block |
||
388 | 388 | ->andWhere($query->expr()->eq('s.type', $query->createNamedParameter('calendar'))) |
389 | 389 | ->execute(); |
390 | 390 | |
391 | - while($row = $result->fetch()) { |
|
391 | + while ($row = $result->fetch()) { |
|
392 | 392 | list(, $name) = URLUtil::splitPath($row['principaluri']); |
393 | - $row['displayname'] = $row['displayname'] . "($name)"; |
|
393 | + $row['displayname'] = $row['displayname']."($name)"; |
|
394 | 394 | $components = []; |
395 | 395 | if ($row['components']) { |
396 | - $components = explode(',',$row['components']); |
|
396 | + $components = explode(',', $row['components']); |
|
397 | 397 | } |
398 | 398 | $calendar = [ |
399 | 399 | 'id' => $row['id'], |
400 | 400 | 'uri' => $row['publicuri'], |
401 | 401 | 'principaluri' => $this->convertPrincipal($row['principaluri'], !$this->legacyEndpoint), |
402 | - '{' . Plugin::NS_CALENDARSERVER . '}getctag' => 'http://sabre.io/ns/sync/' . ($row['synctoken']?$row['synctoken']:'0'), |
|
403 | - '{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0', |
|
404 | - '{' . Plugin::NS_CALDAV . '}supported-calendar-component-set' => new SupportedCalendarComponentSet($components), |
|
405 | - '{' . Plugin::NS_CALDAV . '}schedule-calendar-transp' => new ScheduleCalendarTransp($row['transparent']?'transparent':'opaque'), |
|
406 | - '{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}owner-principal' => $this->convertPrincipal($row['principaluri'], $this->legacyEndpoint), |
|
407 | - '{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}read-only' => (int)$row['access'] === Backend::ACCESS_READ, |
|
408 | - '{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}public' => (int)$row['access'] === self::ACCESS_PUBLIC, |
|
402 | + '{'.Plugin::NS_CALENDARSERVER.'}getctag' => 'http://sabre.io/ns/sync/'.($row['synctoken'] ? $row['synctoken'] : '0'), |
|
403 | + '{http://sabredav.org/ns}sync-token' => $row['synctoken'] ? $row['synctoken'] : '0', |
|
404 | + '{'.Plugin::NS_CALDAV.'}supported-calendar-component-set' => new SupportedCalendarComponentSet($components), |
|
405 | + '{'.Plugin::NS_CALDAV.'}schedule-calendar-transp' => new ScheduleCalendarTransp($row['transparent'] ? 'transparent' : 'opaque'), |
|
406 | + '{'.\OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD.'}owner-principal' => $this->convertPrincipal($row['principaluri'], $this->legacyEndpoint), |
|
407 | + '{'.\OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD.'}read-only' => (int) $row['access'] === Backend::ACCESS_READ, |
|
408 | + '{'.\OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD.'}public' => (int) $row['access'] === self::ACCESS_PUBLIC, |
|
409 | 409 | ]; |
410 | 410 | |
411 | - foreach($this->propertyMap as $xmlName=>$dbName) { |
|
411 | + foreach ($this->propertyMap as $xmlName=>$dbName) { |
|
412 | 412 | $calendar[$xmlName] = $row[$dbName]; |
413 | 413 | } |
414 | 414 | |
@@ -450,29 +450,29 @@ discard block |
||
450 | 450 | $result->closeCursor(); |
451 | 451 | |
452 | 452 | if ($row === false) { |
453 | - throw new NotFound('Node with name \'' . $uri . '\' could not be found'); |
|
453 | + throw new NotFound('Node with name \''.$uri.'\' could not be found'); |
|
454 | 454 | } |
455 | 455 | |
456 | 456 | list(, $name) = URLUtil::splitPath($row['principaluri']); |
457 | - $row['displayname'] = $row['displayname'] . ' ' . "($name)"; |
|
457 | + $row['displayname'] = $row['displayname'].' '."($name)"; |
|
458 | 458 | $components = []; |
459 | 459 | if ($row['components']) { |
460 | - $components = explode(',',$row['components']); |
|
460 | + $components = explode(',', $row['components']); |
|
461 | 461 | } |
462 | 462 | $calendar = [ |
463 | 463 | 'id' => $row['id'], |
464 | 464 | 'uri' => $row['publicuri'], |
465 | 465 | 'principaluri' => $this->convertPrincipal($row['principaluri'], !$this->legacyEndpoint), |
466 | - '{' . Plugin::NS_CALENDARSERVER . '}getctag' => 'http://sabre.io/ns/sync/' . ($row['synctoken']?$row['synctoken']:'0'), |
|
467 | - '{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0', |
|
468 | - '{' . Plugin::NS_CALDAV . '}supported-calendar-component-set' => new SupportedCalendarComponentSet($components), |
|
469 | - '{' . Plugin::NS_CALDAV . '}schedule-calendar-transp' => new ScheduleCalendarTransp($row['transparent']?'transparent':'opaque'), |
|
470 | - '{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}owner-principal' => $this->convertPrincipal($row['principaluri'], !$this->legacyEndpoint), |
|
471 | - '{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}read-only' => (int)$row['access'] === Backend::ACCESS_READ, |
|
472 | - '{' . \OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD . '}public' => (int)$row['access'] === self::ACCESS_PUBLIC, |
|
466 | + '{'.Plugin::NS_CALENDARSERVER.'}getctag' => 'http://sabre.io/ns/sync/'.($row['synctoken'] ? $row['synctoken'] : '0'), |
|
467 | + '{http://sabredav.org/ns}sync-token' => $row['synctoken'] ? $row['synctoken'] : '0', |
|
468 | + '{'.Plugin::NS_CALDAV.'}supported-calendar-component-set' => new SupportedCalendarComponentSet($components), |
|
469 | + '{'.Plugin::NS_CALDAV.'}schedule-calendar-transp' => new ScheduleCalendarTransp($row['transparent'] ? 'transparent' : 'opaque'), |
|
470 | + '{'.\OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD.'}owner-principal' => $this->convertPrincipal($row['principaluri'], !$this->legacyEndpoint), |
|
471 | + '{'.\OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD.'}read-only' => (int) $row['access'] === Backend::ACCESS_READ, |
|
472 | + '{'.\OCA\DAV\DAV\Sharing\Plugin::NS_OWNCLOUD.'}public' => (int) $row['access'] === self::ACCESS_PUBLIC, |
|
473 | 473 | ]; |
474 | 474 | |
475 | - foreach($this->propertyMap as $xmlName=>$dbName) { |
|
475 | + foreach ($this->propertyMap as $xmlName=>$dbName) { |
|
476 | 476 | $calendar[$xmlName] = $row[$dbName]; |
477 | 477 | } |
478 | 478 | |
@@ -510,20 +510,20 @@ discard block |
||
510 | 510 | |
511 | 511 | $components = []; |
512 | 512 | if ($row['components']) { |
513 | - $components = explode(',',$row['components']); |
|
513 | + $components = explode(',', $row['components']); |
|
514 | 514 | } |
515 | 515 | |
516 | 516 | $calendar = [ |
517 | 517 | 'id' => $row['id'], |
518 | 518 | 'uri' => $row['uri'], |
519 | 519 | 'principaluri' => $this->convertPrincipal($row['principaluri'], !$this->legacyEndpoint), |
520 | - '{' . Plugin::NS_CALENDARSERVER . '}getctag' => 'http://sabre.io/ns/sync/' . ($row['synctoken']?$row['synctoken']:'0'), |
|
521 | - '{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0', |
|
522 | - '{' . Plugin::NS_CALDAV . '}supported-calendar-component-set' => new SupportedCalendarComponentSet($components), |
|
523 | - '{' . Plugin::NS_CALDAV . '}schedule-calendar-transp' => new ScheduleCalendarTransp($row['transparent']?'transparent':'opaque'), |
|
520 | + '{'.Plugin::NS_CALENDARSERVER.'}getctag' => 'http://sabre.io/ns/sync/'.($row['synctoken'] ? $row['synctoken'] : '0'), |
|
521 | + '{http://sabredav.org/ns}sync-token' => $row['synctoken'] ? $row['synctoken'] : '0', |
|
522 | + '{'.Plugin::NS_CALDAV.'}supported-calendar-component-set' => new SupportedCalendarComponentSet($components), |
|
523 | + '{'.Plugin::NS_CALDAV.'}schedule-calendar-transp' => new ScheduleCalendarTransp($row['transparent'] ? 'transparent' : 'opaque'), |
|
524 | 524 | ]; |
525 | 525 | |
526 | - foreach($this->propertyMap as $xmlName=>$dbName) { |
|
526 | + foreach ($this->propertyMap as $xmlName=>$dbName) { |
|
527 | 527 | $calendar[$xmlName] = $row[$dbName]; |
528 | 528 | } |
529 | 529 | |
@@ -554,20 +554,20 @@ discard block |
||
554 | 554 | |
555 | 555 | $components = []; |
556 | 556 | if ($row['components']) { |
557 | - $components = explode(',',$row['components']); |
|
557 | + $components = explode(',', $row['components']); |
|
558 | 558 | } |
559 | 559 | |
560 | 560 | $calendar = [ |
561 | 561 | 'id' => $row['id'], |
562 | 562 | 'uri' => $row['uri'], |
563 | 563 | 'principaluri' => $this->convertPrincipal($row['principaluri'], !$this->legacyEndpoint), |
564 | - '{' . Plugin::NS_CALENDARSERVER . '}getctag' => 'http://sabre.io/ns/sync/' . ($row['synctoken']?$row['synctoken']:'0'), |
|
565 | - '{http://sabredav.org/ns}sync-token' => $row['synctoken']?$row['synctoken']:'0', |
|
566 | - '{' . Plugin::NS_CALDAV . '}supported-calendar-component-set' => new SupportedCalendarComponentSet($components), |
|
567 | - '{' . Plugin::NS_CALDAV . '}schedule-calendar-transp' => new ScheduleCalendarTransp($row['transparent']?'transparent':'opaque'), |
|
564 | + '{'.Plugin::NS_CALENDARSERVER.'}getctag' => 'http://sabre.io/ns/sync/'.($row['synctoken'] ? $row['synctoken'] : '0'), |
|
565 | + '{http://sabredav.org/ns}sync-token' => $row['synctoken'] ? $row['synctoken'] : '0', |
|
566 | + '{'.Plugin::NS_CALDAV.'}supported-calendar-component-set' => new SupportedCalendarComponentSet($components), |
|
567 | + '{'.Plugin::NS_CALDAV.'}schedule-calendar-transp' => new ScheduleCalendarTransp($row['transparent'] ? 'transparent' : 'opaque'), |
|
568 | 568 | ]; |
569 | 569 | |
570 | - foreach($this->propertyMap as $xmlName=>$dbName) { |
|
570 | + foreach ($this->propertyMap as $xmlName=>$dbName) { |
|
571 | 571 | $calendar[$xmlName] = $row[$dbName]; |
572 | 572 | } |
573 | 573 | |
@@ -599,16 +599,16 @@ discard block |
||
599 | 599 | $sccs = '{urn:ietf:params:xml:ns:caldav}supported-calendar-component-set'; |
600 | 600 | if (isset($properties[$sccs])) { |
601 | 601 | if (!($properties[$sccs] instanceof SupportedCalendarComponentSet)) { |
602 | - throw new DAV\Exception('The ' . $sccs . ' property must be of type: \Sabre\CalDAV\Property\SupportedCalendarComponentSet'); |
|
602 | + throw new DAV\Exception('The '.$sccs.' property must be of type: \Sabre\CalDAV\Property\SupportedCalendarComponentSet'); |
|
603 | 603 | } |
604 | - $values['components'] = implode(',',$properties[$sccs]->getValue()); |
|
604 | + $values['components'] = implode(',', $properties[$sccs]->getValue()); |
|
605 | 605 | } |
606 | - $transp = '{' . Plugin::NS_CALDAV . '}schedule-calendar-transp'; |
|
606 | + $transp = '{'.Plugin::NS_CALDAV.'}schedule-calendar-transp'; |
|
607 | 607 | if (isset($properties[$transp])) { |
608 | - $values['transparent'] = $properties[$transp]->getValue()==='transparent'; |
|
608 | + $values['transparent'] = $properties[$transp]->getValue() === 'transparent'; |
|
609 | 609 | } |
610 | 610 | |
611 | - foreach($this->propertyMap as $xmlName=>$dbName) { |
|
611 | + foreach ($this->propertyMap as $xmlName=>$dbName) { |
|
612 | 612 | if (isset($properties[$xmlName])) { |
613 | 613 | $values[$dbName] = $properties[$xmlName]; |
614 | 614 | } |
@@ -616,7 +616,7 @@ discard block |
||
616 | 616 | |
617 | 617 | $query = $this->db->getQueryBuilder(); |
618 | 618 | $query->insert('calendars'); |
619 | - foreach($values as $column => $value) { |
|
619 | + foreach ($values as $column => $value) { |
|
620 | 620 | $query->setValue($column, $query->createNamedParameter($value)); |
621 | 621 | } |
622 | 622 | $query->execute(); |
@@ -649,14 +649,14 @@ discard block |
||
649 | 649 | */ |
650 | 650 | function updateCalendar($calendarId, PropPatch $propPatch) { |
651 | 651 | $supportedProperties = array_keys($this->propertyMap); |
652 | - $supportedProperties[] = '{' . Plugin::NS_CALDAV . '}schedule-calendar-transp'; |
|
652 | + $supportedProperties[] = '{'.Plugin::NS_CALDAV.'}schedule-calendar-transp'; |
|
653 | 653 | |
654 | 654 | $propPatch->handle($supportedProperties, function($mutations) use ($calendarId) { |
655 | 655 | $newValues = []; |
656 | 656 | foreach ($mutations as $propertyName => $propertyValue) { |
657 | 657 | |
658 | 658 | switch ($propertyName) { |
659 | - case '{' . Plugin::NS_CALDAV . '}schedule-calendar-transp' : |
|
659 | + case '{'.Plugin::NS_CALDAV.'}schedule-calendar-transp' : |
|
660 | 660 | $fieldName = 'transparent'; |
661 | 661 | $newValues[$fieldName] = $propertyValue->getValue() === 'transparent'; |
662 | 662 | break; |
@@ -766,16 +766,16 @@ discard block |
||
766 | 766 | $stmt = $query->execute(); |
767 | 767 | |
768 | 768 | $result = []; |
769 | - foreach($stmt->fetchAll(\PDO::FETCH_ASSOC) as $row) { |
|
769 | + foreach ($stmt->fetchAll(\PDO::FETCH_ASSOC) as $row) { |
|
770 | 770 | $result[] = [ |
771 | 771 | 'id' => $row['id'], |
772 | 772 | 'uri' => $row['uri'], |
773 | 773 | 'lastmodified' => $row['lastmodified'], |
774 | - 'etag' => '"' . $row['etag'] . '"', |
|
774 | + 'etag' => '"'.$row['etag'].'"', |
|
775 | 775 | 'calendarid' => $row['calendarid'], |
776 | - 'size' => (int)$row['size'], |
|
776 | + 'size' => (int) $row['size'], |
|
777 | 777 | 'component' => strtolower($row['componenttype']), |
778 | - 'classification'=> (int)$row['classification'] |
|
778 | + 'classification'=> (int) $row['classification'] |
|
779 | 779 | ]; |
780 | 780 | } |
781 | 781 | |
@@ -808,18 +808,18 @@ discard block |
||
808 | 808 | $stmt = $query->execute(); |
809 | 809 | $row = $stmt->fetch(\PDO::FETCH_ASSOC); |
810 | 810 | |
811 | - if(!$row) return null; |
|
811 | + if (!$row) return null; |
|
812 | 812 | |
813 | 813 | return [ |
814 | 814 | 'id' => $row['id'], |
815 | 815 | 'uri' => $row['uri'], |
816 | 816 | 'lastmodified' => $row['lastmodified'], |
817 | - 'etag' => '"' . $row['etag'] . '"', |
|
817 | + 'etag' => '"'.$row['etag'].'"', |
|
818 | 818 | 'calendarid' => $row['calendarid'], |
819 | - 'size' => (int)$row['size'], |
|
819 | + 'size' => (int) $row['size'], |
|
820 | 820 | 'calendardata' => $this->readBlob($row['calendardata']), |
821 | 821 | 'component' => strtolower($row['componenttype']), |
822 | - 'classification'=> (int)$row['classification'] |
|
822 | + 'classification'=> (int) $row['classification'] |
|
823 | 823 | ]; |
824 | 824 | } |
825 | 825 | |
@@ -858,12 +858,12 @@ discard block |
||
858 | 858 | 'id' => $row['id'], |
859 | 859 | 'uri' => $row['uri'], |
860 | 860 | 'lastmodified' => $row['lastmodified'], |
861 | - 'etag' => '"' . $row['etag'] . '"', |
|
861 | + 'etag' => '"'.$row['etag'].'"', |
|
862 | 862 | 'calendarid' => $row['calendarid'], |
863 | - 'size' => (int)$row['size'], |
|
863 | + 'size' => (int) $row['size'], |
|
864 | 864 | 'calendardata' => $this->readBlob($row['calendardata']), |
865 | 865 | 'component' => strtolower($row['componenttype']), |
866 | - 'classification' => (int)$row['classification'] |
|
866 | + 'classification' => (int) $row['classification'] |
|
867 | 867 | ]; |
868 | 868 | } |
869 | 869 | $result->closeCursor(); |
@@ -920,7 +920,7 @@ discard block |
||
920 | 920 | )); |
921 | 921 | $this->addChange($calendarId, $objectUri, 1); |
922 | 922 | |
923 | - return '"' . $extraData['etag'] . '"'; |
|
923 | + return '"'.$extraData['etag'].'"'; |
|
924 | 924 | } |
925 | 925 | |
926 | 926 | /** |
@@ -973,7 +973,7 @@ discard block |
||
973 | 973 | } |
974 | 974 | $this->addChange($calendarId, $objectUri, 2); |
975 | 975 | |
976 | - return '"' . $extraData['etag'] . '"'; |
|
976 | + return '"'.$extraData['etag'].'"'; |
|
977 | 977 | } |
978 | 978 | |
979 | 979 | /** |
@@ -1124,7 +1124,7 @@ discard block |
||
1124 | 1124 | $stmt = $query->execute(); |
1125 | 1125 | |
1126 | 1126 | $result = []; |
1127 | - while($row = $stmt->fetch(\PDO::FETCH_ASSOC)) { |
|
1127 | + while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) { |
|
1128 | 1128 | if ($requirePostFilter) { |
1129 | 1129 | if (!$this->validateFilterForObject($row, $filters)) { |
1130 | 1130 | continue; |
@@ -1167,7 +1167,7 @@ discard block |
||
1167 | 1167 | $stmt = $query->execute(); |
1168 | 1168 | |
1169 | 1169 | if ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) { |
1170 | - return $row['calendaruri'] . '/' . $row['objecturi']; |
|
1170 | + return $row['calendaruri'].'/'.$row['objecturi']; |
|
1171 | 1171 | } |
1172 | 1172 | |
1173 | 1173 | return null; |
@@ -1232,7 +1232,7 @@ discard block |
||
1232 | 1232 | function getChangesForCalendar($calendarId, $syncToken, $syncLevel, $limit = null) { |
1233 | 1233 | // Current synctoken |
1234 | 1234 | $stmt = $this->db->prepare('SELECT `synctoken` FROM `*PREFIX*calendars` WHERE `id` = ?'); |
1235 | - $stmt->execute([ $calendarId ]); |
|
1235 | + $stmt->execute([$calendarId]); |
|
1236 | 1236 | $currentToken = $stmt->fetchColumn(0); |
1237 | 1237 | |
1238 | 1238 | if (is_null($currentToken)) { |
@@ -1249,8 +1249,8 @@ discard block |
||
1249 | 1249 | if ($syncToken) { |
1250 | 1250 | |
1251 | 1251 | $query = "SELECT `uri`, `operation` FROM `*PREFIX*calendarchanges` WHERE `synctoken` >= ? AND `synctoken` < ? AND `calendarid` = ? ORDER BY `synctoken`"; |
1252 | - if ($limit>0) { |
|
1253 | - $query.= " `LIMIT` " . (int)$limit; |
|
1252 | + if ($limit > 0) { |
|
1253 | + $query .= " `LIMIT` ".(int) $limit; |
|
1254 | 1254 | } |
1255 | 1255 | |
1256 | 1256 | // Fetching all changes |
@@ -1261,15 +1261,15 @@ discard block |
||
1261 | 1261 | |
1262 | 1262 | // This loop ensures that any duplicates are overwritten, only the |
1263 | 1263 | // last change on a node is relevant. |
1264 | - while($row = $stmt->fetch(\PDO::FETCH_ASSOC)) { |
|
1264 | + while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) { |
|
1265 | 1265 | |
1266 | 1266 | $changes[$row['uri']] = $row['operation']; |
1267 | 1267 | |
1268 | 1268 | } |
1269 | 1269 | |
1270 | - foreach($changes as $uri => $operation) { |
|
1270 | + foreach ($changes as $uri => $operation) { |
|
1271 | 1271 | |
1272 | - switch($operation) { |
|
1272 | + switch ($operation) { |
|
1273 | 1273 | case 1 : |
1274 | 1274 | $result['added'][] = $uri; |
1275 | 1275 | break; |
@@ -1339,10 +1339,10 @@ discard block |
||
1339 | 1339 | ->from('calendarsubscriptions') |
1340 | 1340 | ->where($query->expr()->eq('principaluri', $query->createNamedParameter($principalUri))) |
1341 | 1341 | ->orderBy('calendarorder', 'asc'); |
1342 | - $stmt =$query->execute(); |
|
1342 | + $stmt = $query->execute(); |
|
1343 | 1343 | |
1344 | 1344 | $subscriptions = []; |
1345 | - while($row = $stmt->fetch(\PDO::FETCH_ASSOC)) { |
|
1345 | + while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) { |
|
1346 | 1346 | |
1347 | 1347 | $subscription = [ |
1348 | 1348 | 'id' => $row['id'], |
@@ -1351,10 +1351,10 @@ discard block |
||
1351 | 1351 | 'source' => $row['source'], |
1352 | 1352 | 'lastmodified' => $row['lastmodified'], |
1353 | 1353 | |
1354 | - '{' . Plugin::NS_CALDAV . '}supported-calendar-component-set' => new SupportedCalendarComponentSet(['VTODO', 'VEVENT']), |
|
1354 | + '{'.Plugin::NS_CALDAV.'}supported-calendar-component-set' => new SupportedCalendarComponentSet(['VTODO', 'VEVENT']), |
|
1355 | 1355 | ]; |
1356 | 1356 | |
1357 | - foreach($this->subscriptionPropertyMap as $xmlName=>$dbName) { |
|
1357 | + foreach ($this->subscriptionPropertyMap as $xmlName=>$dbName) { |
|
1358 | 1358 | if (!is_null($row[$dbName])) { |
1359 | 1359 | $subscription[$xmlName] = $row[$dbName]; |
1360 | 1360 | } |
@@ -1393,7 +1393,7 @@ discard block |
||
1393 | 1393 | |
1394 | 1394 | $propertiesBoolean = ['striptodos', 'stripalarms', 'stripattachments']; |
1395 | 1395 | |
1396 | - foreach($this->subscriptionPropertyMap as $xmlName=>$dbName) { |
|
1396 | + foreach ($this->subscriptionPropertyMap as $xmlName=>$dbName) { |
|
1397 | 1397 | if (array_key_exists($xmlName, $properties)) { |
1398 | 1398 | $values[$dbName] = $properties[$xmlName]; |
1399 | 1399 | if (in_array($dbName, $propertiesBoolean)) { |
@@ -1441,7 +1441,7 @@ discard block |
||
1441 | 1441 | |
1442 | 1442 | $newValues = []; |
1443 | 1443 | |
1444 | - foreach($mutations as $propertyName=>$propertyValue) { |
|
1444 | + foreach ($mutations as $propertyName=>$propertyValue) { |
|
1445 | 1445 | if ($propertyName === '{http://calendarserver.org/ns/}source') { |
1446 | 1446 | $newValues['source'] = $propertyValue->getHref(); |
1447 | 1447 | } else { |
@@ -1453,7 +1453,7 @@ discard block |
||
1453 | 1453 | $query = $this->db->getQueryBuilder(); |
1454 | 1454 | $query->update('calendarsubscriptions') |
1455 | 1455 | ->set('lastmodified', $query->createNamedParameter(time())); |
1456 | - foreach($newValues as $fieldName=>$value) { |
|
1456 | + foreach ($newValues as $fieldName=>$value) { |
|
1457 | 1457 | $query->set($fieldName, $query->createNamedParameter($value)); |
1458 | 1458 | } |
1459 | 1459 | $query->where($query->expr()->eq('id', $query->createNamedParameter($subscriptionId))) |
@@ -1503,7 +1503,7 @@ discard block |
||
1503 | 1503 | |
1504 | 1504 | $row = $stmt->fetch(\PDO::FETCH_ASSOC); |
1505 | 1505 | |
1506 | - if(!$row) { |
|
1506 | + if (!$row) { |
|
1507 | 1507 | return null; |
1508 | 1508 | } |
1509 | 1509 | |
@@ -1511,8 +1511,8 @@ discard block |
||
1511 | 1511 | 'uri' => $row['uri'], |
1512 | 1512 | 'calendardata' => $row['calendardata'], |
1513 | 1513 | 'lastmodified' => $row['lastmodified'], |
1514 | - 'etag' => '"' . $row['etag'] . '"', |
|
1515 | - 'size' => (int)$row['size'], |
|
1514 | + 'etag' => '"'.$row['etag'].'"', |
|
1515 | + 'size' => (int) $row['size'], |
|
1516 | 1516 | ]; |
1517 | 1517 | } |
1518 | 1518 | |
@@ -1535,13 +1535,13 @@ discard block |
||
1535 | 1535 | ->execute(); |
1536 | 1536 | |
1537 | 1537 | $result = []; |
1538 | - foreach($stmt->fetchAll(\PDO::FETCH_ASSOC) as $row) { |
|
1538 | + foreach ($stmt->fetchAll(\PDO::FETCH_ASSOC) as $row) { |
|
1539 | 1539 | $result[] = [ |
1540 | 1540 | 'calendardata' => $row['calendardata'], |
1541 | 1541 | 'uri' => $row['uri'], |
1542 | 1542 | 'lastmodified' => $row['lastmodified'], |
1543 | - 'etag' => '"' . $row['etag'] . '"', |
|
1544 | - 'size' => (int)$row['size'], |
|
1543 | + 'etag' => '"'.$row['etag'].'"', |
|
1544 | + 'size' => (int) $row['size'], |
|
1545 | 1545 | ]; |
1546 | 1546 | } |
1547 | 1547 | |
@@ -1633,10 +1633,10 @@ discard block |
||
1633 | 1633 | $lastOccurrence = null; |
1634 | 1634 | $uid = null; |
1635 | 1635 | $classification = self::CLASSIFICATION_PUBLIC; |
1636 | - foreach($vObject->getComponents() as $component) { |
|
1637 | - if ($component->name!=='VTIMEZONE') { |
|
1636 | + foreach ($vObject->getComponents() as $component) { |
|
1637 | + if ($component->name !== 'VTIMEZONE') { |
|
1638 | 1638 | $componentType = $component->name; |
1639 | - $uid = (string)$component->UID; |
|
1639 | + $uid = (string) $component->UID; |
|
1640 | 1640 | break; |
1641 | 1641 | } |
1642 | 1642 | } |
@@ -1661,13 +1661,13 @@ discard block |
||
1661 | 1661 | $lastOccurrence = $firstOccurrence; |
1662 | 1662 | } |
1663 | 1663 | } else { |
1664 | - $it = new EventIterator($vObject, (string)$component->UID); |
|
1664 | + $it = new EventIterator($vObject, (string) $component->UID); |
|
1665 | 1665 | $maxDate = new \DateTime(self::MAX_DATE); |
1666 | 1666 | if ($it->isInfinite()) { |
1667 | 1667 | $lastOccurrence = $maxDate->getTimestamp(); |
1668 | 1668 | } else { |
1669 | 1669 | $end = $it->getDtEnd(); |
1670 | - while($it->valid() && $end < $maxDate) { |
|
1670 | + while ($it->valid() && $end < $maxDate) { |
|
1671 | 1671 | $end = $it->getDtEnd(); |
1672 | 1672 | $it->next(); |
1673 | 1673 |
@@ -32,7 +32,7 @@ |
||
32 | 32 | |
33 | 33 | if (strrpos($principalUrl, 'principals/users', -strlen($principalUrl)) !== false) { |
34 | 34 | list(, $principalId) = URLUtil::splitPath($principalUrl); |
35 | - return self::CALENDAR_ROOT .'/' . $principalId; |
|
35 | + return self::CALENDAR_ROOT.'/'.$principalId; |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | return; |