]> code.citadel.org Git - citadel.git/blobdiff - webcit/calendar_view.c
* Tasks view now uses the same buffer/dump logic as the calendar views, so
[citadel.git] / webcit / calendar_view.c
index 9c273e386670b74ec80c3af5c63262def4e88029..70c4d537daec5ae9a8f8a5b2d5f39a63d179bb02 100644 (file)
@@ -32,6 +32,10 @@ void do_calendar_view(void) {        /* stub for non-libical builds */
        wprintf("<CENTER><I>Calendar view not available</I></CENTER><BR>\n");
 }
 
+void do_tasks_view(void) {     /* stub for non-libical builds */
+       wprintf("<CENTER><I>Tasks view not available</I></CENTER><BR>\n");
+}
+
 #else  /* WEBCIT_WITH_CALENDAR_SERVICE */
 
 /****************************************************************************/
@@ -578,4 +582,32 @@ void do_calendar_view(void) {
 
 }
 
+
+void do_tasks_view(void) {
+       int i;
+       icalproperty *p;
+
+       if (WC->num_cal) for (i=0; i<(WC->num_cal); ++i) {
+               p = icalcomponent_get_first_property(WC->disp_cal[i],
+                                                       ICAL_SUMMARY_PROPERTY);
+               wprintf("<A HREF=\"/display_edit_task?msgnum=%ld&taskrm=",
+                       WC->cal_msgnum[i] );
+               urlescputs(WC->wc_roomname);
+               wprintf("\">");
+               if (p != NULL) {
+                       escputs((char *)icalproperty_get_comment(p));
+               }
+               wprintf("</A><BR>\n");
+       }
+
+       wprintf("<BR><BR><A HREF=\"/display_edit_task?msgnum=0\">"
+               "Add new task</A>\n"
+       );
+
+
+       /* Free the list */
+       free_calendar_buffer();
+
+}
+
 #endif /* WEBCIT_WITH_CALENDAR_SERVICE */