wprintf("<div id=\"monthday_selector\">"); /* begin 'monthday_selector' div */
wprintf("<input type=\"radio\" name=\"rrmonthtype\" id=\"rrmonthtype_mday\" "
+ "value=\"rrmonthtype_mday\" "
"%s onChange=\"RecurrenceShowHide();\">",
((which_rrmonthtype_is_preselected == 0) ? "checked" : "")
);
wprintf("<br />\n");
wprintf("<input type=\"radio\" name=\"rrmonthtype\" id=\"rrmonthtype_wday\" "
+ "value=\"rrmonthtype_wday\" "
"%s onChange=\"RecurrenceShowHide();\">",
((which_rrmonthtype_is_preselected == 1) ? "checked" : "")
);
wprintf("<div id=\"yearday_selector\">"); /* begin 'yearday_selector' div */
wprintf("<input type=\"radio\" name=\"rryeartype\" id=\"rryeartype_ymday\" "
+ "value=\"rryeartype_ymday\" "
"%s onChange=\"RecurrenceShowHide();\">",
((which_rryeartype_is_preselected == 0) ? "checked" : "")
);
wprintf("<span id=\"ymday\">%s</span><br />", _("year on this date"));
wprintf("<input type=\"radio\" name=\"rryeartype\" id=\"rryeartype_ywday\" "
+ "value=\"rryeartype_ywday\" "
"%s onChange=\"RecurrenceShowHide();\">",
((which_rryeartype_is_preselected == 1) ? "checked" : "")
);
wprintf("</b></td><td>\n");
wprintf("<input type=\"radio\" name=\"rrend\" id=\"rrend_none\" "
+ "value=\"rrend_none\" "
"%s onChange=\"RecurrenceShowHide();\">",
((which_rrend_is_preselected == 0) ? "checked" : "")
);
wprintf("%s<br />\n", _("No ending date"));
wprintf("<input type=\"radio\" name=\"rrend\" id=\"rrend_count\" "
+ "value=\"rrend_count\" "
"%s onChange=\"RecurrenceShowHide();\">",
((which_rrend_is_preselected == 1) ? "checked" : "")
);
wprintf("<br />\n");
wprintf("<input type=\"radio\" name=\"rrend\" id=\"rrend_until\" "
+ "value=\"rrend_until\" "
"%s onChange=\"RecurrenceShowHide();\">",
((which_rrend_is_preselected == 2) ? "checked" : "")
);
);
}
+ /* recurrence rules -- begin */
+
+ /* remove any existing rule */
+ while (prop = icalcomponent_get_first_property(vevent, ICAL_RRULE_PROPERTY), prop != NULL) {
+ icalcomponent_remove_property(vevent, prop);
+ icalproperty_free(prop);
+ }
+
+ if (yesbstr("is_recur")) {
+ struct icalrecurrencetype recur;
+ icalrecurrencetype_clear(&recur);
+
+ recur.interval = atoi(bstr("interval"));
+ recur.freq = atoi(bstr("freq"));
+
+ switch(recur.freq) {
+
+ /* These can't happen; they're disabled. */
+ case ICAL_SECONDLY_RECURRENCE:
+ break;
+ case ICAL_MINUTELY_RECURRENCE:
+ break;
+ case ICAL_HOURLY_RECURRENCE:
+ break;
+
+ /* These are the real options. */
+ case ICAL_DAILY_RECURRENCE:
+ break;
+ case ICAL_WEEKLY_RECURRENCE:
+ break;
+ case ICAL_MONTHLY_RECURRENCE:
+ break;
+ case ICAL_YEARLY_RECURRENCE:
+ break;
+
+ /* This one can't happen either. */
+ case ICAL_NO_RECURRENCE:
+ break;
+ }
+
+ if (!strcasecmp(bstr("rrend"), "rrend_count")) {
+ recur.count = atoi(bstr("rrcount"));
+ }
+ else if (!strcasecmp(bstr("rrend"), "rrend_until")) {
+ icaltime_from_webform_dateonly(&recur.until, "rruntil");
+ }
+
+ icalcomponent_add_property(vevent, icalproperty_new_rrule(recur));
+ }
+
+ /* recurrence rules -- end */
+
/* See if transparency is indicated */
if (havebstr("transp")) {
if (!strcasecmp(bstr("transp"), "opaque")) {
int i;
StrBufAppendPrintf(WC->trailing_javascript,
- "var previously_selected_tab = '0'; "
- "function tabsel(which_tab) { "
- " if (which_tab == previously_selected_tab) { "
- " return; "
- " } "
- " $('tabdiv'+previously_selected_tab).style.display = 'none'; "
- " $('tabdiv'+which_tab).style.display = 'block'; "
- " $('tabtd'+previously_selected_tab).className = 'tab_cell_edit'; "
- " $('tabtd'+which_tab).className = 'tab_cell_label'; "
- " previously_selected_tab = which_tab; "
- "} "
+ "var previously_selected_tab = '0'; \n"
+ "function tabsel(which_tab) { \n"
+ " if (which_tab == previously_selected_tab) { \n"
+ " return; \n"
+ " } \n"
+ " $('tabdiv'+previously_selected_tab).style.display = 'none'; \n"
+ " $('tabdiv'+which_tab).style.display = 'block'; \n"
+ " $('tabtd'+previously_selected_tab).className = 'tab_cell_edit'; \n"
+ " $('tabtd'+which_tab).className = 'tab_cell_label'; \n"
+ " previously_selected_tab = which_tab; \n"
+ "} \n"
);
wprintf("<table id=\"TheTabs\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">"