$Log$
+Revision 400.33 2002/10/03 03:40:31 ajc
+* Worked on meeting accept/decline a little bit
+
Revision 400.32 2002/09/30 03:58:35 ajc
* Dabbled in handling incoming meeting requests
1998-12-03 Nathan Bryant <bryant@cs.usm.maine.edu>
* webserver.c: warning fix
+
icalcomponent *c;
icalproperty *method = NULL;
icalproperty_method the_method;
+ icalproperty *p;
+ struct icaltimetype t;
+ time_t tt;
/* Look for a method */
method = icalcomponent_get_first_property(cal, ICAL_METHOD_PROPERTY);
the_method = icalproperty_get_method(method);
switch(the_method) {
case ICAL_METHOD_REQUEST:
- wprintf("This is a request.<BR>\n");
+ wprintf("<CENTER><IMG ALIGN=CENTER "
+ "SRC=\"/static/vcalendar.gif\">"
+ " "
+ "<B>Meeting invitation</B></CENTER><BR>\n"
+ );
break;
default:
wprintf("I don't know what to do with this.<BR>\n");
}
}
+ p = icalcomponent_get_first_property(cal, ICAL_SUMMARY_PROPERTY);
+ if (p != NULL) {
+ wprintf("<B>Summary:</B> ");
+ escputs((char *)icalproperty_get_comment(p));
+ wprintf("<BR>\n");
+ }
+
+ p = icalcomponent_get_first_property(cal, ICAL_LOCATION_PROPERTY);
+ if (p != NULL) {
+ wprintf("<B>Location:</B> ");
+ escputs((char *)icalproperty_get_comment(p));
+ wprintf("<BR>\n");
+ }
+
+ p = icalcomponent_get_first_property(cal, ICAL_DTSTART_PROPERTY);
+ if (p != NULL) {
+ t = icalproperty_get_dtstart(p);
+ tt = icaltime_as_timet(t);
+ wprintf("<B>Starting date/time:</B> %s<BR>",
+ asctime(localtime(&tt))
+ );
+ }
+
+ p = icalcomponent_get_first_property(cal, ICAL_DTEND_PROPERTY);
+ if (p != NULL) {
+ t = icalproperty_get_dtstart(p);
+ tt = icaltime_as_timet(t);
+ wprintf("<B>Ending date/time:</B> %s<BR>",
+ asctime(localtime(&tt))
+ );
+ }
+
+ p = icalcomponent_get_first_property(cal, ICAL_DESCRIPTION_PROPERTY);
+ if (p != NULL) {
+ wprintf("<B>Description:</B> ");
+ escputs((char *)icalproperty_get_comment(p));
+ wprintf("<BR>\n");
+ }
+
/* If the component has subcomponents, recurse through them. */
for (c = icalcomponent_get_first_component(cal, ICAL_ANY_COMPONENT);
(c != 0);
cal_process_object(c, recursion_level+1);
}
+ if (recursion_level == 0) {
+ wprintf("<CENTER><FORM METHOD=\"GET\" "
+ "ACTION=\"/respond_to_request\">\n"
+ "<INPUT TYPE=\"submit\" NAME=\"sc\" "
+ "VALUE=\"Accept\">"
+ " "
+ "<INPUT TYPE=\"submit\" NAME=\"sc\" "
+ "VALUE=\"Decline\">"
+ "</FORM></CENTER>\n"
+ );
+ }
}
void cal_process_attachment(char *part_source) {
icalcomponent *cal;
- wprintf("Processing calendar attachment<BR>\n");
cal = icalcomponent_new_from_string(part_source);
if (cal == NULL) {
if (!strcasecmp(bstr(vname), "yes")) {
t.hour = 0;
t.minute = 0;
+ t.second = 0;
t.is_date = 1;
+ lprintf(9, "icaltime_from_webform() setting is_date\n");
}
t = icaltime_normalize(t);
/* Now the middle of the day... */
for (hour = 8; hour <= 17; ++hour) { /* could do HEIGHT=xx */
wprintf("<TR><TD BGCOLOR=FFFFFF VALIGN=TOP>");
- wprintf("%d:00 ", hour);
+ wprintf("%d:00%s ",
+ (hour <= 12 ? hour : hour-12),
+ (hour < 12 ? "am" : "pm")
+ );
/* put the data here, stupid */
calendar_day_view_display_events(year, month, day, hour);
output_headers(3);
wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=007700><TR><TD>"
- "<IMG VALIGN=CENTER SRC=\"/static/vcalendar.gif\">"
+ "<IMG ALIGN=CENTER SRC=\"/static/vcalendar.gif\">"
"<FONT SIZE=+1 COLOR=\"FFFFFF\""
"<B>Edit event</B>"
"</FONT></TD></TR></TABLE><BR>\n"
icalproperty *prop;
icalcomponent *vevent;
int created_new_vevent = 0;
+ int all_day_event = 0;
+ struct icaltimetype event_start;
if (supplied_vevent != NULL) {
vevent = supplied_vevent;
ICAL_DTSTART_PROPERTY), prop != NULL) {
icalcomponent_remove_property(vevent, prop);
}
+ event_start = icaltime_from_webform("dtstart");
+ if (event_start.is_date) {
+ lprintf(9, "*** all day event ***\n");
+ all_day_event = 1;
+ }
icalcomponent_add_property(vevent,
- icalproperty_new_dtstart(
- icaltime_from_webform("dtstart")
- )
+ icalproperty_new_dtstart(event_start)
);
while (prop = icalcomponent_get_first_property(vevent,
- ICAL_DUE_PROPERTY), prop != NULL) {
+ ICAL_DTEND_PROPERTY), prop != NULL) {
icalcomponent_remove_property(vevent, prop);
}
- icalcomponent_add_property(vevent,
- icalproperty_new_due(
- icaltime_from_webform("due")
- )
- );
+ while (prop = icalcomponent_get_first_property(vevent,
+ ICAL_DURATION_PROPERTY), prop != NULL) {
+ icalcomponent_remove_property(vevent, prop);
+ }
+ if (all_day_event == 0) {
+ icalcomponent_add_property(vevent,
+ icalproperty_new_dtend(
+ icaltime_from_webform("dtend")
+ )
+ );
+ }
/* Give this event a UID if it doesn't have one. */
if (icalcomponent_get_first_property(vevent,
if (!strcasecmp(v->prop[i].name, "n")) {
wprintf("<TR BGCOLOR=#AAAAAA>"
"<TD BGCOLOR=#FFFFFF>"
- "<IMG VALIGN=CENTER SRC=\"/static/vcard.gif\"></TD>"
+ "<IMG ALIGN=CENTER SRC=\"/static/vcard.gif\"></TD>"
"<TD><FONT SIZE=+1><B>");
escputs(v->prop[i].value);
wprintf("</B></FONT></TD></TR>\n");
wprintf("so you don't have to keep returning here.\n");
wprintf("<BR><BR>");
- wprintf("<FORM METHOD=\"POST\" ACTION=\"/goto_private\">\n");
+ wprintf("<FORM METHOD=\"GET\" ACTION=\"/goto_private\">\n");
wprintf("<TABLE border><TR><TD>");
wprintf("Enter room name:</TD><TD>");
wprintf("disappear from your room list. Is this what you wish ");
wprintf("to do?<BR>\n");
- wprintf("<FORM METHOD=\"POST\" ACTION=\"/zap\">\n");
+ wprintf("<FORM METHOD=\"GET\" ACTION=\"/zap\">\n");
wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"OK\">");
wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">");
wprintf("</FORM>\n");
wprintf("</FONT></TD></TR></TABLE>\n");
wprintf("<CENTER>");
- wprintf("<FORM METHOD=\"POST\" ACTION=\"/delete_room\">\n");
+ wprintf("<FORM METHOD=\"GET\" ACTION=\"/delete_room\">\n");
wprintf("Are you sure you want to delete <FONT SIZE=+1>");
escputs(WC->wc_roomname);
serv_gets(buf);
if (buf[0] != '2') {
sprintf(error_message,
- "<IMG SRC=\"static/error.gif\" VALIGN=CENTER>"
+ "<IMG SRC=\"static/error.gif\" ALIGN=CENTER>"
"%s<BR><BR>\n", &buf[4]);
select_user_to_edit(error_message, username);
return;
if (vcard_msgnum < 0) {
sprintf(error_message,
- "<IMG SRC=\"static/error.gif\" VALIGN=CENTER>"
+ "<IMG SRC=\"static/error.gif\" ALIGN=CENTER>"
"Could not create/edit vCard<BR><BR>\n");
select_user_to_edit(error_message, username);
return;
serv_gets(buf);
if (buf[0] != '2') {
sprintf(error_message,
- "<IMG SRC=\"static/error.gif\" VALIGN=CENTER>"
+ "<IMG SRC=\"static/error.gif\" ALIGN=CENTER>"
"%s<BR><BR>\n", &buf[4]);
select_user_to_edit(error_message, username);
return;
serv_gets(buf);
if (buf[0] != '2') {
sprintf(message,
- "<IMG SRC=\"static/error.gif\" VALIGN=CENTER>"
+ "<IMG SRC=\"static/error.gif\" ALIGN=CENTER>"
"%s<BR><BR>\n", &buf[4]);
}
else {
}
else {
sprintf(error_message,
- "<IMG SRC=\"static/error.gif\" VALIGN=CENTER>"
+ "<IMG SRC=\"static/error.gif\" ALIGN=CENTER>"
"%s<BR><BR>\n", &buf[4]);
select_user_to_edit(error_message, NULL);
}
/* Display the form */
wprintf("<FORM METHOD=\"POST\" ACTION=\"/submit_vcard\">\n");
- wprintf("<H2><IMG VALIGN=CENTER SRC=\"/static/vcard.gif\">"
+ wprintf("<H2><IMG ALIGN=CENTER SRC=\"/static/vcard.gif\">"
"Contact information for ");
escputs(whatuser);
wprintf("</H2>\n");