* All OS-level includes are now included from webcit.h instead of from
[citadel.git] / webcit / event.c
index 67338c9d989d41daf55aae3df69e0381eceb501d..7211a2c7b9e012c8e962849884b477d909fa4b7f 100644 (file)
@@ -5,25 +5,6 @@
  *
  */
 
-#include <ctype.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <stdio.h>
-#include <fcntl.h>
-#include <signal.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <sys/socket.h>
-#include <limits.h>
-#include <netinet/in.h>
-#include <netdb.h>
-#include <string.h>
-#include <pwd.h>
-#include <errno.h>
-#include <stdarg.h>
-#include <pthread.h>
-#include <signal.h>
-#include <time.h>
 #include "webcit.h"
 #include "webserver.h"
 
@@ -92,6 +73,35 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum)
                "</div>\n<div id=\"content\">\n"
        );
 
+       wprintf("<script type=\"text/javascript\">"
+               "function grey_all_day() { "
+                       "if (document.EventForm.alldayevent.checked) {"
+                               "document.EventForm.dtstart_hour.value='0';"
+                               "document.EventForm.dtstart_hour.disabled = true;"
+                               "document.EventForm.dtstart_minute.value='0';"
+                               "document.EventForm.dtstart_minute.disabled = true;"
+                               "document.EventForm.dtend_hour.value='0';"
+                               "document.EventForm.dtend_hour.disabled = true;"
+                               "document.EventForm.dtend_minute.value='0';"
+                               "document.EventForm.dtend_minute.disabled = true;"
+                               "document.EventForm.dtend_month.disabled = true;"
+                               "document.EventForm.dtend_day.disabled = true;"
+                               "document.EventForm.dtend_year.disabled = true;"
+                       "}"
+                       "else {"
+                               "document.EventForm.dtstart_hour.disabled = false;"
+                               "document.EventForm.dtstart_minute.disabled = false;"
+                               "document.EventForm.dtend_hour.disabled = false;"
+                               "document.EventForm.dtend_minute.disabled = false;"
+                               "document.EventForm.dtend_month.disabled = false;"
+                               "document.EventForm.dtend_day.disabled = false;"
+                               "document.EventForm.dtend_year.disabled = false;"
+                       "}"
+               "}"
+               "</script>\n"
+       );
+
+
        wprintf("<div id=\"fix_scrollbar_bug\">"
                "<table border=0 width=100%% bgcolor=\"#ffffff\"><tr><td>\n");
 
@@ -179,33 +189,8 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum)
        display_icaltimetype_as_webform(&t_start, "dtstart");
 
        wprintf("<INPUT TYPE=\"checkbox\" NAME=\"alldayevent\" "
-               "VALUE=\"yes\" onClick=\""
-""
-"                      if (this.checked) { "
-"                              this.form.dtstart_hour.value='0'; "
-"                              this.form.dtstart_hour.disabled = true; "
-"                              this.form.dtstart_minute.value='0'; "
-"                              this.form.dtstart_minute.disabled = true; "
-"                              this.form.dtend_hour.value='0'; "
-"                              this.form.dtend_hour.disabled = true; "
-"                              this.form.dtend_minute.value='0'; "
-"                              this.form.dtend_minute.disabled = true; "
-"                              this.form.dtend_month.disabled = true; "
-"                              this.form.dtend_day.disabled = true; "
-"                              this.form.dtend_year.disabled = true; "
-"                      } "
-"                      else { "
-"                              this.form.dtstart_hour.disabled = false; "
-"                              this.form.dtstart_minute.disabled = false; "
-"                              this.form.dtend_hour.disabled = false; "
-"                              this.form.dtend_minute.disabled = false; "
-"                              this.form.dtend_month.disabled = false; "
-"                              this.form.dtend_day.disabled = false; "
-"                              this.form.dtend_year.disabled = false; "
-"                      } "
-" "
-" "
-"              \" %s >All day event",
+               "VALUE=\"yes\" onClick=\"grey_all_day();\""
+               " %s >All day event",
                (t_start.is_date ? "CHECKED" : "" )
        );
 
@@ -374,35 +359,11 @@ void display_edit_individual_event(icalcomponent *supplied_vevent, long msgnum)
 
        wprintf("</FORM>\n");
        
+       wprintf("</td></tr></table></div>\n");
        wprintf("<script type=\"text/javascript\">"
-               "<!--"
-                       "if (document.EventForm.alldayevent.checked) {"
-                               "document.EventForm.dtstart_hour.value='0';"
-                               "document.EventForm.dtstart_hour.disabled = true;"
-                               "document.EventForm.dtstart_minute.value='0';"
-                               "document.EventForm.dtstart_minute.disabled = true;"
-                               "document.EventForm.dtend_hour.value='0';"
-                               "document.EventForm.dtend_hour.disabled = true;"
-                               "document.EventForm.dtend_minute.value='0';"
-                               "document.EventForm.dtend_minute.disabled = true;"
-                               "document.EventForm.dtend_month.disabled = true;"
-                               "document.EventForm.dtend_day.disabled = true;"
-                               "document.EventForm.dtend_year.disabled = true;"
-                       "}"
-                       "else {"
-                               "document.EventForm.dtstart_hour.disabled = false;"
-                               "document.EventForm.dtstart_minute.disabled = false;"
-                               "document.EventForm.dtend_hour.disabled = false;"
-                               "document.EventForm.dtend_minute.disabled = false;"
-                               "document.EventForm.dtend_month.disabled = false;"
-                               "document.EventForm.dtend_day.disabled = false;"
-                               "document.EventForm.dtend_year.disabled = false;"
-                       "}"
-               "//-->"
+               "grey_all_day();"
                "</script>\n"
        );
-
-       wprintf("</td></tr></table></div>\n");
        wDumpContent(1);
 
        if (created_new_vevent) {