summaryrefslogtreecommitdiff
path: root/plugins/libcalendaring/libcalendaring.php
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2015-02-27 17:13:57 (GMT)
committerThomas Bruederli <bruederli@kolabsys.com>2015-02-27 17:13:57 (GMT)
commit16ad0e6215a0b6d72d254fc0680e0a7a777e7745 (patch)
treeede9c6f987511fb98e5763645b5cbfdde02f3501 /plugins/libcalendaring/libcalendaring.php
parent94260b2aebe81645761260f4f5d221bff0e96cf0 (diff)
downloadroundcubemail-plugins-kolab-16ad0e6215a0b6d72d254fc0680e0a7a777e7745.tar.gz
Update parstat recursively on all recurrence exceptions
Diffstat (limited to 'plugins/libcalendaring/libcalendaring.php')
-rw-r--r--plugins/libcalendaring/libcalendaring.php17
1 files changed, 14 insertions, 3 deletions
diff --git a/plugins/libcalendaring/libcalendaring.php b/plugins/libcalendaring/libcalendaring.php
index f215ce6..94ff7f2 100644
--- a/plugins/libcalendaring/libcalendaring.php
+++ b/plugins/libcalendaring/libcalendaring.php
@@ -401,17 +401,28 @@ class libcalendaring extends rcube_plugin
* @param string The PARTSTAT value to set
* @return mixed Email address of the updated attendee or False if none matching found
*/
- public function set_partstat(&$event, $status)
+ public function set_partstat(&$event, $status, $recursive = true)
{
+ $success = false;
$emails = $this->get_user_emails();
foreach ((array)$event['attendees'] as $i => $attendee) {
if ($attendee['email'] && in_array(strtolower($attendee['email']), $emails)) {
$event['attendees'][$i]['status'] = strtoupper($status);
- return $attendee['email'];
+ $success = $attendee['email'];
}
}
- return false;
+ // apply partstat update to each existing exception
+ if ($event['recurrence'] && is_array($event['recurrence']['EXCEPTIONS'])) {
+ foreach ($event['recurrence']['EXCEPTIONS'] as $i => $exception) {
+ $this->set_partstat($event['recurrence']['EXCEPTIONS'][$i], $status, false);
+ }
+
+ // set link to top-level exceptions
+ $event['exceptions'] = &$event['recurrence']['EXCEPTIONS'];
+ }
+
+ return $success;
}