* siteconfig.c: fixed a spelling error
authorArt Cancro <ajc@citadel.org>
Sun, 25 May 2003 04:25:20 +0000 (04:25 +0000)
committerArt Cancro <ajc@citadel.org>
Sun, 25 May 2003 04:25:20 +0000 (04:25 +0000)
* event.c: add a "Check attendee availability" button, and the code to
  bypass saving the event to the server, do something with it, and then
  feed the twiddled data structure back to the form display function for
  further editing.  What's still missing is the code to do the actual
  availability check.

webcit/ChangeLog
webcit/event.c
webcit/siteconfig.c
webcit/static/iconbar.html

index b3e1eda361677a48e07faf0d726554b3736d77d5..d494bfeef290041a530d877cc560d3880550f1fa 100644 (file)
@@ -1,4 +1,12 @@
 $Log$
+Revision 410.35  2003/05/25 04:25:12  ajc
+* siteconfig.c: fixed a spelling error
+* event.c: add a "Check attendee availability" button, and the code to
+  bypass saving the event to the server, do something with it, and then
+  feed the twiddled data structure back to the form display function for
+  further editing.  What's still missing is the code to do the actual
+  availability check.
+
 Revision 410.34  2003/05/24 22:22:35  ajc
 * Small stylesheet hack to make it work with b0rken IE
 
@@ -1413,3 +1421,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 019bd0c85068d27164c4c7e64d1f2b907e39cf0a..898039e115fedec29895a1d990b061dd6e934d42 100644 (file)
@@ -57,8 +57,8 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum)
        if (supplied_vevent != NULL) {
                vevent = supplied_vevent;
                /* If we're looking at a fully encapsulated VCALENDAR
-                * rather than a VTODO component, attempt to use the first
-                * relevant VTODO subcomponent.  If there is none, the
+                * rather than a VEVENT component, attempt to use the first
+                * relevant VEVENT subcomponent.  If there is none, the
                 * NULL returned by icalcomponent_get_first_component() will
                 * tell the next iteration of this function to create a
                 * new one.
@@ -357,6 +357,9 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum)
                "&nbsp;&nbsp;"
                "<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Delete\">\n"
                "&nbsp;&nbsp;"
+               "<INPUT TYPE=\"submit\" NAME=\"sc\" "
+                               "VALUE=\"Check attendee availability\">\n"
+               "&nbsp;&nbsp;"
                "<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\">\n"
                "</CENTER>\n"
        );
@@ -422,8 +425,8 @@ void save_individual_event(icalcomponent *supplied_vevent, long msgnum) {
        if (supplied_vevent != NULL) {
                vevent = supplied_vevent;
                /* If we're looking at a fully encapsulated VCALENDAR
-                * rather than a VTODO component, attempt to use the first
-                * relevant VTODO subcomponent.  If there is none, the
+                * rather than a VEVENT component, attempt to use the first
+                * relevant VEVENT subcomponent.  If there is none, the
                 * NULL returned by icalcomponent_get_first_component() will
                 * tell the next iteration of this function to create a
                 * new one.
@@ -431,7 +434,7 @@ void save_individual_event(icalcomponent *supplied_vevent, long msgnum) {
                if (icalcomponent_isa(vevent) == ICAL_VCALENDAR_COMPONENT) {
                        save_individual_event(
                                icalcomponent_get_first_component(
-                                       vevent, ICAL_VTODO_COMPONENT
+                                       vevent, ICAL_VEVENT_COMPONENT
                                ), msgnum
                        );
                        return;
@@ -442,7 +445,8 @@ void save_individual_event(icalcomponent *supplied_vevent, long msgnum) {
                created_new_vevent = 1;
        }
 
-       if (!strcasecmp(bstr("sc"), "Save")) {
+       if ( (!strcasecmp(bstr("sc"), "Save"))
+          || (!strcasecmp(bstr("sc"), "Check attendee availability")) ) {
 
                /* Replace values in the component with ones from the form */
 
@@ -648,7 +652,7 @@ STARTOVER:  lprintf(9, "Remove unlisted attendees\n");
                }
 
                /*
-                * Serialize it and save it to the message base.  We clone it first,
+                * Encapsulate event into full VCALENDAR component.  Clone it first,
                 * for two reasons: one, it's easier to just free the whole thing
                 * when we're done instead of unbundling, but more importantly, we
                 * can't encapsulate something that may already be encapsulated
@@ -656,8 +660,10 @@ STARTOVER: lprintf(9, "Remove unlisted attendees\n");
                 */
                lprintf(9, "Encapsulating into full VCALENDAR component\n");
                encaps = ical_encapsulate_subcomponent(icalcomponent_new_clone(vevent));
+
+               /* If the user clicked 'Save' then save it to the server. */
                lprintf(9, "Serializing it for saving\n");
-               if (encaps != NULL) {
+               if ( (encaps != NULL) && (!strcasecmp(bstr("sc"), "Save")) ) {
                        serv_puts("ENT0 1|||4");
                        serv_gets(buf);
                        if (buf[0] == '4') {
@@ -668,6 +674,18 @@ STARTOVER: lprintf(9, "Remove unlisted attendees\n");
                        }
                        icalcomponent_free(encaps);
                }
+
+               /* Or, check attendee availability if the user asked for that. */
+               if ( (encaps != NULL) && (!strcasecmp(bstr("sc"), "Check attendee availability")) ) {
+
+                       /* FIXME ... do the checking and annotating here, idiot */
+
+                       /* This displays the form again, with our annotations */
+                       display_edit_individual_event(encaps, msgnum);
+
+                       icalcomponent_free(encaps);
+               }
+
        }
 
        /*
@@ -683,8 +701,10 @@ STARTOVER: lprintf(9, "Remove unlisted attendees\n");
                icalcomponent_free(vevent);
        }
 
-       /* Go back to the event list */
-       readloop("readfwd");
+       /* If this was a save or deelete, go back to the calendar view. */
+       if (strcasecmp(bstr("sc"), "Check attendee availability")) {
+               readloop("readfwd");
+       }
 }
 
 
index af13b03d190945ca22f3c1d553d47e1f25e2778f..dbe743ecf84b042c2b1ab369e434101180389e52 100644 (file)
@@ -158,7 +158,7 @@ void display_siteconfig(void)
                        wprintf("</TD></TR>\n");
                        break;
                case 22:
-                       wprintf("<TR><TD>Minumum number of worker threads</TD><TD>");
+                       wprintf("<TR><TD>Minimum number of worker threads</TD><TD>");
                        wprintf("<INPUT TYPE=\"text\" NAME=\"c_min_workers\" MAXLENGTH=\"5\" VALUE=\"%s\">", buf);
                        wprintf("</TD></TR>\n");
                        break;
index 0c3b9345dac431bf217dd8a6bed31eb536f25aae..d5a2f0ef545ef548620792ed9c59a3e2193913ee 100644 (file)
 </TR><TR>
        <TD ALIGN="CENTER">
        <SPAN CLASS="iconbar_link">
-       <A HREF="/display_main_menu" TITLE="Advanced Options Menu: Advanced Room commands, Account Info, and Chat" TARGET="workspace"><IMG 
-               BORDER="0" WIDTH="32" HEIGHT="32" SRC="/static/advanced-icon.gif"><BR>Advanced options</A>
+       <A HREF="/display_main_menu"
+               TITLE="Advanced Options Menu: Advanced Room commands, Account Info, and Chat"
+               TARGET="workspace">
+               <IMG BORDER="0" WIDTH="32" HEIGHT="32" SRC="/static/advanced-icon.gif"><BR>
+               Advanced options</A>
        </SPAN>
        </TD>
 </TR>
 <TD ALIGN="CENTER">
        <SPAN CLASS="iconbar_link">
        <A HREF="/termquit" TITLE="Log off" TARGET="_top"
-               onClick="return confirm('Do you really want to log off?');">
+               onClick="return confirm('Log off now?');">
        <IMG BORDER="0" WIDTH="32" HEIGHT="32" SRC="/static/exit-icon.gif"><BR>Log off</A>
        </SPAN>
 </TD>
 </TR><TR>
 <TD ALIGN="CENTER">
        <SPAN CLASS="powered_by">
-       <A HREF="http://uncensored.citadel.org/citadel" TITLE="Find out more about Citadel/UX" TARGET="aboutcit"
+       <A HREF="http://uncensored.citadel.org/citadel"
+               TITLE="Find out more about Citadel/UX" TARGET="aboutcit"
                onMouseOver="window.status='Find out more about Citadel/UX'; return true;">powered by<BR><IMG
                BORDER="0" WIDTH="64" HEIGHT="64" SRC="/static/citadel-logo.jpg" ALT="CITADEL/UX"></A>
        </SPAN>