]> code.citadel.org Git - citadel.git/blobdiff - webcit/event.c
* Decapsulate and dezonify calendar events as they are
[citadel.git] / webcit / event.c
index 041e5b83301084961117802b288a7fccd0ad1cfb..37e2e2627a688b8df297cf98c4ee916ade5f1285 100644 (file)
@@ -71,6 +71,10 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum,
 
        if (supplied_vevent != NULL) {
                vevent = supplied_vevent;
+
+               /* Convert all timestamps to UTC to make them easier to process. */
+               ical_dezonify(vevent);
+
                /*
                 * If we're looking at a fully encapsulated VCALENDAR
                 * rather than a VEVENT component, attempt to use the first
@@ -438,15 +442,6 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum,
 
        wprintf("<table border=0 cellspacing=\"10\" width=100%%>\n");
 
-       /* Table row displaying raw RRULE data, FIXME remove when finished */
-       if (rrule) {
-               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"),
@@ -591,9 +586,6 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum,
        int rrymweek = rrmweek;
        int rrymweekday = rrmweekday;
        int rrymonth = t_start.month;
-
-       lprintf(9, "FIXME: RRYMWEEK %d, RRYMWEEKDAY %d, RRYMONTH %d\n", rrymweek, rrymweekday, rrymonth);
-
        int which_rryeartype_is_preselected = 0;
 
        if ( (recur.by_day[0] != ICAL_RECURRENCE_ARRAY_MAX) 
@@ -931,13 +923,23 @@ void save_individual_event(icalcomponent *supplied_vevent, long msgnum, char *fr
                                                recur.by_month_day[1] = ICAL_RECURRENCE_ARRAY_MAX;
                                        }
                                        else if (!strcasecmp(bstr("rrmonthtype"), "rrmonthtype_wday")) {
-                                               lprintf(9, "MONTHLY BY WDAY\n");
-                                               /* FIXME implement this */
+                                               recur.by_day[0] = (atoi(bstr("rrmweek")) * 8)
+                                                               + atoi(bstr("rrmweekday")) + 1;
+                                               recur.by_day[1] = ICAL_RECURRENCE_ARRAY_MAX;
                                        }
                                        break;
 
                                case ICAL_YEARLY_RECURRENCE:
-                                       /* FIXME implement this */
+                                       if (!strcasecmp(bstr("rryeartype"), "rryeartype_ymday")) {
+                                               /* no further action is needed here */
+                                       }
+                                       else if (!strcasecmp(bstr("rryeartype"), "rryeartype_ywday")) {
+                                               recur.by_month[0] = atoi(bstr("rrymonth"));
+                                               recur.by_month[1] = ICAL_RECURRENCE_ARRAY_MAX;
+                                               recur.by_day[0] = (atoi(bstr("rrymweek")) * 8)
+                                                               + atoi(bstr("rrymweekday")) + 1;
+                                               recur.by_day[1] = ICAL_RECURRENCE_ARRAY_MAX;
+                                       }
                                        break;
 
                                /* This one can't happen either. */