Fill in the remaining properties for event exceptions - and add missing support for...
authorMichael J. Rubinsky <mrubinsk@horde.org>
Thu, 8 Apr 2010 14:34:09 +0000 (10:34 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Thu, 8 Apr 2010 14:34:09 +0000 (10:34 -0400)
framework/ActiveSync/lib/Horde/ActiveSync/Message/Appointment.php
kronolith/lib/Event.php

index 9e28da1..4f195b9 100644 (file)
@@ -668,18 +668,23 @@ class Horde_ActiveSync_Message_Appointment extends Horde_ActiveSync_Message_Base
     }
 
     /**
-     * TODO
+     * Set the appointment's body
      *
-     * @param <type> $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');
     }
 
     /**
index a1c8eae..5fae8bd 100644 (file)
@@ -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);
+
                     }
                 }