Started developing the recurrence editor
authorArt Cancro <ajc@citadel.org>
Thu, 21 Aug 2008 02:02:46 +0000 (02:02 +0000)
committerArt Cancro <ajc@citadel.org>
Thu, 21 Aug 2008 02:02:46 +0000 (02:02 +0000)
webcit/calendar.c
webcit/calendar_view.c
webcit/event.c

index fb3f19e89427a6a11b0f1617f3a64417e7976668..f0ec314601f42049d072847406aec522aab24b3e 100644 (file)
@@ -494,8 +494,6 @@ void display_individual_cal(icalcomponent *cal, long msgnum, char *from, int unr
        ritr = icalrecur_iterator_new(recur, dtstart);
        if (!ritr) return;
 
-       lprintf(9, "Recurrence found: %s\n", icalrecurrencetype_as_string(&recur));
-
        while (next = icalrecur_iterator_next(ritr), !icaltime_is_null_time(next) ) {
                ++num_recur;
 
index f5f440baf0fdec0b92ebc05ef6978112f86441d8..d964f901e833dd3497bc1f1a4fb6fc6ffef876ff 100644 (file)
@@ -511,9 +511,7 @@ void calendar_month_view(int year, int month, int day) {
        localtime_r(&thetime, &tm);
        while (tm.tm_wday != weekstart) {
                thetime = thetime - (time_t)86400;      /* go back 24 hours */
-               lprintf(9, "Subtracting a day, thetime is now %d - %s", thetime, ctime(&thetime));
                localtime_r(&thetime, &tm);
-               lprintf(9, "tm.tm_wday is %d, weekstart is %d\n", tm.tm_wday, weekstart);
        }
 
        /* Outer table (to get the background color) */
index cb6b75ddab22d92d68c649d925a3223737f634c8..ba4b8ce67171278755153b72a4ff9d33e0dd4b8e 100644 (file)
@@ -383,7 +383,35 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum,
        rrule = icalcomponent_get_first_property(vevent, ICAL_RRULE_PROPERTY);
        if (rrule) {
                recur = icalproperty_get_rrule(rrule);
-               wprintf("<tt>%s</tt><br />\n", icalrecurrencetype_as_string(&recur));
+
+               wprintf("<table border=0 width=100%%>\n");      /* same table style as the event tab */
+
+               /* Table row displaying raw RRULE data, FIXME remove when finished */
+               wprintf("<tr><td><b>");
+               wprintf("Raw data");
+               wprintf("</b></td><td>");
+               wprintf("<tt>%s</tt>", icalrecurrencetype_as_string(&recur));
+               wprintf("</td></tr>\n");
+
+               char *frequency_units[] = {
+                       _("seconds"),
+                       _("minutes"),
+                       _("hours"),
+                       _("days"),
+                       _("weeks"),
+                       _("months"),
+                       _("years"),
+                       _("never")
+               };
+
+               wprintf("<tr><td><b>");
+               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("</td></tr>\n");
+
+               wprintf("</table>\n");
        }
        end_tab(2, 3);