Commit 17510057 authored by Sebastian Kummer's avatar Sebastian Kummer

Merge pull request #584 in ZP/z-push from...

Merge pull request #584 in ZP/z-push from feature/ZP-1282-store-deleted-occurrences-as-exdate to develop

* commit '35416d42':
  ZP-1282 Store deleted occurrences as EXDATE in caldav. Released under the Affero GNU General Public License (AGPL) version 3.
parents eedfbfba 35416d42
......@@ -919,6 +919,16 @@ class BackendCalDAV extends BackendDiff {
$ical->AddComponent($vevent);
if (isset($data->exceptions) && is_array($data->exceptions)) {
foreach ($data->exceptions as $ex) {
if (isset($ex->deleted) && $ex->deleted == "1") {
if ($exdate = $vevent->GetPValue("EXDATE")) {
$vevent->SetPValue("EXDATE", $exdate.",".gmdate("Ymd\THis\Z", $ex->exceptionstarttime));
}
else {
$vevent->AddProperty("EXDATE", gmdate("Ymd\THis\Z", $ex->exceptionstarttime));
}
continue;
}
$exception = $this->_ParseASEventToVEvent($ex, $id);
if ($data->alldayevent == 1) {
$exception->AddProperty("RECURRENCE-ID", $this->_GetDateFromUTC("Ymd", $ex->exceptionstarttime, $data->timezone), array("VALUE" => "DATE"));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment