Fix deleting and moving events through the event form.
authorJan Schneider <jan@horde.org>
Mon, 16 Nov 2009 17:58:01 +0000 (18:58 +0100)
committerJan Schneider <jan@horde.org>
Mon, 16 Nov 2009 17:58:01 +0000 (18:58 +0100)
kronolith/js/kronolith.js
kronolith/templates/index/edit.inc

index 366e163..c67767c 100644 (file)
@@ -2225,10 +2225,16 @@ KronolithCore = {
                                   if (r.response.deleted) {
                                       this._removeEvent(eventid, cal);
                                   } else {
-                                      $('kronolithBody').select('div').findAll(function(el) { return el.retrieve('calendar') == cal && el.retrieve('eventid') == eventid; }).invoke('toggle');
+                                      $('kronolithBody').select('div').findAll(function(el) {
+                                          return el.retrieve('calendar') == cal &&
+                                              el.retrieve('eventid') == eventid;
+                                      }).invoke('toggle');
                                   }
                               }.bind(this));
-                $('kronolithBody').select('div').findAll(function(el) { return el.retrieve('calendar') == cal && el.retrieve('eventid') == eventid; }).invoke('hide');
+                $('kronolithBody').select('div').findAll(function(el) {
+                    return el.retrieve('calendar') == cal &&
+                        el.retrieve('eventid') == eventid;
+                }).invoke('hide');
                 this._closeRedBox();
                 window.history.back();
                 e.stop();
@@ -2539,7 +2545,7 @@ KronolithCore = {
             RedBox.onDisplay = null;
         };
 
-        this.updateCalendarDropDown('kronolithEventCalendar');
+        this.updateCalendarDropDown('kronolithEventTarget');
         $('kronolithEventForm').enable();
         $('kronolithEventForm').reset();
         this.doAction('ListTopTags', {}, this._topTags);
@@ -2550,7 +2556,8 @@ KronolithCore = {
             $('kronolithEventTags').autocompleter.init();
             var d = date ? this.parseDate(date) : new Date();
             $('kronolithEventId').clear();
-            $('kronolithEventCalendar').setValue(Kronolith.conf.default_calendar);
+            $('kronolithEventCalendar').clear();
+            $('kronolithEventTarget').setValue(Kronolith.conf.default_calendar);
             $('kronolithEventDelete').hide();
             $('kronolithEventStartDate').setValue(d.toString(Kronolith.conf.date_format));
             $('kronolithEventStartTime').setValue(d.toString(Kronolith.conf.time_format));
@@ -2647,6 +2654,7 @@ KronolithCore = {
         /* Basic information */
         $('kronolithEventId').setValue(ev.id);
         $('kronolithEventCalendar').setValue(ev.ty + '|' + ev.c);
+        $('kronolithEventTarget').setValue(ev.ty + '|' + ev.c);
         $('kronolithEventTitle').setValue(ev.t);
         $('kronolithEventLocation').setValue(ev.l);
         $('kronolithEventAllday').setValue(ev.al);
index ca2fcaa..f01114d 100644 (file)
@@ -1,6 +1,7 @@
 <div id="kronolithEventDialog" style="display:none">
 <form id="kronolithEventForm" action="">
 <input id="kronolithEventId" type="hidden" name="id" />
+<input id="kronolithEventCalendar" type="hidden" name="cal" />
 
 <div>
   <label for="kronolithEventTitle"><?php echo _("Event title") ?>:</label><br />
@@ -10,7 +11,7 @@
 <table cellspacing="0" cellpadding="0" border="0"><tbody><tr>
   <td>
     <label for="kronolithEventCalendar"><?php echo _("Calendar") ?>:</label><br />
-    <select name="cal" id="kronolithEventCalendar">
+    <select name="targetcalendar" id="kronolithEventTarget">
     </select>
   </td>
   <td>