]> code.citadel.org Git - citadel.git/blobdiff - webcit/calendar.c
* Made all the title boxes the same background color. The old scheme was
[citadel.git] / webcit / calendar.c
index 751d387f3ad987336e428575206dabf6895d3a44..01dd192b1df89a9708168d955d1270dfe831dd4b 100644 (file)
@@ -71,8 +71,6 @@ void display_task(long msgnum) {
  * Process a calendar object
  * ...at this point it's already been deserialized by cal_process_attachment()
  *
- * ok for complete vcalendar objects
- *
  */
 void cal_process_object(icalcomponent *cal,
                        int recursion_level,
@@ -106,8 +104,8 @@ void cal_process_object(icalcomponent *cal,
                                "<IMG ALIGN=CENTER "
                                "SRC=\"/static/vcalendar.gif\">"
                                "&nbsp;&nbsp;"  
-                               "<B>Meeting invitation</B>
-                               </TD></TR>\n"
+                               "<B>Meeting invitation</B>"
+                               "</TD></TR>\n"
                        );
                        break;
                    case ICAL_METHOD_REPLY:
@@ -115,8 +113,8 @@ void cal_process_object(icalcomponent *cal,
                                "<IMG ALIGN=CENTER "
                                "SRC=\"/static/vcalendar.gif\">"
                                "&nbsp;&nbsp;"  
-                               "<B>Attendee's reply to your invitation</B>
-                               </TD></TR>\n"
+                               "<B>Attendee's reply to your invitation</B>"
+                               "</TD></TR>\n"
                        );
                        break;
                    case ICAL_METHOD_PUBLISH:
@@ -124,8 +122,8 @@ void cal_process_object(icalcomponent *cal,
                                "<IMG ALIGN=CENTER "
                                "SRC=\"/static/vcalendar.gif\">"
                                "&nbsp;&nbsp;"  
-                               "<B>Published event</B>
-                               </TD></TR>\n"
+                               "<B>Published event</B>"
+                               "</TD></TR>\n"
                        );
                        break;
                    default:
@@ -327,7 +325,6 @@ void cal_process_object(icalcomponent *cal,
 /*
  * Deserialize a calendar object in a message so it can be processed.
  * (This is the main entry point for these things)
- * ok for complete vcalendar objects
  */
 void cal_process_attachment(char *part_source, long msgnum, char *cal_partnum) {
        icalcomponent *cal;
@@ -357,7 +354,7 @@ void respond_to_request(void) {
 
        output_headers(3);
 
-       wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#007700\"><TR><TD>"
+       wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>"
                "<SPAN CLASS=\"titlebar\">Respond to meeting request</SPAN>"
                "</TD></TR></TABLE><BR>\n"
        );
@@ -412,7 +409,7 @@ void handle_rsvp(void) {
 
        output_headers(3);
 
-       wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#007700\"><TR><TD>"
+       wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>"
                "<SPAN CLASS=\"titlebar\">"
                "Update your calendar with this RSVP</SPAN>"
                "</TD></TR></TABLE><BR>\n"
@@ -505,7 +502,6 @@ void display_individual_task(icalcomponent *vtodo, long msgnum) {
 /*
  * Display a task by itself (for editing)
  *
- * ok for complete vcalendar objects
  */
 void display_edit_individual_task(icalcomponent *supplied_vtodo, long msgnum) {
        icalcomponent *vtodo;
@@ -541,7 +537,7 @@ void display_edit_individual_task(icalcomponent *supplied_vtodo, long msgnum) {
        }
 
        output_headers(3);
-       wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#007700\"><TR><TD>"
+       wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>"
                "<SPAN CLASS=\"titlebar\">Edit task</SPAN>"
                "</TD></TR></TABLE><BR>\n"
        );
@@ -610,7 +606,6 @@ void display_edit_individual_task(icalcomponent *supplied_vtodo, long msgnum) {
 /*
  * Save an edited task
  *
- * ok 
  */
 void save_individual_task(icalcomponent *supplied_vtodo, long msgnum) {
        char buf[SIZ];
@@ -729,7 +724,6 @@ void save_individual_task(icalcomponent *supplied_vtodo, long msgnum) {
  * the relevant part, deserialize it into a libical component, filter it for
  * the requested object type, and feed it to the specified handler.
  *
- * ok
  */
 void display_using_handler(long msgnum,
                        char *mimetype,
@@ -874,4 +868,47 @@ void save_event(void) {
        }
 }
 
+
+
+
+
+/*
+ * freebusy display (for client software)
+ */
+void do_freebusy(char *req) {
+       char who[SIZ];
+       char buf[SIZ];
+       char *fb;
+
+       extract_token(who, req, 1, ' ');
+       if (!strncasecmp(who, "/freebusy/", 10)) {
+               strcpy(who, &who[10]);
+       }
+       unescape_input(who);
+
+       if ( (!strcasecmp(&who[strlen(who)-4], ".vcf"))
+          || (!strcasecmp(&who[strlen(who)-4], ".vfb")) ) {
+               who[strlen(who)-4] = 0;
+       }
+
+       lprintf(9, "freebusy requested for <%s>\n", who);
+       serv_printf("ICAL freebusy|%s", who);
+       serv_gets(buf);
+
+       if (buf[0] != '1') {
+               wprintf("HTTP/1.0 404 %s\n", &buf[4]);
+               output_headers(0);
+               wprintf("Content-Type: text/plain\n");
+               wprintf("\n");
+               wprintf("%s\n", &buf[4]);
+               return;
+       }
+
+       fb = read_server_text();
+       http_transmit_thing(fb, strlen(fb), "text/calendar", 0);
+       free(fb);
+}
+
+
+
 #endif /* WEBCIT_WITH_CALENDAR_SERVICE */