From: Jan Schneider Date: Tue, 15 Jun 2010 20:08:35 +0000 (+0200) Subject: Fix saving copies if using different drivers for original and new calendar, or X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=28557b6800f6ec78389cfc22b2e3cd799e54ae2b;p=horde.git Fix saving copies if using different drivers for original and new calendar, or if not having edit pemissions on the original calendar. --- diff --git a/kronolith/lib/Ajax/Application.php b/kronolith/lib/Ajax/Application.php index 995154303..33b48a210 100644 --- a/kronolith/lib/Ajax/Application.php +++ b/kronolith/lib/Ajax/Application.php @@ -139,15 +139,20 @@ class Kronolith_Ajax_Application extends Horde_Ajax_Application_Base } } - try { - $event = $kronolith_driver->getEvent($this->_vars->event); - } catch (Horde_Exception_NotFound $e) { - $GLOBALS['notification']->push(_("The requested event was not found."), 'horde.error'); - return $result; - } catch (Exception $e) { - $GLOBALS['notification']->push($e); - return $result; + if ($this->_vars->as_new) { + $event = $kronolith_driver->getEvent(); + } else { + try { + $event = $kronolith_driver->getEvent($this->_vars->event); + } catch (Horde_Exception_NotFound $e) { + $GLOBALS['notification']->push(_("The requested event was not found."), 'horde.error'); + return $result; + } catch (Exception $e) { + $GLOBALS['notification']->push($e); + return $result; + } } + if (!$event->hasPermission(Horde_Perms::EDIT)) { $GLOBALS['notification']->push(_("You do not have permission to edit this event."), 'horde.warning'); return $result;