more ical fields

This commit is contained in:
Christoph Haas 2012-12-09 18:50:41 +00:00
parent 302f50b16a
commit d7ea948372

View File

@ -103,7 +103,7 @@ class CalendarexporterModule extends Module {
} }
private function writeICSHead($fh, $calname) { private function writeICSHead($fh, $calname) {
$icshead = "BEGIN:VCALENDAR\nVERSION:2.0\nPRODID:-//Zarafa Webapp//Zarafa Calendar Exporter//DE\nMETHOD:PUBLISH\nX-WR-CALNAME:" . $calname. "\nX-WR-TIMEZONE: " . date("e") . "\n"; $icshead = "BEGIN:VCALENDAR\nVERSION:2.0\nPRODID:-//Zarafa Webapp//Zarafa Calendar Exporter//DE\nMETHOD:PUBLISH\nX-WR-CALNAME:" . $calname. "\nX-WR-TIMEZONE:" . date("e") . "\n";
fwrite($fh, $icshead); fwrite($fh, $icshead);
} }
@ -120,21 +120,30 @@ class CalendarexporterModule extends Module {
$head = "BEGIN:VEVENT\n"; $head = "BEGIN:VEVENT\n";
$end = "END:VEVENT\n"; $end = "END:VEVENT\n";
$busystate = array("FREE", "TENTATIVE", "BUSY", "OOF");
$fields = array( $fields = array(
"UID" => $this->randomstring(10) . "-" . $this->randomstring(5) . "-ics@zarafa-export-plugin", // generate uid "UID" => $this->randomstring(10) . "-" . $this->randomstring(5) . "-ics@zarafa-export-plugin", // generate uid
"DTSTART" => $this->getIcalDate($event["commonstart"]) . "Z", // this times are utc! "DTSTART" => $this->getIcalDate($event["commonstart"]) . "Z", // this times are utc!
"DTEND" => $this->getIcalDate($event["commonend"]) . "Z", "DTEND" => $this->getIcalDate($event["commonend"]) . "Z",
"DTSTAMP" => $this->getIcalDate($event["creation_time"]) . "Z", "DTSTAMP" => $this->getIcalDate($event["creation_time"]) . "Z",
"DESCRIPTION" => str_replace("\n", "\\n",$event["description"]), "CREATED" => $this->getIcalDate($event["creation_time"]) . "Z",
"LOCATION" => $event["location"], "X-MICROSOFT-CDO-BUSYSTATUS" => $busystate[$event["busystatus"]],
"SUMMARY" => $event["subject"] "LAST-MODIFIED" => $this->getIcalDate($event["last_modification_time"]),
"DESCRIPTION" => str_replace("\n", "\\n",$event["description"]),
"LOCATION" => $event["location"],
"SUMMARY" => $event["subject"],
// some static content...
"TRANSP" => "OPAQUE",
"SEQUENCE" => "0"
); );
fwrite($fh, $head); fwrite($fh, $head);
// event fields: // event fields:
foreach ($fields as $key => $value) { foreach ($fields as $key => $value) {
fwrite($fh, $key . ": " . $value . "\n"); fwrite($fh, $key . ":" . $value . "\n");
} }
unset($fields); unset($fields);