+ /**
+ * For a new event, the user creating the event should be the
+ * organizer. Set this field accordingly.
+ */
+ if (icalcomponent_get_first_property(vevent, ICAL_ORGANIZER_PROPERTY)
+ == NULL) {
+ sprintf(organizer_string, "MAILTO:%s", WC->cs_inet_email);
+ icalcomponent_add_property(vevent,
+ icalproperty_new_organizer(organizer_string)
+ );
+ }
+
+ /**
+ * Determine who is the organizer of this event.
+ * We need to determine "me" or "not me."
+ */
+ organizer = icalcomponent_get_first_property(vevent, ICAL_ORGANIZER_PROPERTY);
+ if (organizer != NULL) {
+ strcpy(organizer_string, icalproperty_get_organizer(organizer));
+ if (!strncasecmp(organizer_string, "MAILTO:", 7)) {
+ strcpy(organizer_string, &organizer_string[7]);
+ striplt(organizer_string);
+ serv_printf("ISME %s", organizer_string);
+ serv_getln(buf, sizeof buf);
+ if (buf[0] == '2') {
+ organizer_is_me = 1;
+ }
+ }
+ }
+
+ wprintf("<TR><TD><B>");
+ wprintf(_("Organizer"));
+ wprintf("</B></TD><TD>");
+ escputs(organizer_string);
+ if (organizer_is_me) {
+ wprintf(" <FONT SIZE=-1><I>");
+ wprintf(_("(you are the organizer)"));
+ wprintf("</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");
+
+ /** Transparency */
+ wprintf("<TR><TD><B>");
+ wprintf(_("Show time as:"));
+ wprintf("</B></TD><TD>");
+
+ p = icalcomponent_get_first_property(vevent, ICAL_TRANSP_PROPERTY);
+ if (p == NULL) {
+ /** No transparency found. Default to opaque (busy). */
+ p = icalproperty_new_transp(ICAL_TRANSP_OPAQUE);
+ if (p != NULL) {
+ icalcomponent_add_property(vevent, p);
+ }
+ }
+ if (p != NULL) {
+ v = icalproperty_get_value(p);
+ }
+ else {
+ v = NULL;
+ }
+
+ wprintf("<INPUT TYPE=\"radio\" NAME=\"transp\" VALUE=\"transparent\"");
+ if (v != NULL) if (icalvalue_get_transp(v) == ICAL_TRANSP_TRANSPARENT)
+ wprintf(" CHECKED");
+ wprintf(">");
+ wprintf(_("Free"));
+ wprintf(" ");
+
+ wprintf("<INPUT TYPE=\"radio\" NAME=\"transp\" VALUE=\"opaque\"");
+ if (v != NULL) if (icalvalue_get_transp(v) == ICAL_TRANSP_OPAQUE)
+ wprintf(" CHECKED");
+ wprintf(">");
+ wprintf(_("Busy"));
+
+ wprintf("</TD></TR>\n");
+
+ /** Attendees */
+ wprintf("<TR><TD><B>");
+ wprintf(_("Attendees"));
+ wprintf("</B><br />"
+ "<font size=-2>");
+ wprintf(_("(One per line)"));
+ wprintf("</font>\n");
+
+ /** Pop open an address book -- begin **/
+ wprintf(
+ " <a href=\"javascript:PopOpenAddressBook('attendees_box|%s');\" "
+ "title=\"%s\">"
+ "<img align=middle border=0 width=24 height=24 src=\"static/viewcontacts_24x.gif\">"
+ "</a>",
+ _("Attendees"),
+ _("Contacts")
+ );
+ /** Pop open an address book -- end **/
+
+ wprintf("</TD><TD>"
+ "<TEXTAREA %s NAME=\"attendees\" id=\"attendees_box\" wrap=soft "
+ "ROWS=3 COLS=80 WIDTH=80>\n",
+ (organizer_is_me ? "" : "DISABLED ")
+ );
+ i = 0;
+ for (attendee = icalcomponent_get_first_property(vevent, ICAL_ATTENDEE_PROPERTY);
+ attendee != NULL;
+ attendee = icalcomponent_get_next_property(vevent, ICAL_ATTENDEE_PROPERTY)) {
+ strcpy(attendee_string, icalproperty_get_attendee(attendee));
+ if (!strncasecmp(attendee_string, "MAILTO:", 7)) {
+
+ /** screen name or email address */
+ strcpy(attendee_string, &attendee_string[7]);
+ striplt(attendee_string);
+ if (i++) wprintf("\n");
+ escputs(attendee_string);
+ wprintf(" ");
+
+ /** participant status */
+ partstat_as_string(buf, attendee);
+ escputs(buf);
+ }
+ }
+ wprintf("</TEXTAREA></TD></TR>\n");
+
+ /** Done with properties. */
+ wprintf("</TABLE>\n<CENTER>"
+ "<INPUT TYPE=\"submit\" NAME=\"save_button\" VALUE=\"%s\">"
+ " "
+ "<INPUT TYPE=\"submit\" NAME=\"delete_button\" VALUE=\"%s\">\n"