patch

Jan Schneider janmailing@gmx.de
Sun, 24 Jun 2001 00:33:08 +0200


---------------------- multipart/mixed attachment
Hi,

attached is another patch for kronolith.
It puts a delete button in the event edit page and makes sure that delete and 
cancel also works without javascript.

Jan.

::::::::::::::::::::::::::::::::::::::::
AMMMa AG - discover your knowledge
:::::::::::::::::::::::::::
Detmolder Str. 25-33 :: D-33604 Bielefeld
fon +49.521.96878-0 :: fax  +49.521.96878-20
http://www.ammma.de
::::::::::::::::::::::::::::::::::::::::::::::
---------------------- multipart/mixed attachment
Index: addeventaction.php
===================================================================
RCS file: /cvs/horde/kronolith/addeventaction.php,v
retrieving revision 1.22
diff -u -r1.22 addeventaction.php
--- addeventaction.php	2001/02/16 20:12:14	1.22
+++ addeventaction.php	2001/06/23 22:29:30
@@ -11,9 +11,11 @@
 define('KRONOLITH_BASE', dirname(__FILE__));
 require_once KRONOLITH_BASE . '/lib/base.php';

-$event = $calendar->getEventObject();
-$event->readFormData($HTTP_POST_VARS);
-$event->save();
+if (!isset($HTTP_POST_VARS['cancel'])) {
+    $event = $calendar->getEventObject();
+    $event->readFormData($HTTP_POST_VARS);
+    $event->save();
+}

 // get out of here
 header('Location: ' . Horde::applicationUrl('month.php?month='. $HTTP_POST_VARS['month'] . '&year=' . $HTTP_POST_VARS['year'], true));
Index: editeventaction.php
===================================================================
RCS file: /cvs/horde/kronolith/editeventaction.php,v
retrieving revision 1.22
diff -u -r1.22 editeventaction.php
--- editeventaction.php	2001/02/16 20:12:14	1.22
+++ editeventaction.php	2001/06/23 22:29:30
@@ -11,9 +11,15 @@
 define('KRONOLITH_BASE', dirname(__FILE__));
 require_once KRONOLITH_BASE . '/lib/base.php';

-$event = $calendar->getEventObject($HTTP_POST_VARS['eventID']);
-$event->readFormData($HTTP_POST_VARS);
-$event->save();
+if (!isset($HTTP_POST_VARS['cancel'])) {
+    if (isset($HTTP_POST_VARS['delete'])) {
+        $calendar->deleteEvent($HTTP_POST_VARS['eventID']);
+    } else {
+        $event = $calendar->getEventObject($HTTP_POST_VARS['eventID']);
+        $event->readFormData($HTTP_POST_VARS);
+        $event->save();
+    }
+}

 // get out of here
 header('Location: ' . Horde::applicationUrl('month.php?month='. $HTTP_POST_VARS['month'] . '&year=' . $HTTP_POST_VARS['year'], true));
Index: templates/edit/edit.inc
===================================================================
RCS file: /cvs/horde/kronolith/templates/edit/edit.inc,v
retrieving revision 1.23
diff -u -r1.23 edit.inc
--- templates/edit/edit.inc	2001/06/18 21:59:21	1.23
+++ templates/edit/edit.inc	2001/06/23 22:29:31
@@ -73,6 +73,9 @@
 <tr>
 <td align="right" colspan="2">
 <input type="submit" class="button" name="save" value="Save Event" />
+<?php if ($event->isInitialized()): ?>
+<input type="submit" class="button" name="delete" value="Delete Event" onclick="self.location = '<?= Horde::applicationUrl("delevent.php?eventID=" . $event->getID() . "&month=$month&year=$year") ?>'; return false;" />
+<?php endif; ?>
 <input type="submit" name="cancel" class="button" value="Cancel" onclick="self.location = '<?= Horde::applicationUrl("month.php?month=$month&year=$year") ?>'; return false;" />
 <input type="reset" name="reset" class="button" value="Reset to Defaults" />
 </td>

---------------------- multipart/mixed attachment--