From 60bf2f07bbb0d5f23595cb6c45fdfe670bab76f4 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Tue, 23 Sep 2008 02:20:43 +0000 Subject: [PATCH] Wrote a few more lines of the recurrence editor. --- webcit/event.c | 126 ++++++++++++++++++++++------------------- webcit/static/wclib.js | 14 +++++ 2 files changed, 81 insertions(+), 59 deletions(-) diff --git a/webcit/event.c b/webcit/event.c index 8fc911750..9c90b8332 100644 --- a/webcit/event.c +++ b/webcit/event.c @@ -381,77 +381,84 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum, struct icalrecurrencetype recur; rrule = icalcomponent_get_first_property(vevent, ICAL_RRULE_PROPERTY); + if (rrule) { + recur = icalproperty_get_rrule(rrule); + } + else { + memset(&recur, 0, sizeof(struct icalrecurrencetype)); + // FIXME create a sane blank recurrence here + } wprintf("%s", (rrule ? "CHECKED=\"CHECKED\"" : "" ), _("This is a repeating event") ); - if (rrule) { - recur = icalproperty_get_rrule(rrule); + wprintf("
\n"); /* begin 'rrule' div */ - wprintf("\n"); /* same table style as the event tab */ - - /* Table row displaying raw RRULE data, FIXME remove when finished */ - wprintf("\n"); - - char *frequency_units[] = { - _("seconds"), - _("minutes"), - _("hours"), - _("days"), - _("weeks"), - _("months"), - _("years"), - _("never") - }; - - wprintf("\n"); + wprintf("
"); - wprintf("Raw data"); - wprintf(""); - wprintf("%s", icalrecurrencetype_as_string(&recur)); - wprintf("
"); - wprintf(_("Repeats")); - wprintf(""); - if ((recur.freq < 0) || (recur.freq > 6)) recur.freq = 4; - wprintf("%s ", _("every")); - - wprintf(" ", recur.interval); - - wprintf("
\n"); /* same table style as the event tab */ - wprintf("\n"); + + char *frequency_units[] = { + _("seconds"), + _("minutes"), + _("hours"), + _("days"), + _("weeks"), + _("months"), + _("years"), + _("never") + }; + + wprintf("\n"); + + wprintf("\n"); - - wprintf("
"); - wprintf("byday"); //FIXME - wprintf(""); - for (i=0; i"); + wprintf("Raw data"); + wprintf(""); + wprintf("%s", icalrecurrencetype_as_string(&recur)); + wprintf("
"); + wprintf(_("Repeats")); + wprintf(""); + if ((recur.freq < 0) || (recur.freq > 6)) recur.freq = 4; + wprintf("%s ", _("every")); + + wprintf(" ", recur.interval); + + wprintf("
"); + wprintf("byday"); //FIXME + wprintf(""); + for (i=0; i
\n"); } + wprintf("\n"); + wprintf("\n"); + wprintf("
\n"); /* end 'rrule' div */ + end_tab(2, 3); /* submit buttons (common area beneath the tabs) */ @@ -476,9 +483,10 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum, wprintf("\n"); - wprintf("\n" + wprintf(" \n" ); address_book_popup(); wDumpContent(1); diff --git a/webcit/static/wclib.js b/webcit/static/wclib.js index 8ef0d63e0..1b3b8f78c 100644 --- a/webcit/static/wclib.js +++ b/webcit/static/wclib.js @@ -979,3 +979,17 @@ function eventEditAllDay() { dtend.style.textDecoration = ""; } } + + + + +// Functions which handle show/hide of various elements in the recurrence editor + +function RecurrenceShowHide() { + if ($('is_recur').checked) { + $('rrule').style.display = 'block'; + } + else { + $('rrule').style.display = 'none'; + } +} -- 2.30.2