Save recurrence exceptions when copying events (Bug #7689).
authorJan Schneider <jan@horde.org>
Mon, 30 Mar 2009 16:52:59 +0000 (18:52 +0200)
committerJan Schneider <jan@horde.org>
Mon, 30 Mar 2009 16:53:40 +0000 (18:53 +0200)
kronolith/docs/CHANGES
kronolith/lib/Event.php
kronolith/templates/edit/edit.inc

index 88b677d..d4773a8 100644 (file)
@@ -17,6 +17,7 @@ v3.0-git
 v2.3.1-cvs
 ----------
 
+[jan] Save recurrence exceptions when copying events (Bug #7689).
 [jan] Prevent warnings if trying to add address lists as attendees (Bug #7834).
 [jan] Fix start and end time calculation of multi-day events (Bug #7788).
 [jan] Wrap URL in calendar information in IE7 (almarin@um.es, Bug #8043).
index c323190..13cf16a 100644 (file)
@@ -1788,6 +1788,14 @@ abstract class Kronolith_Event
                 $this->recurrence->setRecurInterval(Util::getFormData('recur_yearly_weekday_interval', 1));
                 break;
             }
+
+            if ($exceptions = Util::getFormData('exceptions')) {
+                foreach ($exceptions as $exception) {
+                    $this->recurrence->addException((int)substr($exception, 0, 4),
+                                                    (int)substr($exception, 4, 2),
+                                                    (int)substr($exception, 6, 2));
+                }
+            }
         }
 
         // Tags.
index 80132e5..ad08ca8 100644 (file)
@@ -350,14 +350,16 @@ endif;
 <?php endif; ?>
 </tr>
 
-<?php if ($event->recurs() && $event->recurrence->getExceptions()): ?>
+<?php if ($event->recurs() && ($exceptions = $event->recurrence->getExceptions())): ?>
 <!-- exceptions -->
 <tr>
  <td class="rightAlign" valign="top">
   <strong><?php echo _("Exceptions") ?></strong>
  </td>
  <td colspan="4">
-  <?php echo $event->exceptionsList(); ?>
+ <?php echo $event->exceptionsList(); foreach($exceptions as $exception): ?>
+ <input type="hidden" name="exceptions[]" value="<?php echo $exception ?>" />
+ <?php endforeach; ?>
  </td>
 </tr>
 <?php endif; ?>