Indicate that an event is an exception in the ajax interface also
authorMichael J. Rubinsky <mrubinsk@horde.org>
Sat, 8 May 2010 17:50:06 +0000 (13:50 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Sat, 8 May 2010 17:50:06 +0000 (13:50 -0400)
kronolith/js/kronolith.js
kronolith/lib/Event.php
kronolith/templates/index/edit.inc

index 4a548ec..935aa9d 100644 (file)
@@ -4519,6 +4519,12 @@ KronolithCore = {
             }
         }
 
+        if (ev.bid) {
+            div = $('kronolithEventRepeatException');
+            div.down('span').update(ev.eod);
+            this.toggleRecurrence('Exception');
+        }
+
         /* Attendees */
         this.freeBusy = $H();
         if (this.attendeeStartDateHandler) {
@@ -4703,9 +4709,12 @@ KronolithCore = {
     toggleRecurrence: function(recur)
     {
         $('kronolithEventTabRecur').select('div').invoke('hide');
-        if (recur != 'None') {
+        if (recur == 'Exception') {
+            $('kronolithEventRepeatException').show();
+        } else if (recur != 'None') {
             $('kronolithEventRepeat' + recur).show();
             $('kronolithEventRepeatLength').show();
+            $('kronolithEventRepeatType').show();
         }
     },
 
index 98fc166..0ee26c2 100644 (file)
@@ -1534,6 +1534,11 @@ abstract class Kronolith_Event
         }
         if ($this->recurs()) {
             $json->r = $this->recurrence->getRecurType();
+        } elseif ($this->baseid) {
+            $json->bid = $this->baseid;
+            if ($this->exceptionoriginaldate) {
+                $json->eod = sprintf(_("%s at %s"), $this->exceptionoriginaldate->strftime($GLOBALS['prefs']->getValue('date_format')), $this->exceptionoriginaldate->strftime(($GLOBALS['prefs']->getValue('twentyFour') ? '%H:%M' : '%I:%M %p')));
+            }
         }
 
         if ($full) {
index bb5d8e5..ee19a1d 100644 (file)
 </div>
 
 <div id="kronolithEventTabRecur" class="kronolithTabsOption" style="display:none">
-  <?php printf(_("%s Don't repeat %s or repeat %s daily, %s weekly, %s monthly %s or %s yearly %s"),
-  '<label for="kronolithEventLinkNone"><input type="radio" name="recur" value="' . Horde_Date_Recurrence::RECUR_NONE . '" checked="checked" id="kronolithEventLinkNone" />', '</label>',
-  '<label for="kronolithEventLinkDaily"><input type="radio" name="recur" value="' . Horde_Date_Recurrence::RECUR_DAILY . '" id="kronolithEventLinkDaily" />', '</label>
-  <label for="kronolithEventLinkWeekly"><input type="radio" name="recur" value="' . Horde_Date_Recurrence::RECUR_WEEKLY . '" id="kronolithEventLinkWeekly" />', '</label>
-  <label for="kronolithEventLinkMonthly"><input type="radio" name="recur" value="' . Horde_Date_Recurrence::RECUR_MONTHLY_DATE . '" id="kronolithEventLinkMonthly" />', '</label>',
-  '<label for="kronolithEventLinkYearly"><input type="radio" name="recur" value="' . Horde_Date_Recurrence::RECUR_YEARLY_DATE . '" id="kronolithEventLinkYearly" />', '</label><br />') ?>
-
+  <div id="kronolithEventRepeatType" style="display:none">
+    <?php printf(_("%s Don't repeat %s or repeat %s daily, %s weekly, %s monthly %s or %s yearly %s"),
+    '<label for="kronolithEventLinkNone"><input type="radio" name="recur" value="' . Horde_Date_Recurrence::RECUR_NONE . '" checked="checked" id="kronolithEventLinkNone" />', '</label>',
+    '<label for="kronolithEventLinkDaily"><input type="radio" name="recur" value="' . Horde_Date_Recurrence::RECUR_DAILY . '" id="kronolithEventLinkDaily" />', '</label>
+    <label for="kronolithEventLinkWeekly"><input type="radio" name="recur" value="' . Horde_Date_Recurrence::RECUR_WEEKLY . '" id="kronolithEventLinkWeekly" />', '</label>
+    <label for="kronolithEventLinkMonthly"><input type="radio" name="recur" value="' . Horde_Date_Recurrence::RECUR_MONTHLY_DATE . '" id="kronolithEventLinkMonthly" />', '</label>',
+    '<label for="kronolithEventLinkYearly"><input type="radio" name="recur" value="' . Horde_Date_Recurrence::RECUR_YEARLY_DATE . '" id="kronolithEventLinkYearly" />', '</label><br />') ?>
+  </div>
   <div id="kronolithEventRepeatDaily" style="display:none">
     <?php printf(_("Repeat %s every day %s or %s every %s days %s"),
     '<label><input type="radio" name="recur_daily" value="1" checked="checked" />', '</label>',
     <label><input type="text" name="recur_count" id="kronolithEventRecurCount" value="" size="3" class="kronolithEventValue" />', '</label>') ?>
     <br />
   </div>
+  <div id="kronolithEventRepeatException" style="display:none"><?php printf(_("This is an exception to a recurring event originally scheduled on %s"), '<span id="recur_exception_original"></span>')?></div>
 </div>
 
 <div id="kronolithEventTabUrl" class="kronolithTabsOption" style="display:none">