* Worked on meeting accept/decline a little bit
authorArt Cancro <ajc@citadel.org>
Thu, 3 Oct 2002 03:40:31 +0000 (03:40 +0000)
committerArt Cancro <ajc@citadel.org>
Thu, 3 Oct 2002 03:40:31 +0000 (03:40 +0000)
webcit/ChangeLog
webcit/calendar.c
webcit/calendar_tools.c
webcit/calendar_view.c
webcit/event.c
webcit/messages.c
webcit/roomops.c
webcit/useredit.c
webcit/vcard_edit.c

index 4c0592dcbf256ec3158c925a7dbd834fa2907b88..4ee5c35f343dadbed596048817f13172c624bc0b 100644 (file)
@@ -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 <ajc@uncnsrd.mt-kisco.ny.us>
 
 1998-12-03 Nathan Bryant <bryant@cs.usm.maine.edu>
        * webserver.c: warning fix
+
index c1ed94ec40daa16c8a996315fbecd3704e23ed10..4f54c8105a0ee6b75c74d936ff56abcd0f69a019 100644 (file)
@@ -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.<BR>\n");
+                       wprintf("<CENTER><IMG ALIGN=CENTER "
+                               "SRC=\"/static/vcalendar.gif\">"
+                               "&nbsp;&nbsp;"  
+                               "<B>Meeting invitation</B></CENTER><BR>\n"
+                       );
                        break;
                    default:
                        wprintf("I don't know what to do with this.<BR>\n");
@@ -94,6 +101,45 @@ void cal_process_object(icalcomponent *cal,
                }
        }
 
+       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);
@@ -102,6 +148,17 @@ void cal_process_object(icalcomponent *cal,
                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\">"
+                       "&nbsp;&nbsp;"
+                       "<INPUT TYPE=\"submit\" NAME=\"sc\" "
+                               "VALUE=\"Decline\">"
+                       "</FORM></CENTER>\n"
+               );
+       }
 }
 
 
@@ -112,7 +169,6 @@ void cal_process_object(icalcomponent *cal,
 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) {
index 49fbcb7642310420283712fec97cf6b07b1bf691..f61828e935407ed58856a40368cf80575131ee24 100644 (file)
@@ -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);
index 28550be8e48cc5ff91c37aa94cc7b9d503fd2ed9..a015a869c39720479f8567f1b6cba5755129058e 100644 (file)
@@ -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("<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);
index b21ac75cd7e26db87d40528c7e8330a315ab3412..93632f6a21dac0a322891c65cc3daf6a6e8e0ec2 100644 (file)
@@ -53,7 +53,7 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum)
 
        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"
@@ -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,
index 2428675db3e7f91915b5cf62ee4717e4b4e0b14f..f20819824a8165f8a2dabaf3dd2ca753da2cb399 100644 (file)
@@ -112,7 +112,7 @@ void display_parsed_vcard(struct vCard *v, int full) {
                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");
index 5179453ad16fcce221f1a22295c5266fb8af788f..3be38e15996c9410933a20620c290b3d8c64f5bd 100644 (file)
@@ -1507,7 +1507,7 @@ void display_private(char *rname, int req_pass)
        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>");
@@ -1577,7 +1577,7 @@ void display_zap(void)
        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");
@@ -1639,7 +1639,7 @@ void confirm_delete_room(void)
        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);
index 0460848b6a5ef97abbdcea4d8e30b2bee3fcb822..8424f9d91960d87a72f3a1a4424d894a8d7146b2 100644 (file)
@@ -119,7 +119,7 @@ void display_edit_address_book_entry(char *username, long usernum) {
                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;
@@ -178,7 +178,7 @@ TRYAGAIN:
 
        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;
@@ -221,7 +221,7 @@ void display_edituser(char *supplied_username) {
        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;
@@ -347,7 +347,7 @@ void edituser(void) {
                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 {
@@ -377,7 +377,7 @@ void create_user(void) {
        }
        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);
        }
index f1b6b201da5e8e8dfe8c75a07c10767f9fe4f90c..8dcd227cd4e4b78fb6a7effff1f638b32a50e23c 100644 (file)
@@ -182,7 +182,7 @@ void do_edit_vcard(long msgnum, char *partnum, char *return_to) {
 
        /* 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");