From: Chuck Hagenbuch Date: Mon, 31 Aug 2009 18:01:57 +0000 (-0400) Subject: quickSave events are now created X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=cecfcb09e8d07638cc8041418455a8ba4eaae225;p=horde.git quickSave events are now created --- diff --git a/kronolith/lib/Kronolith.php b/kronolith/lib/Kronolith.php index 2ac18cab3..5c1b619fb 100644 --- a/kronolith/lib/Kronolith.php +++ b/kronolith/lib/Kronolith.php @@ -630,14 +630,19 @@ class Kronolith public function quickAdd($text, $calendar = null) { $text = trim($text); - list($title, $description) = explode($text, "\n", 2); + if (strpos($text, "\n") !== false) { + list($title, $description) = explode($text, "\n", 2); + } else { + $title = $text; + $description = ''; + } $title = trim($title); $description = trim($description); $dateParser = Horde_Date_Parser::factory(); $r = $dateParser->parse($title, array('return' => 'result')); if (!($d = $r->guess())) { - throw new Horde_Exception(_("Cannot parse event description.")); + throw new Horde_Exception(sprintf(_("Cannot parse event description \"%s\""), Horde_String::truncate($text))); } $title = $r->untaggedText(); @@ -645,6 +650,7 @@ class Kronolith $kronolith_driver = Kronolith::getDriver(null, $calendar); $event = $kronolith_driver->getEvent(); + $event->initialized = true; $event->setTitle($title); $event->setDescription($description); $event->start = $d;