From: Michael J. Rubinsky Date: Thu, 29 Jan 2009 22:13:00 +0000 (-0500) Subject: Add tag field to the edit and create calendar forms X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=16c24dd261e086bbdcd5df204d5f4210988b56c8;p=horde.git Add tag field to the edit and create calendar forms --- diff --git a/kronolith/lib/Forms/CreateCalendar.php b/kronolith/lib/Forms/CreateCalendar.php index 61a098a57..685da9699 100755 --- a/kronolith/lib/Forms/CreateCalendar.php +++ b/kronolith/lib/Forms/CreateCalendar.php @@ -32,6 +32,7 @@ class Kronolith_CreateCalendarForm extends Horde_Form { $this->addVariable(_("Name"), 'name', 'text', true); $this->addVariable(_("Description"), 'description', 'longtext', false, false, null, array(4, 60)); + $this->addVariable(_("Tags"), 'tags', 'text', false); $this->setButtons(array(_("Create"))); } @@ -44,6 +45,8 @@ class Kronolith_CreateCalendarForm extends Horde_Form { } $calendar->set('name', $this->_vars->get('name')); $calendar->set('desc', $this->_vars->get('description')); + $tagger = new Kronolith_Tagger(); + $tagger->tag($calendar->getName(), $this->_vars->get('tags'), 'calendar'); return $GLOBALS['kronolith_shares']->addShare($calendar); } diff --git a/kronolith/lib/Forms/EditCalendar.php b/kronolith/lib/Forms/EditCalendar.php index ee76076d7..079db82f3 100644 --- a/kronolith/lib/Forms/EditCalendar.php +++ b/kronolith/lib/Forms/EditCalendar.php @@ -39,6 +39,7 @@ class Kronolith_EditCalendarForm extends Horde_Form { $this->addHidden('', 'c', 'text', true); $this->addVariable(_("Name"), 'name', 'text', true); $this->addVariable(_("Description"), 'description', 'longtext', false, false, null, array(4, 60)); + $this->addVariable(_("Tags"), 'tags', 'text', false); $this->setButtons(array(_("Save"))); } @@ -59,6 +60,9 @@ class Kronolith_EditCalendarForm extends Horde_Form { if (is_a($result, 'PEAR_Error')) { return PEAR::raiseError(sprintf(_("Unable to save calendar \"%s\": %s"), $new_name, $result->getMessage())); } + + $tagger = new Kronolith_Tagger(); + $tagger->replaceTags($this->_calendar->getName(), $this->_vars->get('tags'), 'calendar'); return true; }