|
|
@ -287,8 +287,9 @@ class CalendarModule extends Module
|
|
|
|
]);
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
|
|
// Add organizer
|
|
|
|
// Add organizer
|
|
|
|
if(!empty( $this->getProp($messageProps, "sender_email_address"))) {
|
|
|
|
$organizer = $this->getProp($messageProps, "sender_email_address");
|
|
|
|
$vEvent->add('ORGANIZER', 'mailto:' . $this->getProp($messageProps, "sender_email_address"));
|
|
|
|
if(!empty($organizer)) {
|
|
|
|
|
|
|
|
$vEvent->add('ORGANIZER', 'mailto:' . $organizer);
|
|
|
|
$vEvent->ORGANIZER['CN'] = $this->getProp($messageProps, "sender_name");
|
|
|
|
$vEvent->ORGANIZER['CN'] = $this->getProp($messageProps, "sender_name");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -302,7 +303,8 @@ class CalendarModule extends Module
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Add alarms
|
|
|
|
// 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', [
|
|
|
|
$vAlarm = $vEvent->add('VALARM', [
|
|
|
|
'ACTION' => 'DISPLAY',
|
|
|
|
'ACTION' => 'DISPLAY',
|
|
|
|
'DESCRIPTION' => $this->getProp($messageProps, "subject") // reuse the event summary
|
|
|
|
'DESCRIPTION' => $this->getProp($messageProps, "subject") // reuse the event summary
|
|
|
@ -319,7 +321,8 @@ class CalendarModule extends Module
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Add location
|
|
|
|
// Add location
|
|
|
|
if (!empty($this->getProp($messageProps, "location"))) {
|
|
|
|
$location = $this->getProp($messageProps, "location");
|
|
|
|
|
|
|
|
if (!empty($location)) {
|
|
|
|
$vEvent->add('LOCATION', $this->getProp($messageProps, "location"));
|
|
|
|
$vEvent->add('LOCATION', $this->getProp($messageProps, "location"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -330,10 +333,11 @@ class CalendarModule extends Module
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Add categories
|
|
|
|
// Add categories
|
|
|
|
if (!empty($this->getProp($messageProps, "categories"))) {
|
|
|
|
$categories = $this->getProp($messageProps, "categories");
|
|
|
|
$categories = array_map('trim', explode(';', trim($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["comment"] = (string)$vEvent->COMMENT;
|
|
|
|
$properties["timezone"] = (string)$vEvent->DTSTART["TZID"];
|
|
|
|
$properties["timezone"] = (string)$vEvent->DTSTART["TZID"];
|
|
|
|
$properties["organizer"] = (string)$vEvent->ORGANIZER;
|
|
|
|
$properties["organizer"] = (string)$vEvent->ORGANIZER;
|
|
|
|
if(!empty((string)$vEvent->FBTYPE)) {
|
|
|
|
|
|
|
|
$properties["busystatus"] = array_search((string)$vEvent->FBTYPE, $this->freeBusyStates);
|
|
|
|
$fbType = (string)$vEvent->FBTYPE;
|
|
|
|
} else if(!empty((string)$vEvent->{'X-MICROSOFT-CDO-INTENDEDSTATUS'})) {
|
|
|
|
$msIntendedStatus = (string)$vEvent->{'X-MICROSOFT-CDO-INTENDEDSTATUS'};
|
|
|
|
$properties["busystatus"] = array_search((string)$vEvent->{'X-MICROSOFT-CDO-INTENDEDSTATUS'}, $this->busyStates);
|
|
|
|
$msBusyStatus = (string)$vEvent->{'X-MICROSOFT-CDO-BUSYSTATUS'};
|
|
|
|
} else if(!empty((string)$vEvent->{'X-MICROSOFT-CDO-BUSYSTATUS'})) {
|
|
|
|
if(!empty($fbType)) {
|
|
|
|
$properties["busystatus"] = array_search((string)$vEvent->{'X-MICROSOFT-CDO-BUSYSTATUS'}, $this->busyStates);
|
|
|
|
$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 {
|
|
|
|
} else {
|
|
|
|
$properties["busystatus"] = array_search("BUSY", $this->busyStates);
|
|
|
|
$properties["busystatus"] = array_search("BUSY", $this->busyStates);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -702,15 +710,18 @@ class CalendarModule extends Module
|
|
|
|
//$properties["trigger"] = (string)$vEvent->COMMENT;
|
|
|
|
//$properties["trigger"] = (string)$vEvent->COMMENT;
|
|
|
|
$properties["priority"] = (string)$vEvent->PRIORITY;
|
|
|
|
$properties["priority"] = (string)$vEvent->PRIORITY;
|
|
|
|
$properties["private"] = ((string)$vEvent->CLASS) == "PRIVATE" ? true : false;
|
|
|
|
$properties["private"] = ((string)$vEvent->CLASS) == "PRIVATE" ? true : false;
|
|
|
|
if (!empty((string)$vEvent->{'X-ZARAFA-LABEL'})) {
|
|
|
|
$zLabel = (string)$vEvent->{'X-ZARAFA-LABEL'};
|
|
|
|
$properties["label"] = array_search((string)$vEvent->{'X-ZARAFA-LABEL'}, $this->labels);
|
|
|
|
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();
|
|
|
|
$properties["last_modification_time"] = (string)$vEvent->{'LAST-MODIFIED'}->getDateTime()->getTimestamp();
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
$properties["last_modification_time"] = time();
|
|
|
|
$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();
|
|
|
|
$properties["creation_time"] = (string)$vEvent->CREATED->getDateTime()->getTimestamp();
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
$properties["creation_time"] = time();
|
|
|
|
$properties["creation_time"] = time();
|
|
|
|