MFB: Fix editing URLs of remote calendars.
authorJan Schneider <jan@horde.org>
Wed, 25 Nov 2009 10:59:56 +0000 (11:59 +0100)
committerJan Schneider <jan@horde.org>
Wed, 25 Nov 2009 10:59:56 +0000 (11:59 +0100)
kronolith/docs/CHANGES
kronolith/lib/Forms/EditRemoteCalendar.php

index 8c3cf9a..d178e7d 100644 (file)
@@ -25,6 +25,7 @@ v3.0-git
 v2.3.3-cvs
 ----------
 
+[jan] Fix editing URLs of remote calendars.
 [gwr] Fixed recurring weekly events with fixed number of occurences but
       multiple incidences per week (kolab/issue3846).
 [gwr] Fixed recurring weekly events with intervals > 1 (Bug #8546).
index 9ba2ab6..1ce275d 100644 (file)
@@ -27,8 +27,10 @@ class Kronolith_EditRemoteCalendarForm extends Horde_Form {
     {
         parent::Horde_Form($vars, sprintf(_("Edit %s"), $remote_calendar['name']));
 
+        $this->addHidden('', 'url', 'text', true);
         $this->addVariable(_("Name"), 'name', 'text', true);
-        $this->addVariable(_("URL"), 'url', 'text', true);
+        $v = &$this->addVariable(_("URL"), 'new_url', 'text', true);
+        $v->setDefault($vars->get('url'));
         $this->addVariable(_("Username"), 'username', 'text', false);
         $this->addVariable(_("Password"), 'password', 'password', false);
 
@@ -39,6 +41,7 @@ class Kronolith_EditRemoteCalendarForm extends Horde_Form {
     {
         $name = trim($this->_vars->get('name'));
         $url = trim($this->_vars->get('url'));
+        $new_url = trim($this->_vars->get('new_url'));
         $username = trim($this->_vars->get('username'));
         $password = trim($this->_vars->get('password'));
 
@@ -58,7 +61,7 @@ class Kronolith_EditRemoteCalendarForm extends Horde_Form {
         foreach ($remote_calendars as $key => $calendar) {
             if ($calendar['url'] == $url) {
                 $remote_calendars[$key]['name'] = $name;
-                $remote_calendars[$key]['url'] = $url;
+                $remote_calendars[$key]['url'] = $new_url;
                 $remote_calendars[$key]['user'] = $username;
                 $remote_calendars[$key]['password'] = $password;
                 break;