Compare commits

...

6 Commits

22 changed files with 3656 additions and 3638 deletions

View File

@ -1 +1,8 @@
<?php // config options $ADMINUSERNAME = "admin"; $ADMINPASSWORD = "admin"; $SERVER = "file:///var/run/zarafa"; $CALDAVURL = "http://localhost:8080/ical/"; $TEMPDIR = "/tmp/"; ?>
<?php
// config options
$ADMINUSERNAME = "admin";
$ADMINPASSWORD = "admin";
$SERVER = "file:///var/run/zarafa";
$CALDAVURL = "http://localhost:8080/ical/";
$TEMPDIR = "/tmp/";
?>

View File

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

View File

@ -287,8 +287,9 @@ class CalendarModule extends Module
]);
// Add organizer
if(!empty( $this->getProp($messageProps, "sender_email_address"))) {
$vEvent->add('ORGANIZER', 'mailto:' . $this->getProp($messageProps, "sender_email_address"));
$organizer = $this->getProp($messageProps, "sender_email_address");
if(!empty($organizer)) {
$vEvent->add('ORGANIZER', 'mailto:' . $organizer);
$vEvent->ORGANIZER['CN'] = $this->getProp($messageProps, "sender_name");
}
@ -302,7 +303,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
@ -319,7 +321,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"));
}
@ -330,10 +333,11 @@ class CalendarModule extends Module
}
// Add categories
if (!empty($this->getProp($messageProps, "categories"))) {
$categories = array_map('trim', explode(';', trim($this->getProp($messageProps, "categories"), " ;")));
$categories = $this->getProp($messageProps, "categories");
if (!empty($categories)) {
$categoryArray = array_map('trim', explode(';', trim($categories, " ;")));
$vEvent->add('CATEGORIES', $categories);
$vEvent->add('CATEGORIES', $categoryArray);
}
}
@ -689,12 +693,16 @@ class CalendarModule extends Module
$properties["comment"] = (string)$vEvent->COMMENT;
$properties["timezone"] = (string)$vEvent->DTSTART["TZID"];
$properties["organizer"] = (string)$vEvent->ORGANIZER;
if(!empty((string)$vEvent->FBTYPE)) {
$properties["busystatus"] = array_search((string)$vEvent->FBTYPE, $this->freeBusyStates);
} else if(!empty((string)$vEvent->{'X-MICROSOFT-CDO-INTENDEDSTATUS'})) {
$properties["busystatus"] = array_search((string)$vEvent->{'X-MICROSOFT-CDO-INTENDEDSTATUS'}, $this->busyStates);
} else if(!empty((string)$vEvent->{'X-MICROSOFT-CDO-BUSYSTATUS'})) {
$properties["busystatus"] = array_search((string)$vEvent->{'X-MICROSOFT-CDO-BUSYSTATUS'}, $this->busyStates);
$fbType = (string)$vEvent->FBTYPE;
$msIntendedStatus = (string)$vEvent->{'X-MICROSOFT-CDO-INTENDEDSTATUS'};
$msBusyStatus = (string)$vEvent->{'X-MICROSOFT-CDO-BUSYSTATUS'};
if(!empty($fbType)) {
$properties["busystatus"] = array_search($fbType, $this->freeBusyStates);
} else if(!empty($msIntendedStatus)) {
$properties["busystatus"] = array_search($msIntendedStatus, $this->busyStates);
} else if(!empty($msBusyStatus)) {
$properties["busystatus"] = array_search($msBusyStatus, $this->busyStates);
} else {
$properties["busystatus"] = array_search("BUSY", $this->busyStates);
}
@ -702,15 +710,18 @@ 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);
}
if (!empty((string)$vEvent->{'LAST-MODIFIED'})) {
$lastModified = (string)$vEvent->{'LAST-MODIFIED'};
if (!empty($lastModified)) {
$properties["last_modification_time"] = (string)$vEvent->{'LAST-MODIFIED'}->getDateTime()->getTimestamp();
} else {
$properties["last_modification_time"] = time();
}
if (!empty((string)$vEvent->CREATED)) {
$created = (string)$vEvent->CREATED;
if (!empty($created)) {
$properties["creation_time"] = (string)$vEvent->CREATED->getDateTime()->getTimestamp();
} else {
$properties["creation_time"] = time();