Feeble incremental work to the recurring event editor
authorArt Cancro <ajc@citadel.org>
Mon, 1 Sep 2008 21:59:55 +0000 (21:59 +0000)
committerArt Cancro <ajc@citadel.org>
Mon, 1 Sep 2008 21:59:55 +0000 (21:59 +0000)
webcit/calendar.c
webcit/event.c

index f0ec314601f42049d072847406aec522aab24b3e..c9d40bc8e0d8a8055a3305588e4023cb070e9884 100644 (file)
@@ -472,8 +472,6 @@ void display_individual_cal(icalcomponent *cal, long msgnum, char *from, int unr
            Cal, 
            delete_cal);
 
-#ifdef TECH_PREVIEW
-
        /* handle recurring events */
 
        if (icaltime_is_null_time(dtstart)) return;     /* Can't recur without a start time */
@@ -540,8 +538,6 @@ void display_individual_cal(icalcomponent *cal, long msgnum, char *from, int unr
        }
        lprintf(9, "Performed %d recurrences; final one is %s", num_recur, ctime(&final_recurrence));
 
-#endif /* TECH_PREVIEW */
-
 }
 
 
index ba4b8ce67171278755153b72a4ff9d33e0dd4b8e..d3aac336f855386353cec75c3a569954aaec9841 100644 (file)
@@ -27,7 +27,7 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum,
        char attendee_string[SIZ];
        char buf[SIZ];
        int organizer_is_me = 0;
-       int i;
+       int i, j = 0;
        int sequence = 0;
 
        lprintf(9, "display_edit_individual_event(%ld) calview=%s year=%s month=%s day=%s\n",
@@ -381,6 +381,15 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum,
        struct icalrecurrencetype recur;
 
        rrule = icalcomponent_get_first_property(vevent, ICAL_RRULE_PROPERTY);
+
+       wprintf("<INPUT TYPE=\"checkbox\" id=\"is_recur\" NAME=\"is_recur\" "
+               "VALUE=\"yes\" "
+               /* "onclick=\"GreyOrUnGrayStuffFIXME();\"" */
+               " %s >%s",
+               (rrule ? "CHECKED=\"CHECKED\"" : "" ),
+               _("This is a repeating event")
+       );
+
        if (rrule) {
                recur = icalproperty_get_rrule(rrule);
 
@@ -408,7 +417,24 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum,
                wprintf(_("Repeats"));
                wprintf("</b></td><td>");
                if ((recur.freq < 0) || (recur.freq > 6)) recur.freq = 4;
-               wprintf("every %d %s", recur.interval, frequency_units[recur.freq]);
+               wprintf("every %d %s", recur.interval, frequency_units[recur.freq]);    //FIXME
+               wprintf("</td></tr>\n");
+
+               wprintf("<tr><td><b>");
+               wprintf("byday");                                                       //FIXME
+               wprintf("</b></td><td>");
+               for (i=0; i<ICAL_BY_DAY_SIZE; ++i) {
+                       if (recur.by_day[i] == ICAL_RECURRENCE_ARRAY_MAX) {
+                               i = ICAL_RECURRENCE_ARRAY_MAX;                  /* all done */
+                       }
+                       else {
+                               for (j=1; j<=ICAL_SATURDAY_WEEKDAY; ++j) {
+                                       if (icalrecurrencetype_day_day_of_week(recur.by_day[i]) == j) {
+                                               wprintf("day%d, ", j);
+                                       }
+                               }
+                       }
+               }
                wprintf("</td></tr>\n");
 
                wprintf("</table>\n");