* Submit organizer in a hidden field, in case the server needs it
authorArt Cancro <ajc@citadel.org>
Sat, 30 Nov 2002 21:34:51 +0000 (21:34 +0000)
committerArt Cancro <ajc@citadel.org>
Sat, 30 Nov 2002 21:34:51 +0000 (21:34 +0000)
webcit/ChangeLog
webcit/event.c

index 68e45014a0782825cb8ad9f1f52cce8ee5ecc564..53850d3945a333338c6c0819b00d3ba8bb43fe7d 100644 (file)
@@ -1,4 +1,7 @@
 $Log$
+Revision 400.60  2002/11/30 21:34:51  ajc
+* Submit organizer in a hidden field, in case the server needs it
+
 Revision 400.59  2002/11/30 04:46:46  ajc
 * First cut at adding/removing attendees to an event
   (Actual invitations should be sent by the Citadel server)
@@ -1154,4 +1157,3 @@ 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 0af2eec1d9789e9f2f588c7778e8e55a302fce79..dda0dded03b1cd8d30523656342e23dca08f3cea 100644 (file)
@@ -242,6 +242,17 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum)
                wprintf(" <FONT SIZE=-1><I>"
                        "(you are the organizer)</I></FONT>\n");
        }
+
+       /*
+        * Transmit the organizer as a hidden field.   We don't want the user
+        * to be able to change it, but we do want it fed back to the server,
+        * especially if this is a new event and there is no organizer already
+        * in the calendar object.
+        */
+       wprintf("<INPUT TYPE=\"hidden\" NAME=\"organizer\" VALUE=\"");
+       escputs(organizer_string);
+       wprintf("\">");
+
        wprintf("</TD></TR>\n");
 
        /* Attendees (do more with this later) */
@@ -328,6 +339,7 @@ void save_individual_event(icalcomponent *supplied_vevent, long msgnum) {
        int i;
        int foundit;
        char form_attendees[SIZ];
+       char organizer_string[SIZ];
 
        if (supplied_vevent != NULL) {
                vevent = supplied_vevent;
@@ -434,6 +446,22 @@ void save_individual_event(icalcomponent *supplied_vevent, long msgnum) {
                        );
                }
 
+               /* Set the organizer, only if one does not already exist *and*
+                * the form is supplying one
+                */
+               strcpy(buf, bstr("organizer"));
+               if ( (icalcomponent_get_first_property(vevent,
+                  ICAL_ORGANIZER_PROPERTY) == NULL) 
+                  && (strlen(buf) > 0) ) {
+
+                       /* set new organizer */
+                       sprintf(organizer_string, "MAILTO:%s", buf);
+                       icalcomponent_add_property(vevent,
+                               icalproperty_new_organizer(organizer_string)
+                       );
+
+               }
+
                /*
                 * Add any new attendees listed in the web form
                 */