X-Git-Url: https://code.citadel.org/?p=citadel.git;a=blobdiff_plain;f=webcit%2Fevent.c;h=61b389f136dc55cc3175a46b45aa2dc99971a042;hp=f073f47b58492719f8bfce4553c334cd3c53fde3;hb=1948ce480274346dad1ccda96899c3dab318a2d9;hpb=15285981d937232a4ac0e3a84c7f944d53cdafa6 diff --git a/webcit/event.c b/webcit/event.c index f073f47b5..61b389f13 100644 --- a/webcit/event.c +++ b/webcit/event.c @@ -524,6 +524,7 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum, wprintf("
"); /* begin 'monthday_selector' div */ wprintf("", ((which_rrmonthtype_is_preselected == 0) ? "checked" : "") ); @@ -550,6 +551,7 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum, wprintf("
\n"); wprintf("", ((which_rrmonthtype_is_preselected == 1) ? "checked" : "") ); @@ -600,6 +602,7 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum, wprintf("
"); /* begin 'yearday_selector' div */ wprintf("", ((which_rryeartype_is_preselected == 0) ? "checked" : "") ); @@ -607,6 +610,7 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum, wprintf("%s
", _("year on this date")); wprintf("", ((which_rryeartype_is_preselected == 1) ? "checked" : "") ); @@ -663,12 +667,14 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum, wprintf("\n"); wprintf("", ((which_rrend_is_preselected == 0) ? "checked" : "") ); wprintf("%s
\n", _("No ending date")); wprintf("", ((which_rrend_is_preselected == 1) ? "checked" : "") ); @@ -679,6 +685,7 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum, wprintf("
\n"); wprintf("", ((which_rrend_is_preselected == 2) ? "checked" : "") ); @@ -872,6 +879,58 @@ void save_individual_event(icalcomponent *supplied_vevent, long msgnum, char *fr ); } + /* 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")) {