]> code.citadel.org Git - citadel.git/commitdiff
* Polish up the meeting reply code.
authorArt Cancro <ajc@citadel.org>
Tue, 12 Nov 2002 04:48:18 +0000 (04:48 +0000)
committerArt Cancro <ajc@citadel.org>
Tue, 12 Nov 2002 04:48:18 +0000 (04:48 +0000)
webcit/calendar.c
webcit/event.c

index 90c3586a3f45bf4905855e59edf114628d49526e..c95b02e1013f373551ff48a205f955bc95a562bb 100644 (file)
@@ -125,18 +125,18 @@ void cal_process_object(icalcomponent *cal,
        }
 
        p = icalcomponent_get_first_property(cal, ICAL_SUMMARY_PROPERTY);
-        if (p != NULL) {
+       if (p != NULL) {
                wprintf("<TR><TD><B>Summary:</B></TD><TD>");
                escputs((char *)icalproperty_get_comment(p));
                wprintf("</TD></TR>\n");
-        }
+       }
 
        p = icalcomponent_get_first_property(cal, ICAL_LOCATION_PROPERTY);
-        if (p != NULL) {
+       if (p != NULL) {
                wprintf("<TR><TD><B>Location:</B></TD><TD>");
                escputs((char *)icalproperty_get_comment(p));
                wprintf("</TD></TR>\n");
-        }
+       }
 
        /*
         * Only show start/end times if we're actually looking at the VEVENT
@@ -146,7 +146,7 @@ void cal_process_object(icalcomponent *cal,
 
                p = icalcomponent_get_first_property(cal,
                                                ICAL_DTSTART_PROPERTY);
-               if (p != NULL) {
+               if (p != NULL) {
                        t = icalproperty_get_dtstart(p);
                        tt = icaltime_as_timet(t);
                        fmt_date(buf, tt);
@@ -156,7 +156,7 @@ void cal_process_object(icalcomponent *cal,
                }
        
                p = icalcomponent_get_first_property(cal, ICAL_DTEND_PROPERTY);
-               if (p != NULL) {
+               if (p != NULL) {
                        t = icalproperty_get_dtend(p);
                        tt = icaltime_as_timet(t);
                        fmt_date(buf, tt);
@@ -168,11 +168,11 @@ void cal_process_object(icalcomponent *cal,
        }
 
        p = icalcomponent_get_first_property(cal, ICAL_DESCRIPTION_PROPERTY);
-        if (p != NULL) {
+       if (p != NULL) {
                wprintf("<TR><TD><B>Description:</B></TD><TD>");
                escputs((char *)icalproperty_get_comment(p));
                wprintf("</TD></TR>\n");
-        }
+       }
 
        /* If the component has subcomponents, recurse through them. */
        for (c = icalcomponent_get_first_component(cal, ICAL_ANY_COMPONENT);
@@ -290,7 +290,36 @@ void respond_to_request(void) {
                bstr("sc")
        );
        serv_gets(buf);
-       escputs(buf);
+
+       if (buf[0] == '2') {
+               wprintf("<TABLE BORDER=0><TR><TD>"
+                       "<IMG SRC=\"static/vcalendar.gif\" ALIGN=CENTER>"
+                       "</TD><TD>"
+               );
+               if (!strcasecmp(bstr("sc"), "accept")) {
+                       wprintf("You have accepted this meeting invitation.  "
+                               "It has been entered into your calendar, "
+                       );
+               } else if (!strcasecmp(bstr("sc"), "tentative")) {
+                       wprintf("You have tentatively accepted this meeting invitation.  "
+                               "It has been 'pencilled in' to your calendar, "
+                       );
+               } else if (!strcasecmp(bstr("sc"), "decline")) {
+                       wprintf("You have declined this meeting invitation.  "
+                               "It has <b>not</b> been entered into your calendar, "
+                       );
+               }
+               wprintf("and a reply has been sent to the meeting organizer."
+                       "</TD></TR></TABLE>\n"
+               );
+       } else {
+               wprintf("<IMG SRC=\"static/error.gif\" ALIGN=CENTER>"
+                       "%s\n", &buf[4]);
+       }
+
+       wprintf("<A HREF=\"/dotskip?room=");
+       urlescputs(WC->wc_roomname);
+       wprintf("\">Return to messages</A><BR>\n");
 
        wDumpContent(1);
 }
index 93632f6a21dac0a322891c65cc3daf6a6e8e0ec2..11ece54543922a827954ffa17bd6cd490db3b8ca 100644 (file)
@@ -59,12 +59,14 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum)
                "</FONT></TD></TR></TABLE><BR>\n"
        );
 
+       /************************************************************
+        * Uncomment this to see the UID in calendar events for debugging
        wprintf("UID == ");
        p = icalcomponent_get_first_property(vevent, ICAL_UID_PROPERTY);
        if (p != NULL) {
                escputs((char *)icalproperty_get_comment(p));
        }
-       wprintf(" (FIXME remove this when done)<BR>\n");
+       *************************************************************/
 
        wprintf("<FORM METHOD=\"POST\" ACTION=\"/save_event\">\n");
        wprintf("<INPUT TYPE=\"hidden\" NAME=\"msgnum\" VALUE=\"%ld\">\n",