From: Michael J. Rubinsky Date: Sat, 17 Apr 2010 17:47:56 +0000 (-0400) Subject: Add support for categories (tags) when synching calendars X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=ae7f013f49a6febbbd837addbe80569be0ea1080;p=horde.git Add support for categories (tags) when synching calendars --- diff --git a/framework/ActiveSync/lib/Horde/ActiveSync/Message/Appointment.php b/framework/ActiveSync/lib/Horde/ActiveSync/Message/Appointment.php index 101ca7a59..05afb2678 100644 --- a/framework/ActiveSync/lib/Horde/ActiveSync/Message/Appointment.php +++ b/framework/ActiveSync/lib/Horde/ActiveSync/Message/Appointment.php @@ -717,18 +717,16 @@ class Horde_ActiveSync_Message_Appointment extends Horde_ActiveSync_Message_Base /** * Add a category to the appointment * - * TODO - * * @param string $category */ public function addCategory($category) { - + $this->categories[] = $category; } - public function getCategory() + public function getCategories() { - + return $this->categories; } /** diff --git a/kronolith/lib/Event.php b/kronolith/lib/Event.php index f465713b0..fbbe448ea 100644 --- a/kronolith/lib/Event.php +++ b/kronolith/lib/Event.php @@ -1083,6 +1083,12 @@ abstract class Kronolith_Event $this->addAttendee($attendee->email, Kronolith::PART_NONE, Kronolith::RESPONSE_NONE, $attendee->name); } + /* Categories (Tags) */ + $tags = $message->getCategories(); + foreach ($tags as $tag) { + $this->tags[] = Horde_String::convertCharset($tag, 'utf-8', Horde_Nls::getCharset()); + } + /* Flag that we are initialized */ $this->initialized = true; } @@ -1238,6 +1244,11 @@ abstract class Kronolith_Event /* Reminder */ $message->setReminder($this->alarm); + /* Categories (tags) */ + foreach ($this->tags as $tag) { + $message->addCategory(Horde_String::convertCharset($tag, Horde_Nls::getCharset(), 'utf-8')); + } + return $message; }