From c6f1a8ea5b3950cc06c4e649ebd7d0bc59cb948f Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Thu, 3 Oct 2002 03:40:31 +0000 Subject: [PATCH] * Worked on meeting accept/decline a little bit --- webcit/ChangeLog | 4 +++ webcit/calendar.c | 60 +++++++++++++++++++++++++++++++++++++++-- webcit/calendar_tools.c | 2 ++ webcit/calendar_view.c | 5 +++- webcit/event.c | 31 ++++++++++++++------- webcit/messages.c | 2 +- webcit/roomops.c | 6 ++--- webcit/useredit.c | 10 +++---- webcit/vcard_edit.c | 2 +- 9 files changed, 99 insertions(+), 23 deletions(-) diff --git a/webcit/ChangeLog b/webcit/ChangeLog index 4c0592dcb..4ee5c35f3 100644 --- a/webcit/ChangeLog +++ b/webcit/ChangeLog @@ -1,4 +1,7 @@ $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 @@ -1049,3 +1052,4 @@ Sun Dec 6 19:50:55 EST 1998 Art Cancro 1998-12-03 Nathan Bryant * webserver.c: warning fix + diff --git a/webcit/calendar.c b/webcit/calendar.c index c1ed94ec4..4f54c8105 100644 --- a/webcit/calendar.c +++ b/webcit/calendar.c @@ -77,6 +77,9 @@ void cal_process_object(icalcomponent *cal, 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); @@ -86,7 +89,11 @@ void cal_process_object(icalcomponent *cal, the_method = icalproperty_get_method(method); switch(the_method) { case ICAL_METHOD_REQUEST: - wprintf("This is a request.
\n"); + wprintf("
" + "  " + "Meeting invitation

\n" + ); break; default: wprintf("I don't know what to do with this.
\n"); @@ -94,6 +101,45 @@ void cal_process_object(icalcomponent *cal, } } + p = icalcomponent_get_first_property(cal, ICAL_SUMMARY_PROPERTY); + if (p != NULL) { + wprintf("Summary: "); + escputs((char *)icalproperty_get_comment(p)); + wprintf("
\n"); + } + + p = icalcomponent_get_first_property(cal, ICAL_LOCATION_PROPERTY); + if (p != NULL) { + wprintf("Location: "); + escputs((char *)icalproperty_get_comment(p)); + wprintf("
\n"); + } + + p = icalcomponent_get_first_property(cal, ICAL_DTSTART_PROPERTY); + if (p != NULL) { + t = icalproperty_get_dtstart(p); + tt = icaltime_as_timet(t); + wprintf("Starting date/time: %s
", + 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("Ending date/time: %s
", + asctime(localtime(&tt)) + ); + } + + p = icalcomponent_get_first_property(cal, ICAL_DESCRIPTION_PROPERTY); + if (p != NULL) { + wprintf("Description: "); + escputs((char *)icalproperty_get_comment(p)); + wprintf("
\n"); + } + /* If the component has subcomponents, recurse through them. */ for (c = icalcomponent_get_first_component(cal, ICAL_ANY_COMPONENT); (c != 0); @@ -102,6 +148,17 @@ void cal_process_object(icalcomponent *cal, cal_process_object(c, recursion_level+1); } + if (recursion_level == 0) { + wprintf("
\n" + "" + "  " + "" + "
\n" + ); + } } @@ -112,7 +169,6 @@ void cal_process_object(icalcomponent *cal, void cal_process_attachment(char *part_source) { icalcomponent *cal; - wprintf("Processing calendar attachment
\n"); cal = icalcomponent_new_from_string(part_source); if (cal == NULL) { diff --git a/webcit/calendar_tools.c b/webcit/calendar_tools.c index 49fbcb764..f61828e93 100644 --- a/webcit/calendar_tools.c +++ b/webcit/calendar_tools.c @@ -136,7 +136,9 @@ struct icaltimetype icaltime_from_webform(char *prefix) { 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); diff --git a/webcit/calendar_view.c b/webcit/calendar_view.c index 28550be8e..a015a869c 100644 --- a/webcit/calendar_view.c +++ b/webcit/calendar_view.c @@ -299,7 +299,10 @@ void calendar_day_view(int year, int month, int day) { /* Now the middle of the day... */ for (hour = 8; hour <= 17; ++hour) { /* could do HEIGHT=xx */ wprintf(""); - 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); diff --git a/webcit/event.c b/webcit/event.c index b21ac75cd..93632f6a2 100644 --- a/webcit/event.c +++ b/webcit/event.c @@ -53,7 +53,7 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum) output_headers(3); wprintf("
" - "" + "" "Edit event" "

\n" @@ -158,6 +158,8 @@ void save_individual_event(icalcomponent *supplied_vevent, long msgnum) { 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; @@ -196,21 +198,30 @@ void save_individual_event(icalcomponent *supplied_vevent, long msgnum) { 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, diff --git a/webcit/messages.c b/webcit/messages.c index 2428675db..f20819824 100644 --- a/webcit/messages.c +++ b/webcit/messages.c @@ -112,7 +112,7 @@ void display_parsed_vcard(struct vCard *v, int full) { if (!strcasecmp(v->prop[i].name, "n")) { wprintf("" "" - "" + "" ""); escputs(v->prop[i].value); wprintf("\n"); diff --git a/webcit/roomops.c b/webcit/roomops.c index 5179453ad..3be38e159 100644 --- a/webcit/roomops.c +++ b/webcit/roomops.c @@ -1507,7 +1507,7 @@ void display_private(char *rname, int req_pass) wprintf("so you don't have to keep returning here.\n"); wprintf("

"); - wprintf("
\n"); + wprintf("\n"); wprintf("
"); wprintf("Enter room name:"); @@ -1577,7 +1577,7 @@ void display_zap(void) wprintf("disappear from your room list. Is this what you wish "); wprintf("to do?
\n"); - wprintf("\n"); + wprintf("\n"); wprintf(""); wprintf(""); wprintf("\n"); @@ -1639,7 +1639,7 @@ void confirm_delete_room(void) wprintf("
\n"); wprintf("
"); - wprintf("
\n"); + wprintf("\n"); wprintf("Are you sure you want to delete "); escputs(WC->wc_roomname); diff --git a/webcit/useredit.c b/webcit/useredit.c index 0460848b6..8424f9d91 100644 --- a/webcit/useredit.c +++ b/webcit/useredit.c @@ -119,7 +119,7 @@ void display_edit_address_book_entry(char *username, long usernum) { serv_gets(buf); if (buf[0] != '2') { sprintf(error_message, - "" + "" "%s

\n", &buf[4]); select_user_to_edit(error_message, username); return; @@ -178,7 +178,7 @@ TRYAGAIN: if (vcard_msgnum < 0) { sprintf(error_message, - "" + "" "Could not create/edit vCard

\n"); select_user_to_edit(error_message, username); return; @@ -221,7 +221,7 @@ void display_edituser(char *supplied_username) { serv_gets(buf); if (buf[0] != '2') { sprintf(error_message, - "" + "" "%s

\n", &buf[4]); select_user_to_edit(error_message, username); return; @@ -347,7 +347,7 @@ void edituser(void) { serv_gets(buf); if (buf[0] != '2') { sprintf(message, - "" + "" "%s

\n", &buf[4]); } else { @@ -377,7 +377,7 @@ void create_user(void) { } else { sprintf(error_message, - "" + "" "%s

\n", &buf[4]); select_user_to_edit(error_message, NULL); } diff --git a/webcit/vcard_edit.c b/webcit/vcard_edit.c index f1b6b201d..8dcd227cd 100644 --- a/webcit/vcard_edit.c +++ b/webcit/vcard_edit.c @@ -182,7 +182,7 @@ void do_edit_vcard(long msgnum, char *partnum, char *return_to) { /* Display the form */ wprintf("\n"); - wprintf("

" + wprintf("

" "Contact information for "); escputs(whatuser); wprintf("

\n"); -- 2.39.2