int i;
int sequence = 0;
- now = time(NULL) % 60; /* mod 60 to force :00 seconds */
+ now = time(NULL);
strcpy(organizer_string, "");
strcpy(attendee_string, "");
}
/* Begin output */
- output_headers(3);
- do_template("beginbox_nt");
- wprintf("<h3> <IMG ALIGN=CENTER SRC=\"/static/vcalendar.gif\">"
- " Add or edit an event</h3>\n");
+ output_headers(1, 1, 2, 0, 0, 0, 0);
+ wprintf("<div id=\"banner\">\n"
+ "<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>"
+ "<SPAN CLASS=\"titlebar\">Add or edit an event</SPAN>"
+ "</TD></TR></TABLE>\n"
+ "</div>\n<div id=\"content\">\n"
+ );
+
+ wprintf("<div id=\"fix_scrollbar_bug\">"
+ "<table border=0 width=100%% bgcolor=\"#ffffff\"><tr><td>\n");
/************************************************************
* Uncomment this to see the UID in calendar events for debugging
if (p != NULL) {
escputs((char *)icalproperty_get_comment(p));
}
- wprintf("<BR>\n");
- wprintf("SEQUENCE == %d<BR>\n", sequence);
+ wprintf("<br />\n");
+ wprintf("SEQUENCE == %d<br />\n", sequence);
*************************************************************/
wprintf("<FORM NAME=\"EventForm\" METHOD=\"POST\" ACTION=\"/save_event\">\n");
}
}
else {
- memcpy(&tm_now, localtime(&now), sizeof(struct tm));
- tm_now.tm_year = atoi(bstr("year")) - 1900;
- tm_now.tm_mon = atoi(bstr("month")) - 1;
- tm_now.tm_mday = atoi(bstr("day"));
+ localtime_r(&now, &tm_now);
+ if (strlen(bstr("year")) > 0) {
+ tm_now.tm_year = atoi(bstr("year")) - 1900;
+ tm_now.tm_mon = atoi(bstr("month")) - 1;
+ tm_now.tm_mday = atoi(bstr("day"));
+ }
if (strlen(bstr("hour")) > 0) {
tm_now.tm_hour = atoi(bstr("hour"));
tm_now.tm_min = atoi(bstr("minute"));
wprintf("</TD></TR>\n");
/* Attendees */
- wprintf("<TR><TD><B>Attendees</B><BR>"
+ wprintf("<TR><TD><B>Attendees</B><br />"
"<FONT SIZE=-2>(One per line)"
"</FONT></TD><TD>"
"<TEXTAREA %s NAME=\"attendees\" wrap=soft "
wprintf("</FORM>\n");
- wprintf("<SCRIPT language=\"javascript\">"
+ wprintf("<script type=\"text/javascript\">"
"<!--"
"if (document.EventForm.alldayevent.checked) {"
"document.EventForm.dtstart_hour.value='0';"
"document.EventForm.dtend_year.disabled = false;"
"}"
"//-->"
- "</SCRIPT>\n"
+ "</script>\n"
);
- do_template("endbox");
+ wprintf("</td></tr></table></div>\n");
wDumpContent(1);
if (created_new_vevent) {
lprintf(9, "Give this event a UID if it doesn't have one.\n");
if (icalcomponent_get_first_property(vevent,
ICAL_UID_PROPERTY) == NULL) {
- generate_new_uid(buf);
+ generate_uuid(buf);
icalcomponent_add_property(vevent,
icalproperty_new_uid(buf)
);
/* If the user clicked 'Save' then save it to the server. */
lprintf(9, "Serializing it for saving\n");
if ( (encaps != NULL) && (!strcasecmp(bstr("sc"), "Save")) ) {
- serv_puts("ENT0 1|||4");
+ serv_puts("ENT0 1|||4|||1|");
serv_gets(buf);
- if (buf[0] == '4') {
+ if (buf[0] == '8') {
serv_puts("Content-type: text/calendar");
serv_puts("");
serv_puts(icalcomponent_as_ical_string(encaps));
serv_puts("000");
}
+ while (serv_gets(buf), strcmp(buf, "000")) {
+ lprintf(9, "ENT0 REPLY: %s\n", buf);
+ }
icalcomponent_free(encaps);
}