]> code.citadel.org Git - citadel.git/blobdiff - webcit/messages.c
* Added utility functions for displaying vcalendar timestamps in web forms
[citadel.git] / webcit / messages.c
index d5d98b155e6b187a267cfbbfb07dfd181c0d89a5..f6a88c416f6a1c0b058815d0bce16221a448eb3e 100644 (file)
@@ -672,6 +672,8 @@ void readloop(char *oper)
        int num_displayed = 0;
        int is_summary = 0;
        int is_addressbook = 0;
+       int is_calendar = 0;
+       int is_tasks = 0;
        int remaining_messages;
        int lo, hi;
        int lowest_displayed = (-1);
@@ -728,6 +730,17 @@ void readloop(char *oper)
                else wprintf("<A HREF=\"/readfwd?alpha=1\">(other)</A>\n");
                wprintf("<HR width=100%%>\n");
        }
+       if (WC->wc_view == 3) {         /* calendar */
+               is_calendar = 1;
+               strcpy(cmd, "MSGS ALL");
+               maxmsgs = 32767;
+       }
+       if (WC->wc_view == 4) {         /* tasks */
+               is_tasks = 1;
+               strcpy(cmd, "MSGS ALL");
+               maxmsgs = 32767;
+               wprintf("<UL>");
+       }
 
        nummsgs = load_msg_ptrs(cmd);
        if (nummsgs == 0) {
@@ -792,6 +805,12 @@ void readloop(char *oper)
                        else if (is_addressbook) {
                                display_addressbook(WC->msgarr[a], alpha);
                        }
+                       else if (is_calendar) {
+                               display_calendar(WC->msgarr[a]);
+                       }
+                       else if (is_tasks) {
+                               display_task(WC->msgarr[a]);
+                       }
                        else {
                                read_message(WC->msgarr[a]);
                        }
@@ -817,6 +836,13 @@ void readloop(char *oper)
                wprintf("</TABLE>\n");
        }
 
+       if (is_tasks) {
+               wprintf("</UL>\n"
+                       "<A HREF=\"/display_edit_task?msgnum=0\">"
+                       "Add new task</A>\n"
+               );
+       }
+
        /* Bump these because although we're thinking in zero base, the user
         * is a drooling idiot and is thinking in one base.
         */