+ /* 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 */
+