<td></td>
<td colspan="4" class="warning">
<?php echo _("This is a recurring event. Edit the current event only, this occurrence<br />and all future occurences, all occurences, or save this event as new?") ?><br /><br />
- <input type="radio" name="edit_recur" value="current" id="edit_current" onclick="setStartDate($F('recur_ex'))" /> <?php echo Horde::label('edit_current', _("Current")) ?>
- <input type="radio" name="edit_recur" value="future" id="edit_future" onclick="setStartDate($F('recur_ex'))" /> <?php echo Horde::label('edit_future', _("Future")) ?>
+ <input type="radio" name="edit_recur" value="current" id="edit_current" onclick="KronolithEventForm.setStartDate($F('recur_ex'))" /> <?php echo Horde::label('edit_current', _("Current")) ?>
+ <input type="radio" name="edit_recur" value="future" id="edit_future" onclick="KronolithEventForm.setStartDate($F('recur_ex'))" /> <?php echo Horde::label('edit_future', _("Future")) ?>
<input type="radio" name="edit_recur" value="all" id="edit_all" checked="checked" /> <?php echo Horde::label('edit_all', _("All")) ?>
<input type="radio" name="edit_recur" value="copy" id="edit_copy" /> <?php echo Horde::label('edit_copy', _("Save As New")) ?>
<input type="hidden" name="recur_ex" id="recur_ex" value="<?php echo Util::getFormData('datetime') ?>" />
<td colspan="4">
<?php echo implode("\n", $buttons) ?>
<?php echo Horde::link(htmlspecialchars($cancelurl), '', 'button') . _("Cancel") . '</a>' ?>
- <input type="button" name="resetButton" class="button" value="<?php echo _("Reset to Defaults") ?>" onclick="document.eventform.reset(); updateWday('start_wday'); updateWday('end_wday');" />
+ <input type="button" name="resetButton" class="button" value="<?php echo _("Reset to Defaults") ?>" onclick="document.eventform.reset(); KronolithEventForm.updateWday('start_wday'); KronolithEventForm.updateWday('end_wday');" />
</td>
</tr>
}
?>
<tr>
- <td colspan="5" class="control toggle" onclick="toggleSection('alarm')">
+ <td colspan="5" class="control toggle" onclick="KronolithEventForm.toggleSection('alarm')">
<?php echo Horde::img('tree/blank.png', '', array('id' => 'toggle_alarm'), $GLOBALS['registry']->getImageDir('horde')) . ' <strong>' . Horde::label('alarm', _("_Alarm")) ?></strong>
<span class="extra" id="extra_alarm"><?php if ($alarm_set) printf(_("%d %s before the event starts"), $alarm_value, $alarm_unit_title); ?></span>
</td>
<strong><?php echo _("Notification") ?></strong>
</td>
<td valign="top">
- <input id="nooverwrite" name="alarm_change_method" type="radio" class="checkbox" value="0"<?php if (empty($event->methods)) echo ' checked="checked"' ?> onclick="toggleAlarmMethods()" /><br />
- <input id="yesoverwrite" name="alarm_change_method" type="radio" class="checkbox" value="1"<?php if (!empty($event->methods)) echo ' checked="checked"' ?> onclick="toggleAlarmMethods()" />
+ <input id="nooverwrite" name="alarm_change_method" type="radio" class="checkbox" value="0"<?php if (empty($event->methods)) echo ' checked="checked"' ?> onclick="KronolithEventForm.toggleAlarmMethods()" /><br />
+ <input id="yesoverwrite" name="alarm_change_method" type="radio" class="checkbox" value="1"<?php if (!empty($event->methods)) echo ' checked="checked"' ?> onclick="KronolithEventForm.toggleAlarmMethods()" />
</td>
<td> </td>
<td valign="top" colspan="2">
<!-- description -->
<tr>
- <td colspan="5" class="control toggle" onclick="toggleSection('description')">
+ <td colspan="5" class="control toggle" onclick="KronolithEventForm.toggleSection('description')">
<?php echo Horde::img('tree/blank.png', '', array('id' => 'toggle_description'), $GLOBALS['registry']->getImageDir('horde')) . ' <strong>' . Horde::label('description', _("Descri_ption")) ?></strong>
<span class="extra" id="extra_description"><?php echo htmlspecialchars(substr(str_replace(array("\r", "\n"), '', $event->getDescription()), 0, 80)) ?></span>
</td>
<!-- attendees -->
<tr>
- <td colspan="5" class="control toggle" onclick="toggleSection('attendees')">
+ <td colspan="5" class="control toggle" onclick="KronolithEventForm.toggleSection('attendees')">
<?php echo Horde::img('tree/blank.png', '', array('id' => 'toggle_attendees'), $GLOBALS['registry']->getImageDir('horde')) . ' <strong>' . _("Attendees") ?></strong>
<span class="extra"><?php echo htmlspecialchars(Kronolith::attendeeList()) ?></span>
</td>
<!-- recurrence -->
<tr>
- <td colspan="5" class="control toggle" onclick="toggleSection('recurrence')">
+ <td colspan="5" class="control toggle" onclick="KronolithEventForm.toggleSection('recurrence')">
<?php echo Horde::img('tree/blank.png', '', array('id' => 'toggle_recurrence'), $GLOBALS['registry']->getImageDir('horde')) . ' <strong>' . _("Recurrence") ?></strong>
<span class="extra" id="extra_recurrence"><?php echo $event->getRecurName(); if ($event->recurs()) echo $event->recurrence->hasRecurEnd() ? sprintf(_(" until %s"), $event->recurrence->recurEnd->strftime($GLOBALS['prefs']->getValue('date_format')) . ($this->event->recurrence->recurEnd->hour == 23 && $this->event->recurrence->recurEnd->min == 59 ? '' : ' ' . $this->event->recurrence->recurEnd->format($GLOBALS['prefs']->getValue('twentyFour') ? 'G:i' : 'g:ia'))) : ($event->recurrence->getRecurCount() ? sprintf(_(", %d times"), $event->recurrence->getRecurCount()) : _(" without end")) ?></span>
</td>
<table cellspacing="0" width="100%">
<tr>
<td class="nowrap">
- <input id="recurnone" type="radio" class="checkbox" name="recur" onclick="clearFields(0);" value="<?php echo Horde_Date_Recurrence::RECUR_NONE ?>"<?php if (!$event->recurs()) echo ' checked="checked"' ?> /><label for="recurnone"> <?php echo _("No recurrence") ?></label>
+ <input id="recurnone" type="radio" class="checkbox" name="recur" onclick="KronolithEventForm.clearFields(0);" value="<?php echo Horde_Date_Recurrence::RECUR_NONE ?>"<?php if (!$event->recurs()) echo ' checked="checked"' ?> /><label for="recurnone"> <?php echo _("No recurrence") ?></label>
</td>
</tr>
<tr>
<td class="nowrap">
- <input id="recurdaily" type="radio" class="checkbox" name="recur" onclick="setInterval('recur_daily_interval');" value="<?php echo Horde_Date_Recurrence::RECUR_DAILY ?>"<?php if ($event->recurs() && $event->recurrence->hasRecurType(Horde_Date_Recurrence::RECUR_DAILY)) echo ' checked="checked"' ?> /><label for="recurdaily"> <?php echo _("Daily: Recurs every") ?> </label>
- <input type="text" id="recur_daily_interval" name="recur_daily_interval" size="2" onkeypress="setRecur(1);" onchange="setRecur(1);" value="<?php echo $event->recurs() && $event->recurrence->hasRecurType(Horde_Date_Recurrence::RECUR_DAILY) ? $event->recurrence->getRecurInterval() : '' ?>" /> <?php echo Horde::label('recur_daily_interval', _("day(s)")) ?>
+ <input id="recurdaily" type="radio" class="checkbox" name="recur" onclick="KronolithEventForm.setInterval('recur_daily_interval');" value="<?php echo Horde_Date_Recurrence::RECUR_DAILY ?>"<?php if ($event->recurs() && $event->recurrence->hasRecurType(Horde_Date_Recurrence::RECUR_DAILY)) echo ' checked="checked"' ?> /><label for="recurdaily"> <?php echo _("Daily: Recurs every") ?> </label>
+ <input type="text" id="recur_daily_interval" name="recur_daily_interval" size="2" onkeypress="KronolithEventForm.setRecur(1);" onchange="KronolithEventForm.setRecur(1);" value="<?php echo $event->recurs() && $event->recurrence->hasRecurType(Horde_Date_Recurrence::RECUR_DAILY) ? $event->recurrence->getRecurInterval() : '' ?>" /> <?php echo Horde::label('recur_daily_interval', _("day(s)")) ?>
</td>
</tr>
<tr>
<td class="nowrap">
- <input id="recurweekly" type="radio" class="checkbox" name="recur" onclick="setInterval('recur_weekly_interval');" value="<?php echo Horde_Date_Recurrence::RECUR_WEEKLY ?>"<?php if ($event->recurs() && $event->recurrence->hasRecurType(Horde_Date_Recurrence::RECUR_WEEKLY)) echo ' checked="checked"' ?> /><label for="recurweekly"> <?php echo _("Weekly: Recurs every") ?> </label>
- <input type="text" id="recur_weekly_interval" name="recur_weekly_interval" size="2" onkeypress="setRecur(2);" onchange="setRecur(2);" value="<?php echo $event->recurs() && $event->recurrence->hasRecurType(Horde_Date_Recurrence::RECUR_WEEKLY) ? $event->recurrence->getRecurInterval() : '' ?>" />
+ <input id="recurweekly" type="radio" class="checkbox" name="recur" onclick="KronolithEventForm.setInterval('recur_weekly_interval');" value="<?php echo Horde_Date_Recurrence::RECUR_WEEKLY ?>"<?php if ($event->recurs() && $event->recurrence->hasRecurType(Horde_Date_Recurrence::RECUR_WEEKLY)) echo ' checked="checked"' ?> /><label for="recurweekly"> <?php echo _("Weekly: Recurs every") ?> </label>
+ <input type="text" id="recur_weekly_interval" name="recur_weekly_interval" size="2" onkeypress="KronolithEventForm.setRecur(2);" onchange="KronolithEventForm.setRecur(2);" value="<?php echo $event->recurs() && $event->recurrence->hasRecurType(Horde_Date_Recurrence::RECUR_WEEKLY) ? $event->recurrence->getRecurInterval() : '' ?>" />
<?php echo Horde::label('recur_weekly_interval', _("week(s) on:")) ?><br />
- <label for="mo"><?php echo _("Mo") ?></label><input id="mo" type="checkbox" class="checkbox" name="weekly[]" onclick="setInterval('recur_weekly_interval');setRecur(2);" value="<?php echo Horde_Date::MASK_MONDAY ?>"<?php if ($event->recurs() && $event->recurrence->recurOnDay(Horde_Date::MASK_MONDAY)) echo ' checked="checked"' ?> />
- <label for="tu"><?php echo _("Tu") ?></label><input id="tu" type="checkbox" class="checkbox" name="weekly[]" onclick="setInterval('recur_weekly_interval');setRecur(2);" value="<?php echo Horde_Date::MASK_TUESDAY ?>"<?php if ($event->recurs() && $event->recurrence->recurOnDay(Horde_Date::MASK_TUESDAY)) echo ' checked="checked"' ?> />
- <label for="we"><?php echo _("We") ?></label><input id="we" type="checkbox" class="checkbox" name="weekly[]" onclick="setInterval('recur_weekly_interval');setRecur(2);" value="<?php echo Horde_Date::MASK_WEDNESDAY ?>"<?php if ($event->recurs() && $event->recurrence->recurOnDay(Horde_Date::MASK_WEDNESDAY)) echo ' checked="checked"' ?> />
- <label for="th"><?php echo _("Th") ?></label><input id="th" type="checkbox" class="checkbox" name="weekly[]" onclick="setInterval('recur_weekly_interval');setRecur(2);" value="<?php echo Horde_Date::MASK_THURSDAY ?>"<?php if ($event->recurs() && $event->recurrence->recurOnDay(Horde_Date::MASK_THURSDAY)) echo ' checked="checked"' ?> />
- <label for="fr"><?php echo _("Fr") ?></label><input id="fr" type="checkbox" class="checkbox" name="weekly[]" onclick="setInterval('recur_weekly_interval');setRecur(2);" value="<?php echo Horde_Date::MASK_FRIDAY ?>"<?php if ($event->recurs() && $event->recurrence->recurOnDay(Horde_Date::MASK_FRIDAY)) echo ' checked="checked"' ?> />
- <label for="sa"><?php echo _("Sa") ?></label><input id="sa" type="checkbox" class="checkbox" name="weekly[]" onclick="setInterval('recur_weekly_interval');setRecur(2);" value="<?php echo Horde_Date::MASK_SATURDAY ?>"<?php if ($event->recurs() && $event->recurrence->recurOnDay(Horde_Date::MASK_SATURDAY)) echo ' checked="checked"' ?> />
- <label for="su"><?php echo _("Su") ?></label><input id="su" type="checkbox" class="checkbox" name="weekly[]" onclick="setInterval('recur_weekly_interval');setRecur(2);" value="<?php echo Horde_Date::MASK_SUNDAY ?>"<?php if ($event->recurs() && $event->recurrence->recurOnDay(Horde_Date::MASK_SUNDAY)) echo ' checked="checked"' ?> />
+ <label for="mo"><?php echo _("Mo") ?></label><input id="mo" type="checkbox" class="checkbox" name="weekly[]" onclick="KronolithEventForm.setInterval('recur_weekly_interval');KronolithEventForm.setRecur(2);" value="<?php echo Horde_Date::MASK_MONDAY ?>"<?php if ($event->recurs() && $event->recurrence->recurOnDay(Horde_Date::MASK_MONDAY)) echo ' checked="checked"' ?> />
+ <label for="tu"><?php echo _("Tu") ?></label><input id="tu" type="checkbox" class="checkbox" name="weekly[]" onclick="KronolithEventForm.setInterval('recur_weekly_interval');KronolithEventForm.setRecur(2);" value="<?php echo Horde_Date::MASK_TUESDAY ?>"<?php if ($event->recurs() && $event->recurrence->recurOnDay(Horde_Date::MASK_TUESDAY)) echo ' checked="checked"' ?> />
+ <label for="we"><?php echo _("We") ?></label><input id="we" type="checkbox" class="checkbox" name="weekly[]" onclick="KronolithEventForm.setInterval('recur_weekly_interval');KronolithEventForm.setRecur(2);" value="<?php echo Horde_Date::MASK_WEDNESDAY ?>"<?php if ($event->recurs() && $event->recurrence->recurOnDay(Horde_Date::MASK_WEDNESDAY)) echo ' checked="checked"' ?> />
+ <label for="th"><?php echo _("Th") ?></label><input id="th" type="checkbox" class="checkbox" name="weekly[]" onclick="KronolithEventForm.setInterval('recur_weekly_interval');KronolithEventForm.setRecur(2);" value="<?php echo Horde_Date::MASK_THURSDAY ?>"<?php if ($event->recurs() && $event->recurrence->recurOnDay(Horde_Date::MASK_THURSDAY)) echo ' checked="checked"' ?> />
+ <label for="fr"><?php echo _("Fr") ?></label><input id="fr" type="checkbox" class="checkbox" name="weekly[]" onclick="KronolithEventForm.setInterval('recur_weekly_interval');KronolithEventForm.setRecur(2);" value="<?php echo Horde_Date::MASK_FRIDAY ?>"<?php if ($event->recurs() && $event->recurrence->recurOnDay(Horde_Date::MASK_FRIDAY)) echo ' checked="checked"' ?> />
+ <label for="sa"><?php echo _("Sa") ?></label><input id="sa" type="checkbox" class="checkbox" name="weekly[]" onclick="KronolithEventForm.setInterval('recur_weekly_interval');KronolithEventForm.setRecur(2);" value="<?php echo Horde_Date::MASK_SATURDAY ?>"<?php if ($event->recurs() && $event->recurrence->recurOnDay(Horde_Date::MASK_SATURDAY)) echo ' checked="checked"' ?> />
+ <label for="su"><?php echo _("Su") ?></label><input id="su" type="checkbox" class="checkbox" name="weekly[]" onclick="KronolithEventForm.setInterval('recur_weekly_interval');KronolithEventForm.setRecur(2);" value="<?php echo Horde_Date::MASK_SUNDAY ?>"<?php if ($event->recurs() && $event->recurrence->recurOnDay(Horde_Date::MASK_SUNDAY)) echo ' checked="checked"' ?> />
</td>
</tr>
<tr>
<td class="nowrap">
- <input id="recurmonthday" type="radio" class="checkbox" name="recur" onclick="setInterval('recur_day_of_month_interval');" value="<?php echo Horde_Date_Recurrence::RECUR_MONTHLY_DATE ?>"<?php if ($event->recurs() && $event->recurrence->hasRecurType(Horde_Date_Recurrence::RECUR_MONTHLY_DATE)) echo ' checked="checked"' ?> /><label for="recurmonthday"> <?php echo _("Monthly: Recurs every") ?> </label>
- <input type="text" id="recur_day_of_month_interval" name="recur_day_of_month_interval" size="2" onkeypress="setRecur(3);" onchange="setRecur(3);" value="<?php echo $event->recurs() && $event->recurrence->hasRecurType(Horde_Date_Recurrence::RECUR_MONTHLY_DATE) ? $event->recurrence->getRecurInterval() : '' ?>" /> <?php echo Horde::label('recur_day_of_month_interval', _("month(s)") . ' ' . _("on the same date")) ?>
+ <input id="recurmonthday" type="radio" class="checkbox" name="recur" onclick="KronolithEventForm.setInterval('recur_day_of_month_interval');" value="<?php echo Horde_Date_Recurrence::RECUR_MONTHLY_DATE ?>"<?php if ($event->recurs() && $event->recurrence->hasRecurType(Horde_Date_Recurrence::RECUR_MONTHLY_DATE)) echo ' checked="checked"' ?> /><label for="recurmonthday"> <?php echo _("Monthly: Recurs every") ?> </label>
+ <input type="text" id="recur_day_of_month_interval" name="recur_day_of_month_interval" size="2" onkeypress="KronolithEventForm.setRecur(3);" onchange="KronolithEventForm.setRecur(3);" value="<?php echo $event->recurs() && $event->recurrence->hasRecurType(Horde_Date_Recurrence::RECUR_MONTHLY_DATE) ? $event->recurrence->getRecurInterval() : '' ?>" /> <?php echo Horde::label('recur_day_of_month_interval', _("month(s)") . ' ' . _("on the same date")) ?>
</td>
</tr>
<tr>
<td class="nowrap">
- <input id="recurmonthweek" type="radio" class="checkbox" name="recur" onclick="setInterval('recur_week_of_month_interval');" value="<?php echo Horde_Date_Recurrence::RECUR_MONTHLY_WEEKDAY ?>"<?php if ($event->recurs() && $event->recurrence->hasRecurType(Horde_Date_Recurrence::RECUR_MONTHLY_WEEKDAY)) echo ' checked="checked"' ?> /><label for="recurmonthweek"> <?php echo _("Monthly: Recurs every") ?> </label>
- <input type="text" id="recur_week_of_month_interval" name="recur_week_of_month_interval" size="2" onkeypress="setRecur(4);" onchange="setRecur(4);" value="<?php echo $event->recurs() && $event->recurrence->hasRecurType(Horde_Date_Recurrence::RECUR_MONTHLY_WEEKDAY) ? $event->recurrence->getRecurInterval() : '' ?>" /> <?php echo Horde::label('recur_week_of_month_interval', _("month(s)") . ' ' . _("on the same weekday")) ?>
+ <input id="recurmonthweek" type="radio" class="checkbox" name="recur" onclick="KronolithEventForm.setInterval('recur_week_of_month_interval');" value="<?php echo Horde_Date_Recurrence::RECUR_MONTHLY_WEEKDAY ?>"<?php if ($event->recurs() && $event->recurrence->hasRecurType(Horde_Date_Recurrence::RECUR_MONTHLY_WEEKDAY)) echo ' checked="checked"' ?> /><label for="recurmonthweek"> <?php echo _("Monthly: Recurs every") ?> </label>
+ <input type="text" id="recur_week_of_month_interval" name="recur_week_of_month_interval" size="2" onkeypress="KronolithEventForm.setRecur(4);" onchange="KronolithEventForm.setRecur(4);" value="<?php echo $event->recurs() && $event->recurrence->hasRecurType(Horde_Date_Recurrence::RECUR_MONTHLY_WEEKDAY) ? $event->recurrence->getRecurInterval() : '' ?>" /> <?php echo Horde::label('recur_week_of_month_interval', _("month(s)") . ' ' . _("on the same weekday")) ?>
</td>
</tr>
<tr>
<td class="nowrap">
- <input id="recuryear" type="radio" class="checkbox" name="recur" onclick="setInterval('recur_yearly_interval');" value="<?php echo Horde_Date_Recurrence::RECUR_YEARLY_DATE ?>"<?php if ($event->recurs() && $event->recurrence->hasRecurType(Horde_Date_Recurrence::RECUR_YEARLY_DATE)) echo ' checked="checked"' ?> /><label for="recuryear"> <?php echo _("Yearly: Recurs every") ?> </label>
- <input type="text" id="recur_yearly_interval" name="recur_yearly_interval" size="2" onkeypress="setRecur(5);" onchange="setRecur(5);" value="<?php echo $event->recurs() && $event->recurrence->hasRecurType(Horde_Date_Recurrence::RECUR_YEARLY_DATE) ? $event->recurrence->getRecurInterval() : '' ?>" /> <?php echo Horde::label('recur_yearly_interval', _("year(s) on the same date")) ?>
+ <input id="recuryear" type="radio" class="checkbox" name="recur" onclick="KronolithEventForm.setInterval('recur_yearly_interval');" value="<?php echo Horde_Date_Recurrence::RECUR_YEARLY_DATE ?>"<?php if ($event->recurs() && $event->recurrence->hasRecurType(Horde_Date_Recurrence::RECUR_YEARLY_DATE)) echo ' checked="checked"' ?> /><label for="recuryear"> <?php echo _("Yearly: Recurs every") ?> </label>
+ <input type="text" id="recur_yearly_interval" name="recur_yearly_interval" size="2" onkeypress="KronolithEventForm.setRecur(5);" onchange="KronolithEventForm.setRecur(5);" value="<?php echo $event->recurs() && $event->recurrence->hasRecurType(Horde_Date_Recurrence::RECUR_YEARLY_DATE) ? $event->recurrence->getRecurInterval() : '' ?>" /> <?php echo Horde::label('recur_yearly_interval', _("year(s) on the same date")) ?>
</td>
</tr>
<tr>
<td class="nowrap">
- <input id="recuryearday" type="radio" class="checkbox" name="recur" onclick="setInterval('recur_yearly_day_interval');" value="<?php echo Horde_Date_Recurrence::RECUR_YEARLY_DAY ?>"<?php if ($event->recurs() && $event->recurrence->hasRecurType(Horde_Date_Recurrence::RECUR_YEARLY_DAY)) echo ' checked="checked"' ?> /><label for="recuryearday"> <?php echo _("Yearly: Recurs every") ?> </label>
- <input type="text" id="recur_yearly_day_interval" name="recur_yearly_day_interval" size="2" onkeypress="setRecur(6);" onchange="setRecur(6);" value="<?php echo $event->recurs() && $event->recurrence->hasRecurType(Horde_Date_Recurrence::RECUR_YEARLY_DAY) ? $event->recurrence->getRecurInterval() : '' ?>" /> <?php echo Horde::label('recur_yearly_day_interval', _("year(s) on the same day of the year")) ?>
+ <input id="recuryearday" type="radio" class="checkbox" name="recur" onclick="KronolithEventForm.setInterval('recur_yearly_day_interval');" value="<?php echo Horde_Date_Recurrence::RECUR_YEARLY_DAY ?>"<?php if ($event->recurs() && $event->recurrence->hasRecurType(Horde_Date_Recurrence::RECUR_YEARLY_DAY)) echo ' checked="checked"' ?> /><label for="recuryearday"> <?php echo _("Yearly: Recurs every") ?> </label>
+ <input type="text" id="recur_yearly_day_interval" name="recur_yearly_day_interval" size="2" onkeypress="KronolithEventForm.KronolithEventForm.setRecur(6);" onchange="KronolithEventForm.setRecur(6);" value="<?php echo $event->recurs() && $event->recurrence->hasRecurType(Horde_Date_Recurrence::RECUR_YEARLY_DAY) ? $event->recurrence->getRecurInterval() : '' ?>" /> <?php echo Horde::label('recur_yearly_day_interval', _("year(s) on the same day of the year")) ?>
</td>
</tr>
<tr>
<td class="nowrap">
- <input id="recuryearweekday" type="radio" class="checkbox" name="recur" onclick="setInterval('recur_yearly_weekday_interval');" value="<?php echo Horde_Date_Recurrence::RECUR_YEARLY_WEEKDAY ?>"<?php if ($event->recurs() && $event->recurrence->hasRecurType(Horde_Date_Recurrence::RECUR_YEARLY_WEEKDAY)) echo ' checked="checked"' ?> /><label for="recuryearweekday"> <?php echo _("Yearly: Recurs every") ?> </label>
- <input type="text" id="recur_yearly_weekday_interval" name="recur_yearly_weekday_interval" size="2" onkeypress="setRecur(7);" onchange="setRecur(7);" value="<?php echo $event->recurs() && $event->recurrence->hasRecurType(Horde_Date_Recurrence::RECUR_YEARLY_WEEKDAY) ? $event->recurrence->getRecurInterval() : '' ?>" /> <?php echo Horde::label('recur_yearly_weekday_interval', _("year(s) on the same weekday and month of the year")) ?>
+ <input id="recuryearweekday" type="radio" class="checkbox" name="recur" onclick="KronolithEventForm.setInterval('recur_yearly_weekday_interval');" value="<?php echo Horde_Date_Recurrence::RECUR_YEARLY_WEEKDAY ?>"<?php if ($event->recurs() && $event->recurrence->hasRecurType(Horde_Date_Recurrence::RECUR_YEARLY_WEEKDAY)) echo ' checked="checked"' ?> /><label for="recuryearweekday"> <?php echo _("Yearly: Recurs every") ?> </label>
+ <input type="text" id="recur_yearly_weekday_interval" name="recur_yearly_weekday_interval" size="2" onkeypress="KronolithEventForm.setRecur(7);" onchange="KronolithEventForm.setRecur(7);" value="<?php echo $event->recurs() && $event->recurrence->hasRecurType(Horde_Date_Recurrence::RECUR_YEARLY_WEEKDAY) ? $event->recurrence->getRecurInterval() : '' ?>" /> <?php echo Horde::label('recur_yearly_weekday_interval', _("year(s) on the same weekday and month of the year")) ?>
</td>
</tr>
</table>
<?php echo $event->html('recur_enddate[year]') ?> - <?php echo $event->html('recur_enddate[month]') ?> - <?php echo $event->html('recur_enddate[day]') ?>
<?php if ($GLOBALS['browser']->hasFeature('dom')): ?>
<span id="recur_end_wday"></span>
- <script type="text/javascript">updateWday('recur_end_wday');</script>
+ <script type="text/javascript">KronolithEventForm.updateWday('recur_end_wday');</script>
</td>
<td>
<?php
<!-- tags -->
<tr>
-<td colspan="5" class="control toggle" onclick="toggleSection('tags')">
+<td colspan="5" class="control toggle" onclick="KronolithEventForm.toggleSection('tags')">
<?php echo Horde::img('tree/blank.png', '', array('id' => 'toggle_tags'), $GLOBALS['registry']->getImageDir('horde')) . ' <strong>' . _("Tags") ?></strong>
<span class="extra" id="extra_tags"><?php echo (!empty($tags) ? htmlspecialchars($tags) : '');?></span>
</td>
<td colspan="4">
<?php echo implode("\n", $buttons) ?>
<?php echo Horde::link(htmlspecialchars($cancelurl), '', 'button') . _("Cancel") . '</a>' ?>
- <input type="button" name="resetButton" class="button" value="<?php echo _("Reset to Defaults") ?>" onclick="document.eventform.reset(); updateWday('start_wday'); updateWday('end_wday');" />
+ <input type="button" name="resetButton" class="button" value="<?php echo _("Reset to Defaults") ?>" onclick="document.eventform.reset(); KronolithEventForm.updateWday('start_wday'); KronolithEventForm.updateWday('end_wday');" />
</td>
</tr>
</table>
<?php if ($GLOBALS['browser']->hasFeature('dom')): ?>
<span id="start_wday"></span>
<script type="text/javascript">
- updateWday('start_wday');
+ KronolithEventForm.updateWday('start_wday');
</script>
</td>
<td>
$pm = ' checked="checked"';
}
?>
- <input id="am" type="radio" class="checkbox" name="am_pm" value="AM"<?php echo $am ?> onclick="$('allday').checked=false;updateEndDate();" /><label for="am" onclick="$('allday').checked=false;updateEndDate();">AM</label>
- <input id="pm" type="radio" class="checkbox" name="am_pm" value="PM"<?php echo $pm ?> onclick="$('allday').checked=false;updateEndDate();" /><label for="pm" onclick="$('allday').checked=false;updateEndDate();">PM</label>
+ <input id="am" type="radio" class="checkbox" name="am_pm" value="AM"<?php echo $am ?> onclick="$('allday').checked=false;KronolithEventForm.updateEndDate();" /><label for="am" onclick="$('allday').checked=false;KronolithEventForm.updateEndDate();">AM</label>
+ <input id="pm" type="radio" class="checkbox" name="am_pm" value="PM"<?php echo $pm ?> onclick="$('allday').checked=false;KronolithEventForm.updateEndDate();" /><label for="pm" onclick="$('allday').checked=false;KronolithEventForm.updateEndDate();">PM</label>
<?php } ?>
</td>
</tr>
<?php if ($GLOBALS['browser']->hasFeature('dom')): ?>
<span id="end_wday"></span>
<script type="text/javascript">
- updateWday('end_wday');
+ KronolithEventForm.updateWday('end_wday');
</script>
</td>
<td rowspan="2" valign="top">
$pm = ' checked="checked"';
}
?>
- <input id="eam" type="radio" class="checkbox" name="end_am_pm" value="AM"<?php echo $am ?> onclick="$('end').checked=true;updateDuration()" /><label for="eam" onclick="$('end').checked=true;updateDuration()">AM</label>
- <input id="epm" type="radio" class="checkbox" name="end_am_pm" value="PM"<?php echo $pm ?> onclick="$('end').checked=true;updateDuration()" /><label for="epm" onclick="$('end').checked=true;updateDuration()">PM</label>
+ <input id="eam" type="radio" class="checkbox" name="end_am_pm" value="AM"<?php echo $am ?> onclick="$('end').checked=true;KronolithEventForm.updateDuration()" /><label for="eam" onclick="$('end').checked=true;KronolithEventForm.updateDuration()">AM</label>
+ <input id="epm" type="radio" class="checkbox" name="end_am_pm" value="PM"<?php echo $pm ?> onclick="$('end').checked=true;KronolithEventForm.updateDuration()" /><label for="epm" onclick="$('end').checked=true;KronolithEventForm.updateDuration()">PM</label>
<?php } ?>
</td>
</tr>
</td>
<td> </td>
<td valign="top">
- <input id="allday" name="whole_day" type="checkbox" class="checkbox" value="1" onclick="setWholeDay(this.value); updateEndDate(); $('duration').checked = true"<?php $dur = $event->getDuration(); if ($dur->wholeDay) echo ' checked="checked"' ?> />
+ <input id="allday" name="whole_day" type="checkbox" class="checkbox" value="1" onclick="KronolithEventForm.setWholeDay(this.value); KronolithEventForm.updateEndDate(); $('duration').checked = true"<?php $dur = $event->getDuration(); if ($dur->wholeDay) echo ' checked="checked"' ?> />
<?php echo Horde::label('allday', _("All day")) ?><br />
<?php printf(_("%s Day(s) %s Hour(s) %s Minutes"), $event->html('dur_day'), $event->html('dur_hour'), $event->html('dur_min')) ?>
<?php if ($GLOBALS['browser']->hasFeature('dom')): ?>
<script type="text/javascript">
<?php if (!Util::nonInputVar('issearch')): ?>
-
-function setInterval(field)
+KronolithEventForm = new Object();
+KronolithEventForm.setInterval = function(field)
{
elt = document.eventform[field];
if (elt.value == "") {
elt.value = 1;
}
- if (field == 'recur_daily_interval') clearFields(1);
- else if (field == 'recur_weekly_interval') clearFields(2);
- else if (field == 'recur_day_of_month_interval') clearFields(3);
- else if (field == 'recur_week_of_month_interval') clearFields(4);
- else if (field == 'recur_yearly_interval') clearFields(5);
+ if (field == 'recur_daily_interval') KronolithEventForm.clearFields(1);
+ else if (field == 'recur_weekly_interval') KronolithEventForm.clearFields(2);
+ else if (field == 'recur_day_of_month_interval') KronolithEventForm.clearFields(3);
+ else if (field == 'recur_week_of_month_interval') KronolithEventForm.clearFields(4);
+ else if (field == 'recur_yearly_interval') KronolithEventForm.clearFields(5);
}
-function setRecur(index)
+KronolithEventForm.setRecur = function(index)
{
document.eventform.recur[index].checked = true;
- clearFields(index);
+ KronolithEventForm.clearFields(index);
}
-function clearFields(index)
+KronolithEventForm.clearFields = function(index)
{
var f = document.eventform;
if (index != 1) f.recur_daily_interval.value = '';
<?php endif; ?>
-function setWholeDay(wholeDay)
+KronolithEventForm.setWholeDay = function(wholeDay)
{
if (wholeDay == 1) {
<?php if ($GLOBALS['prefs']->getValue('twentyFour')): ?>
}
}
-function updateWday(span)
+KronolithEventForm.updateWday = function(span)
{
<?php if ($GLOBALS['browser']->hasFeature('dom')): ?>
wdays = [
<?php if (!$GLOBALS['prefs']->getValue('twentyFour')): ?>
// Converts a 12 hour based number to its 24 hour format
-function convertTo24Hour(in_hour, pm_elementName)
+KronolithEventForm.convertTo24Hour = function(in_hour, pm_elementName)
{
if ($F(pm_elementName)) {
if (in_hour != 12) {
}
<?php endif; ?>
-function updateDuration()
+KronolithEventForm.updateDuration = function()
{
var startHour = parseInt($F('start_hour'));
var endHour = parseInt($F('end_hour'));
<?php if (!$GLOBALS['prefs']->getValue('twentyFour')): ?>
- startHour = convertTo24Hour(startHour, 'pm');
- endHour = convertTo24Hour(endHour, 'epm');
+ startHour = KronolithEventForm.convertTo24Hour(startHour, 'pm');
+ endHour = KronolithEventForm.convertTo24Hour(endHour, 'epm');
<?php endif; ?>
var startDate = Date.UTC($F('start_year'),
$F('start_month') - 1,
// Recalculate end time.
var endHour = parseInt($F('end_hour'));
- endHour = convertTo24Hour(endHour, 'epm');
+ endHour = KronolithEventForm.convertTo24Hour(endHour, 'epm');
endDate = Date.UTC($F('end_year'),
$F('end_month') - 1,
$F('end_day'),
$('dur_min').selectedIndex = durMin;
$('allday').checked = false;
if (failed) {
- updateEndDate();
+ KronolithEventForm.updateEndDate();
}
}
-function updateEndDate()
+KronolithEventForm.updateEndDate = function()
{
var yearDiff = <?php echo date('Y') - 1 ?>;
var startHour = parseInt($F('start_hour'));
<?php if (!$GLOBALS['prefs']->getValue('twentyFour')): ?>
- startHour = convertTo24Hour(startHour, 'pm');
+ startHour = KronolithEventForm.convertTo24Hour(startHour, 'pm');
<?php endif; ?>
var startDate = new Date($F('start_year'),
$F('start_month') - 1,
<?php endif; ?>
$('end_hour').selectedIndex = endHour;
$('end_min').selectedIndex = endDate.getMinutes() / 5;
- updateWday('end_wday');
+ KronolithEventForm.updateWday('end_wday');
}
-function toggleAlarmMethods()
+KronolithEventForm.toggleAlarmMethods = function()
{
if ($('nooverwrite').checked) {
$('notification_options').hide();
}
}
-function setStartDate(date)
+KronolithEventForm.setStartDate = function(date)
{
var year = parseInt(date.substr(0, 4));
var month = parseInt(date.substr(4, 2));
$('start_year').value = year;
$('start_month').selectedIndex = month - 1;
$('start_day').selectedIndex = day - 1;
- updateEndDate();
+ KronolithEventForm.updateEndDate();
// Uncheck recurring weekdays.
$('mo').checked = false;
});
<?php endif; ?>
-function toggleSection(section)
+KronolithEventForm.toggleSection = function(section)
{
var dir = '<?php echo $GLOBALS['registry']->getImageDir() ?>';
$('section_' + section).toggle();
}
}
Event.observe(window, 'load', function() {
- toggleSection('alarm');
- toggleSection('description');
- toggleSection('attendees');
- toggleSection('recurrence');
- toggleSection('tags');
+ KronolithEventForm.toggleSection('alarm');
+ KronolithEventForm.toggleSection('description');
+ KronolithEventForm.toggleSection('attendees');
+ KronolithEventForm.toggleSection('recurrence');
+ KronolithEventForm.toggleSection('tags');
});
</script>