more work on the recurrence editor
authorArt Cancro <ajc@citadel.org>
Tue, 21 Oct 2008 16:40:55 +0000 (16:40 +0000)
committerArt Cancro <ajc@citadel.org>
Tue, 21 Oct 2008 16:40:55 +0000 (16:40 +0000)
webcit/event.c
webcit/static/wclib.js

index eb016a2754158a748ae3542d0f4999f4480f160d..24e9bd4c467d1f5e64593e0e0542df586b0f5a18 100644 (file)
@@ -529,7 +529,6 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum,
                ((which_rrmonthtype_is_preselected == 0) ? "checked" : "")
        );
 
-       char mdaybox[256];
        int rrmday = 1;                                 /* FIXME default to same as event start */
        int rrmweek = 1;                                /* FIXME default to same as event start */
        int rrmweekday = 1;                             /* FIXME default to same as event start */
@@ -544,10 +543,7 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum,
                rrmweekday = icalrecurrencetype_day_day_of_week(recur.by_day[0]) - 1;
        }
 
-       snprintf(mdaybox, sizeof mdaybox,
-               "<input type=\"text\" name=\"rrmday\" id=\"rrmday\" maxlength=\"2\" size=\"2\" "
-               "value=\"%d\">", rrmday);
-       wprintf(_("on day %s of the month"), mdaybox);
+       wprintf(_("on day %s%d%s of the month"), "<span id=\"rrmday\">", rrmday, "</span>");
        wprintf("<br />\n");
 
        wprintf("<input type=\"radio\" name=\"rrmonthtype\" id=\"rrmonthtype_wday\" "
@@ -921,6 +917,13 @@ void save_individual_event(icalcomponent *supplied_vevent, long msgnum, char *fr
                                        break;
 
                                case ICAL_MONTHLY_RECURRENCE:
+                                       if (!strcasecmp(bstr("rrmonthtype"), "rrmonthtype_mday")) {
+                                               recur.by_month_day[0] = event_start.day;
+                                               recur.by_month_day[1] = ICAL_RECURRENCE_ARRAY_MAX;
+                                       }
+                                       else if (!strcasecmp(bstr("rrmonthtype"), "rrmonthtype_wday")) {
+                                               lprintf(9, "MONTHLY BY WDAY\n");
+                                       }
                                        break;
 
                                case ICAL_YEARLY_RECURRENCE:
index 29875abd6da57cae4909f1b850114b88e31fd296..26a5f73f470e09f46ba0af9ef5fe30ea6f324877 100644 (file)
@@ -1051,6 +1051,7 @@ function RecurrenceShowHide() {
        }
 
        $('ymday').innerHTML = 'XXXX-' + $('dtstart').value.substr(5);
+       $('rrmday').innerHTML = $('dtstart').value.substr(8);
 
        if ($('rryeartype_ywday').checked) {
                $('rrymweek').disabled = false;