}
else
IcalTime = icaltime_current_time_with_zone(get_default_icaltimezone());
- display_icaltimetype_as_webform(&IcalTime, "dtstart");
+ display_icaltimetype_as_webform(&IcalTime, "dtstart", 0);
wprintf("</TD></TR>\n");
wprintf("<TR><TD>");
}
else
IcalTime = icaltime_current_time_with_zone(get_default_icaltimezone());
- display_icaltimetype_as_webform(&IcalTime, "due");
+ display_icaltimetype_as_webform(&IcalTime, "due", 0);
wprintf("</TD></TR>\n");
todoStatus = icalcomponent_get_status(vtodo);
* might be to allow the user to specify his/her timezone.
*/
-void display_icaltimetype_as_webform(struct icaltimetype *t, char *prefix) {
+void display_icaltimetype_as_webform(struct icaltimetype *t, char *prefix, int date_only) {
int i;
time_t now;
struct tm tm_now;
wprintf(prefix);
wprintf("', '%s');\n", get_selected_language());
wprintf("</script>");
+
+ /* If we're editing a date only, we still generate the time boxes, but we hide them.
+ * This keeps the data model consistent.
+ */
+ if (date_only) {
+ wprintf("<div style=\"display:none\">");
+ }
+
wprintf(_("Hour: "));
wprintf("<SELECT NAME=\"%s_hour\" SIZE=\"1\">\n", prefix);
for (i=0; i<=23; ++i) {
}
}
wprintf("</SELECT>\n");
+
+ if (date_only) {
+ wprintf("</div>");
+ }
}
/*
t_start.is_utc = 1;
}
- display_icaltimetype_as_webform(&t_start, "dtstart");
+ display_icaltimetype_as_webform(&t_start, "dtstart", 0);
wprintf("<INPUT TYPE=\"checkbox\" id=\"alldayevent\" NAME=\"alldayevent\" "
"VALUE=\"yes\" onclick=\"eventEditAllDay();\""
/* t_end = icaltime_from_timet(now, 0); */
}
}
- display_icaltimetype_as_webform(&t_end, "dtend");
+ display_icaltimetype_as_webform(&t_end, "dtend", 0);
wprintf("</TD></TR>\n");
wprintf("<TR><TD><B>");
-
+ // FIXME preselect the correct radio button
wprintf("<tr><td><b>");
wprintf(_("Recurrence range"));
"%s onChange=\"RecurrenceShowHide();\">",
(0 ? "checked" : "")
);
- wprintf(_("Repeat this event %d times"), 0);
- wprintf("</input><br />\n");
+ wprintf(_("Repeat this event"));
+ wprintf("</input> ");
+ wprintf("<input type=\"text\" name=\"rrcount\" id=\"rrcount\" maxlength=\"3\" size=\"3\" ");
+ wprintf("value=\"%d\"> ", recur.count);
+ wprintf(_("times"));
+ wprintf("<br />\n");
wprintf("<input type=\"radio\" name=\"rrend\" id=\"rrend_until\" "
"%s onChange=\"RecurrenceShowHide();\">",
(0 ? "checked" : "")
);
- wprintf(_("Repeat this event until %s"), "FIXME");
- wprintf("</input><br />\n");
+ wprintf(_("Repeat this event until "));
+ wprintf("</input>");
+ display_icaltimetype_as_webform(&recur.until, "rruntil", 1);
+ wprintf("<br />\n");
wprintf("</td></tr>\n");
$('weekday_selector').style.display = 'none';
}
+ if ($('rrend_count').checked) {
+ $('rrcount').disabled = false;
+ }
+ else {
+ $('rrcount').disabled = true;
+ }
+
+ if ($('rrend_until').checked) {
+ $('rruntil').disabled = false;
+ }
+ else {
+ $('rruntil').disabled = true;
+ }
+
}
void display_edit_task(void);
void display_edit_event(void);
icaltimezone *get_default_icaltimezone(void);
-void display_icaltimetype_as_webform(struct icaltimetype *, char *);
+void display_icaltimetype_as_webform(struct icaltimetype *, char *, int);
void icaltime_from_webform(struct icaltimetype *result, char *prefix);
void icaltime_from_webform_dateonly(struct icaltimetype *result, char *prefix);
void display_edit_individual_event(icalcomponent *supplied_vtodo, long msgnum, char *from, int unread);