From b4e7a87196c677608dc237e086f775bf30590507 Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Thu, 8 Apr 2010 10:34:09 -0400 Subject: [PATCH] Fill in the remaining properties for event exceptions - and add missing support for the body (kronolith's Notes field) element. --- .../lib/Horde/ActiveSync/Message/Appointment.php | 13 +++++++---- kronolith/lib/Event.php | 26 ++++++++++++++++++++++ 2 files changed, 35 insertions(+), 4 deletions(-) diff --git a/framework/ActiveSync/lib/Horde/ActiveSync/Message/Appointment.php b/framework/ActiveSync/lib/Horde/ActiveSync/Message/Appointment.php index 9e28da1ca..4f195b92a 100644 --- a/framework/ActiveSync/lib/Horde/ActiveSync/Message/Appointment.php +++ b/framework/ActiveSync/lib/Horde/ActiveSync/Message/Appointment.php @@ -668,18 +668,23 @@ class Horde_ActiveSync_Message_Appointment extends Horde_ActiveSync_Message_Base } /** - * TODO + * Set the appointment's body * - * @param $body + * @param string $body UTF-8 encoded string */ public function setBody($body) { - + $this->_properties['body'] = $body; } + /** + * Get the appointment's body + * + * @return string UTF-8 encoded string + */ public function getBody() { - + return $this->_getAttribute('body'); } /** diff --git a/kronolith/lib/Event.php b/kronolith/lib/Event.php index a1c8eae3e..5fae8bd4b 100644 --- a/kronolith/lib/Event.php +++ b/kronolith/lib/Event.php @@ -1171,7 +1171,33 @@ abstract class Kronolith_Event if ($key !== false) { unset($exceptions[$key]); } + + /* Remaining properties that could be different */ + $e->setSubject(Horde_String::convertCharset($exception->getTitle(), Horde_Nls::getCharset(), 'utf-8')); + $e->setLocation(Horde_String::convertCharset($exception->location, Horde_Nls::getCharset(), 'utf-8')); + $e->setBody(Horde_String::convertCharset($exception->description, Horde_Nls::getCharset(), 'utf-8')); + + $e->setSensitivity($exception->private ? 'private' : 'normal'); + $e->setReminder($exception->alarm); + $e->setDTStamp($_SERVER['REQUEST_TIME']); + /* Response Status */ + switch ($exception->status) { + case Kronolith::STATUS_CANCELLED: + $status = 'declined'; + break; + case Kronolith::STATUS_CONFIRMED: + $status = 'accepted'; + break; + case Kronolith::STATUS_TENTATIVE: + $status = 'tenative'; + case Kronolith::STATUS_FREE: + case Kronolith::STATUS_NONE: + $status = 'none'; + } + $e->setResponseType($status); + $message->addexception($e); + } } -- 2.11.0