Be more consistent with recurrence end naming.
authorJan Schneider <jan@horde.org>
Wed, 11 Nov 2009 18:12:19 +0000 (19:12 +0100)
committerJan Schneider <jan@horde.org>
Wed, 11 Nov 2009 18:48:21 +0000 (19:48 +0100)
kronolith/js/kronolith.js
kronolith/lib/Event.php
kronolith/templates/edit/edit.inc
kronolith/templates/edit/javascript.inc
kronolith/templates/index/edit.inc

index 6bd8e09..fce244b 100644 (file)
@@ -2450,13 +2450,13 @@ KronolithCore = {
                 div.down('input[name=recur_' + scheme.toLowerCase() + '_interval]').setValue(ev.r.i);
             }
             if (!Object.isUndefined(ev.r.e)) {
-                $('kronolithEventRepeatLength').down('input[name=recur_enddate_type][value=date]').setValue(true);
+                $('kronolithEventRepeatLength').down('input[name=recur_end_type][value=date]').setValue(true);
                 $('kronolithEventRecurDate').setValue(Date.parse(ev.r.e).toString(Kronolith.conf.date_format));
             } else if (!Object.isUndefined(ev.r.c)) {
-                $('kronolithEventRepeatLength').down('input[name=recur_enddate_type][value=count]').setValue(true);
+                $('kronolithEventRepeatLength').down('input[name=recur_end_type][value=count]').setValue(true);
                 $('kronolithEventRecurCount').setValue(ev.r.c);
             } else {
-                $('kronolithEventRepeatLength').down('input[name=recur_enddate_type][value=none]').setValue(true);
+                $('kronolithEventRepeatLength').down('input[name=recur_end_type][value=none]').setValue(true);
             }
         }
 
index 554edaf..9c4e616 100644 (file)
@@ -1925,8 +1925,8 @@ abstract class Kronolith_Event
             if (!isset($this->recurrence)) {
                 $this->recurrence = new Horde_Date_Recurrence($this->start);
             }
-            if (Horde_Util::getFormData('recur_enddate_type') == 'date') {
-                $recur_enddate = Horde_Util::getFormData('recur_enddate');
+            if (Horde_Util::getFormData('recur_end_type') == 'date') {
+                $recur_enddate = Horde_Util::getFormData('recur_end');
                 if ($this->recurrence->hasRecurEnd()) {
                     $recurEnd = $this->recurrence->recurEnd;
                     $recurEnd->month = $recur_enddate['month'];
@@ -1942,9 +1942,9 @@ abstract class Kronolith_Event
                               'year' => $recur_enddate['year']));
                 }
                 $this->recurrence->setRecurEnd($recurEnd);
-            } elseif (Horde_Util::getFormData('recur_enddate_type') == 'count') {
+            } elseif (Horde_Util::getFormData('recur_end_type') == 'count') {
                 $this->recurrence->setRecurCount(Horde_Util::getFormData('recur_count'));
-            } elseif (Horde_Util::getFormData('recur_enddate_type') == 'none') {
+            } elseif (Horde_Util::getFormData('recur_end_type') == 'none') {
                 $this->recurrence->setRecurCount(0);
                 $this->recurrence->setRecurEnd(null);
             }
@@ -2148,7 +2148,7 @@ abstract class Kronolith_Event
             $label = _("Duration Minute");
             break;
 
-        case 'recur_enddate[year]':
+        case 'recur_end[year]':
             if ($this->end) {
                 $end = ($this->recurs() && $this->recurrence->hasRecurEnd())
                         ? $this->recurrence->recurEnd->year
@@ -2161,7 +2161,7 @@ abstract class Kronolith_Event
                 '" type="text" onchange="' . $this->js($property) .
                 '" id="' . $this->_formIDEncode($property) . '" size="4" maxlength="4" />';
 
-        case 'recur_enddate[month]':
+        case 'recur_end[month]':
             if ($this->end) {
                 $sel = ($this->recurs() && $this->recurrence->hasRecurEnd())
                     ? $this->recurrence->recurEnd->month
@@ -2176,7 +2176,7 @@ abstract class Kronolith_Event
             $label = _("Recurrence End Month");
             break;
 
-        case 'recur_enddate[day]':
+        case 'recur_end[day]':
             if ($this->end) {
                 $sel = ($this->recurs() && $this->recurrence->hasRecurEnd())
                     ? $this->recurrence->recurEnd->mday
@@ -2217,11 +2217,11 @@ abstract class Kronolith_Event
         case 'end':
             return 'KronolithEventForm.updateWday(\'end_wday\'); updateDuration(); document.eventform.end_or_dur[0].checked = true;';
 
-        case 'recur_enddate[month]':
-        case 'recur_enddate[year]':
-        case 'recur_enddate[day]':
-        case 'recur_enddate':
-            return 'KronolithEventForm.updateWday(\'recur_end_wday\'); document.eventform.recur_enddate_type[1].checked = true;';
+        case 'recur_end[month]':
+        case 'recur_end[year]':
+        case 'recur_end[day]':
+        case 'recur_end':
+            return 'KronolithEventForm.updateWday(\'recur_end_wday\'); document.eventform.recur_end_type[1].checked = true;';
 
         case 'dur_day':
         case 'dur_hour':
index 2d69ed8..dae23bd 100644 (file)
@@ -323,10 +323,10 @@ if ($event->alarm) {
 <!-- recur end date -->
 <tr>
  <td class="rightAlign" valign="top">
-  <strong><?php echo Horde::label('recur_enddate_type', _("Recur Until")) ?></strong>
+  <strong><?php echo Horde::label('recur_end_type', _("Recur Until")) ?></strong>
  </td>
  <td colspan="3">
-  <input id="recurnoend" type="radio" class="checkbox" name="recur_enddate_type" value="none"<?php echo ($event->recurs() && ($event->recurrence->hasRecurEnd() || $event->recurrence->hasRecurCount()) ? '' : ' checked="checked"') ?> /><label for="recurnoend"> <?php echo _("No end date") ?></label>
+  <input id="recurnoend" type="radio" class="checkbox" name="recur_end_type" value="none"<?php echo ($event->recurs() && ($event->recurrence->hasRecurEnd() || $event->recurrence->hasRecurCount()) ? '' : ' checked="checked"') ?> /><label for="recurnoend"> <?php echo _("No end date") ?></label>
  </td>
 <?php if ($GLOBALS['browser']->hasFeature('dom')): ?>
  <td>&nbsp;</td>
@@ -335,8 +335,8 @@ if ($event->alarm) {
 <tr>
  <td>&nbsp;</td>
  <td colspan="3">
-  <input type="radio" class="checkbox" id="recur_enddate_type" name="recur_enddate_type" value="date"<?php echo ($event->recurs() && $event->recurrence->hasRecurEnd() ? ' checked="checked"' : '') ?> />
-  <?php echo $event->html('recur_enddate[year]') ?> - <?php echo $event->html('recur_enddate[month]') ?> - <?php echo $event->html('recur_enddate[day]') ?>
+  <input type="radio" class="checkbox" id="recur_end_type" name="recur_end_type" value="date"<?php echo ($event->recurs() && $event->recurrence->hasRecurEnd() ? ' checked="checked"' : '') ?> />
+  <?php echo $event->html('recur_end[year]') ?> - <?php echo $event->html('recur_end[month]') ?> - <?php echo $event->html('recur_end[day]') ?>
 <?php if ($GLOBALS['browser']->hasFeature('dom')): ?>
   <span id="recur_end_wday"></span>
   <script type="text/javascript">KronolithEventForm.updateWday('recur_end_wday');</script>
@@ -344,7 +344,7 @@ if ($event->alarm) {
  <td>
 <?php
     Horde::addScriptFile('open_calendar.js', 'horde', array('direct' => false));
-    echo Horde::link('#', _("Select a date"), '', '', 'openCalendar(\'recur_enddateimg\', \'recur_enddate\', \'' . addslashes($event->js('recur_enddate')) . '\'); return false;') . Horde::img('calendar.png', _("Set recurrence end date"), 'id="recur_enddateimg"', $GLOBALS['registry']->getImageDir('horde')) . '</a>';
+    echo Horde::link('#', _("Select a date"), '', '', 'openCalendar(\'recur_endimg\', \'recur_end\', \'' . addslashes($event->js('recur_end')) . '\'); return false;') . Horde::img('calendar.png', _("Set recurrence end date"), 'id="recur_endimg"', $GLOBALS['registry']->getImageDir('horde')) . '</a>';
 endif;
 ?>
  </td>
@@ -352,8 +352,8 @@ endif;
 <tr>
  <td>&nbsp;</td>
  <td colspan="3">
-  <input type="radio" class="checkbox" name="recur_enddate_type" value="count"<?php echo ($event->recurs() && $event->recurrence->getRecurCount() ? ' checked="checked"' : '') ?> />
-  <input type="text" id="recur_count" name="recur_count" size="2" onkeypress="document.eventform.recur_enddate_type[2].checked = true;" onchange="document.eventform.recur_enddate_type[2].checked = true;" value="<?php if ($event->recurs() && $event->recurrence->getRecurCount()) echo $event->recurrence->getRecurCount() ?>" />
+  <input type="radio" class="checkbox" name="recur_end_type" value="count"<?php echo ($event->recurs() && $event->recurrence->getRecurCount() ? ' checked="checked"' : '') ?> />
+  <input type="text" id="recur_count" name="recur_count" size="2" onkeypress="document.eventform.recur_end_type[2].checked = true;" onchange="document.eventform.recur_end_type[2].checked = true;" value="<?php if ($event->recurs() && $event->recurrence->getRecurCount()) echo $event->recurrence->getRecurCount() ?>" />
   <label for="recur_count"><?php echo _("recurrences") ?></label>
  </td>
 <?php if ($GLOBALS['browser']->hasFeature('dom')): ?>
index 710ce14..4f3284b 100644 (file)
@@ -82,9 +82,9 @@ KronolithEventForm.updateWday = function(span)
 <?php if (!Horde_Util::nonInputVar('issearch')): ?>
     } else if (span == 'recur_end_wday') {
         spanObj = $('recur_end_wday');
-        day = $('recur_enddate_day').value;
-        month = $('recur_enddate_month').value - 1;
-        year = $('recur_enddate_year').value;
+        day = $('recur_end_day').value;
+        month = $('recur_end_month').value - 1;
+        year = $('recur_end_year').value;
 <?php endif; ?>
     }
     date = new Date(year, month, day)
index a9588c0..ca2fcaa 100644 (file)
   </div>
   <div id="kronolithEventRepeatLength" style="display:none">
     <?php echo _("Stop") ?>
-    <label><input type="radio" name="recur_enddate_type" value="none" checked="checked" /> <?php echo _("never") ?></label>,
+    <label><input type="radio" name="recur_end_type" value="none" checked="checked" /> <?php echo _("never") ?></label>,
     <?php echo _("or") ?>
-    <label><input type="radio" name="recur_enddate_type" value="date" /> <?php echo _("at") ?></label>
+    <label><input type="radio" name="recur_end_type" value="date" /> <?php echo _("at") ?></label>
     <input type="text" name="recur_end_date" id="kronolithEventRecurDate" size="10" class="kronolithDatePicker" />
     <?php echo _(", or") ?>
-    <label><input type="radio" name="recur_enddate_type" value="count" /> <?php echo _("after") ?></label>
+    <label><input type="radio" name="recur_end_type" value="count" /> <?php echo _("after") ?></label>
     <label><input type="text" name="recur_count" id="kronolithEventRecurCount" value="" size="2" class="kronolithEventValue" /> <?php echo _("recurrences") ?></label>
     <br />
   </div>