Skip to content
Snippets Groups Projects

Update CERN's branch with latest fixes

Merged Vincent Brillault requested to merge cern_vb_2_cern into cern
2 files
+ 12
8
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -303,7 +303,11 @@ class BackendCalDAV extends BackendDiff {
}
else {
$etag = "*";
$id = sprintf("%s-%s.ics", gmdate("Ymd\THis\Z"), hash("md5", microtime()));
if (!empty($message->uid)) {
$id = sprintf("%s.ics", $message->uid);
} else {
$id = sprintf("%s-%s.ics", gmdate("Ymd\THis\Z"), hash("md5", microtime()));
}
}
$url = $this->_caldav_path . substr($folderid, 1) . "/" . $id;
@@ -551,7 +555,7 @@ class BackendCalDAV extends BackendDiff {
$truncsize = Utils::GetTruncSize($contentparameters->GetTruncation());
$message = new SyncAppointment();
$vcal = Sabre\VObject\Reader::read($data, sabre\vobject\reader::OPTION_FORGIVING);
$vcal = Sabre\VObject\Reader::read($data, Sabre\VObject\Reader::OPTION_FORGIVING);
ZLog::Write(LOGLEVEL_WBXML, "VObject vcal: ".print_r($vcal->serialize(), 1));
foreach ($vcal->VEVENT as $vevent) {
@@ -1163,7 +1167,7 @@ class BackendCalDAV extends BackendDiff {
$vevent->DTSTART['VALUE'] = 'DATE';
}
else {
$vevent->DTSTART = gmdate("Ymd\THis\Z", $data->starttime);
$vevent->DTSTART = $this->DAVDateTimeInTimezone($data->starttime, $tzid);
}
if ($tzid != "UTC") {
$vevent->DTSTART['TZID'] = $tzid;
@@ -1173,7 +1177,7 @@ class BackendCalDAV extends BackendDiff {
$vevent->DTEND['VALUE'] = 'DATE';
}
else {
$vevent->DTEND = gmdate("Ymd\THis\Z", $data->endtime);
$vevent->DTEND = $this->DAVDateTimeInTimezone($data->endtime, $tzid);
}
if ($tzid != "UTC") {
$vevent->DTEND['TZID'] = $tzid;
@@ -1449,7 +1453,7 @@ class BackendCalDAV extends BackendDiff {
$truncsize = Utils::GetTruncSize($contentparameters->GetTruncation());
$message = new SyncTask();
$vcal = sabre\vobject\reader::read($data, sabre\vobject\reader::OPTION_FORGIVING);
$vcal = Sabre\VObject\Reader::read($data, Sabre\VObject\Reader::OPTION_FORGIVING);
ZLog::Write(LOGLEVEL_DEBUG, "VObject vcal: ".print_r($vcal->serialize(), 1));
foreach ($vcal->VTODO as $vtodo) {
@@ -1920,7 +1924,7 @@ class BackendCalDAV extends BackendDiff {
private static function DAVDateTimeInTimezone($timestamp, $tzid) {
$dt = new DateTime('@'.$timestamp);
$dt->setTimeZone(new DateTimeZone($tzid));
return $tzid == 'Z' ? $dt->format('Ymd\THis\Z') : $dt->format('Ymd\THis');
return $tzid == 'UTC' ? $dt->format('Ymd\THis\Z') : $dt->format('Ymd\THis');
}
/**
Loading