]> code.citadel.org Git - citadel.git/blobdiff - webcit/calendar.c
* Fix bug #147 (date sometimes saved incorrectly for all day events due
[citadel.git] / webcit / calendar.c
index ed46e30ba51ce99c56fe3437772121904af8232a..0864c5875421e14a62e6aa267bb0b41cac43cb04 100644 (file)
@@ -102,7 +102,7 @@ void cal_process_object(icalcomponent *cal,
                    case ICAL_METHOD_REQUEST:
                        wprintf("<TR><TD COLSPAN=2>\n"
                                "<IMG ALIGN=CENTER "
-                               "SRC=\"/static/vcalendar.gif\">"
+                               "SRC=\"/static/calarea_48x.gif\">"
                                "&nbsp;&nbsp;"  
                                "<B>Meeting invitation</B>"
                                "</TD></TR>\n"
@@ -111,7 +111,7 @@ void cal_process_object(icalcomponent *cal,
                    case ICAL_METHOD_REPLY:
                        wprintf("<TR><TD COLSPAN=2>\n"
                                "<IMG ALIGN=CENTER "
-                               "SRC=\"/static/vcalendar.gif\">"
+                               "SRC=\"/static/calarea_48x.gif\">"
                                "&nbsp;&nbsp;"  
                                "<B>Attendee's reply to your invitation</B>"
                                "</TD></TR>\n"
@@ -120,7 +120,7 @@ void cal_process_object(icalcomponent *cal,
                    case ICAL_METHOD_PUBLISH:
                        wprintf("<TR><TD COLSPAN=2>\n"
                                "<IMG ALIGN=CENTER "
-                               "SRC=\"/static/vcalendar.gif\">"
+                               "SRC=\"/static/calarea_48x.gif\">"
                                "&nbsp;&nbsp;"  
                                "<B>Published event</B>"
                                "</TD></TR>\n"
@@ -259,23 +259,16 @@ void cal_process_object(icalcomponent *cal,
                lprintf(9, "...done.\n");
 
                /* Display the Accept/Decline buttons */
-               wprintf("<TR><TD COLSPAN=2>"
-                       "<FORM METHOD=\"GET\" "
-                       "ACTION=\"/respond_to_request\">\n"
-                       "<INPUT TYPE=\"submit\" NAME=\"sc\" "
-                               "VALUE=\"Accept\">\n"
-                       "&nbsp;&nbsp;"
-                       "<INPUT TYPE=\"submit\" NAME=\"sc\" "
-                               "VALUE=\"Tentative\">\n"
-                       "&nbsp;&nbsp;"
-                       "<INPUT TYPE=\"submit\" NAME=\"sc\" "
-                               "VALUE=\"Decline\">\n"
-                       "<INPUT TYPE=\"hidden\" NAME=\"msgnum\" "
-                               "VALUE=\"%ld\">"
-                       "<INPUT TYPE=\"hidden\" NAME=\"cal_partnum\" "
-                               "VALUE=\"%s\">"
-                       "</FORM>"
-                       "</TD></TR>\n",
+               wprintf("<TR><TD>How would you like to respond to this invitation?</td>"
+                       "<td><FONT SIZE=+1>"
+                       "<A HREF=\"/respond_to_request?msgnum=%ld&cal_partnum=%s&sc=Accept\">Accept</a>"
+                       " | "
+                       "<A HREF=\"/respond_to_request?msgnum=%ld&cal_partnum=%s&sc=Tentative\">Tentative</a>"
+                       " | "
+                       "<A HREF=\"/respond_to_request?msgnum=%ld&cal_partnum=%s&sc=Decline\">Decline</a>"
+                       "</FONT></TD></TR>\n",
+                       msgnum, cal_partnum,
+                       msgnum, cal_partnum,
                        msgnum, cal_partnum
                );
 
@@ -293,22 +286,16 @@ void cal_process_object(icalcomponent *cal,
                 ***********/
 
                /* Display the update buttons */
-               wprintf("<TR><TD COLSPAN=2>"
+               wprintf("<TR><TD>"
                        "Click <i>Update</i> to accept this reply and "
                        "update your calendar."
-                       "<FORM METHOD=\"GET\" "
-                       "ACTION=\"/handle_rsvp\">\n"
-                       "<INPUT TYPE=\"submit\" NAME=\"sc\" "
-                               "VALUE=\"Update\">\n"
-                       "&nbsp;&nbsp;"
-                       "<INPUT TYPE=\"submit\" NAME=\"sc\" "
-                               "VALUE=\"Ignore\">\n"
-                       "<INPUT TYPE=\"hidden\" NAME=\"msgnum\" "
-                               "VALUE=\"%ld\">"
-                       "<INPUT TYPE=\"hidden\" NAME=\"cal_partnum\" "
-                               "VALUE=\"%s\">"
-                       "</FORM>"
+                       "</td><td><font size=+1>"
+                       "<a href=\"/handle_rsvp?msgnum=%ld&cal_partnum=%s&sc=Update\">Update</a>"
+                       " | "
+                       "<a href=\"/handle_rsvp?msgnum=%ld&cal_partnum=%s&sc=Ignore\">Ignore</a>"
+                       "</font>"
                        "</TD></TR>\n",
+                       msgnum, cal_partnum,
                        msgnum, cal_partnum
                );
 
@@ -370,7 +357,7 @@ void respond_to_request(void) {
 
        if (buf[0] == '2') {
                wprintf("<TABLE BORDER=0><TR><TD>"
-                       "<IMG SRC=\"static/vcalendar.gif\" ALIGN=CENTER>"
+                       "<IMG SRC=\"static/calarea_48x.gif\" ALIGN=CENTER>"
                        "</TD><TD>"
                );
                if (!strcasecmp(bstr("sc"), "accept")) {
@@ -428,7 +415,7 @@ void handle_rsvp(void) {
 
        if (buf[0] == '2') {
                wprintf("<TABLE BORDER=0><TR><TD>"
-                       "<IMG SRC=\"static/vcalendar.gif\" ALIGN=CENTER>"
+                       "<IMG SRC=\"static/calarea_48x.gif\" ALIGN=CENTER>"
                        "</TD><TD>"
                );
                if (!strcasecmp(bstr("sc"), "update")) {
@@ -523,8 +510,9 @@ void display_edit_individual_task(icalcomponent *supplied_vtodo, long msgnum) {
 
        output_headers(1, 1, 2, 0, 0, 0, 0);
        wprintf("<div id=\"banner\">\n"
-               "<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>"
-               "<SPAN CLASS=\"titlebar\">Edit task</SPAN>"
+               "<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR>"
+               "<TD><IMG SRC=\"/static/taskmanag_48x.gif\"></TD>"
+               "<td><SPAN CLASS=\"titlebar\">Edit task</SPAN>"
                "</TD></TR></TABLE>\n"
                "</div>\n<div id=\"content\">\n"
        );
@@ -609,6 +597,7 @@ void save_individual_task(icalcomponent *supplied_vtodo, long msgnum) {
        int created_new_vtodo = 0;
        int i;
        int sequence = 0;
+       struct icaltimetype t;
 
        if (supplied_vtodo != NULL) {
                vtodo = supplied_vtodo;
@@ -658,10 +647,9 @@ void save_individual_task(icalcomponent *supplied_vtodo, long msgnum) {
                        icalcomponent_remove_property(vtodo, prop);
                        icalproperty_free(prop);
                }
+               icaltime_from_webform(&t, "dtstart");
                icalcomponent_add_property(vtodo,
-                       icalproperty_new_dtstart(
-                               icaltime_from_webform("dtstart")
-                       )
+                       icalproperty_new_dtstart(t)
                );
        
                while (prop = icalcomponent_get_first_property(vtodo,
@@ -669,10 +657,9 @@ void save_individual_task(icalcomponent *supplied_vtodo, long msgnum) {
                        icalcomponent_remove_property(vtodo, prop);
                        icalproperty_free(prop);
                }
+               icaltime_from_webform(&t, "due");
                icalcomponent_add_property(vtodo,
-                       icalproperty_new_due(
-                               icaltime_from_webform("due")
-                       )
+                       icalproperty_new_due(t)
                );
 
                /* Give this task a UID if it doesn't have one. */
@@ -920,6 +907,7 @@ void do_freebusy(char *req) {
        unescape_input(who);
 
        if ( (!strcasecmp(&who[strlen(who)-4], ".vcf"))
+          || (!strcasecmp(&who[strlen(who)-4], ".ifb"))
           || (!strcasecmp(&who[strlen(who)-4], ".vfb")) ) {
                who[strlen(who)-4] = 0;
        }