Compatibility for PHP 5.4

This commit is contained in:
2016-12-01 00:25:23 +01:00
parent 36308c8196
commit 70b1e0872c
3 changed files with 84 additions and 122 deletions

View File

@@ -1,5 +1,5 @@
{
"require": {
"sabre/vobject": "4.1"
"sabre/vobject": "3.5.3"
}
}

View File

@@ -292,7 +292,8 @@ class CalendarModule extends Module
}
// Add alarms
if (!empty($this->getProp($messageProps, "reminder")) && $this->getProp($messageProps, "reminder") == 1) {
$reminder = $this->getProp($messageProps, "reminder");
if (!empty($reminder) && $this->getProp($messageProps, "reminder") == 1) {
$vAlarm = $vEvent->add('VALARM', [
'ACTION' => 'DISPLAY',
'DESCRIPTION' => $this->getProp($messageProps, "subject") // reuse the event summary
@@ -309,7 +310,8 @@ class CalendarModule extends Module
}
// Add location
if (!empty($this->getProp($messageProps, "location"))) {
$location = $this->getProp($messageProps, "location");
if (!empty($location)) {
$vEvent->add('LOCATION', $this->getProp($messageProps, "location"));
}
@@ -677,8 +679,9 @@ class CalendarModule extends Module
//$properties["trigger"] = (string)$vEvent->COMMENT;
$properties["priority"] = (string)$vEvent->PRIORITY;
$properties["private"] = ((string)$vEvent->CLASS) == "PRIVATE" ? true : false;
if (!empty((string)$vEvent->{'X-ZARAFA-LABEL'})) {
$properties["label"] = array_search((string)$vEvent->{'X-ZARAFA-LABEL'}, $this->labels);
$zLabel = (string)$vEvent->{'X-ZARAFA-LABEL'};
if (!empty($zLabel)) {
$properties["label"] = array_search($zLabel, $this->labels);
}
$properties["last_modification_time"] = (string)$vEvent->{'LAST-MODIFIED'}->getDateTime()->getTimestamp();
$properties["creation_time"] = (string)$vEvent->CREATED->getDateTime()->getTimestamp();