]> code.citadel.org Git - citadel.git/blobdiff - webcit/summary.c
* Cleanups to summary page when running on a non ical enabled system
[citadel.git] / webcit / summary.c
index 9b6555e2d5319457d6154c1a86fa5067e55fcd90..f1fb69db25820571e6afc1186b77f1a6fa875f22 100644 (file)
@@ -132,23 +132,29 @@ void tasks_section(void) {
 
        svprintf("BOXTITLE", WCS_STRING, "Tasks");
        do_template("beginbox");
+#ifdef WEBCIT_WITH_CALENDAR_SERVICE
        gotoroom("Tasks", 0);
        if (strcasecmp(WC->wc_roomname, "Tasks")) {
-               wprintf("<i>(You do not have a task list)</i><BR>\n");
-               return;
+               num_msgs = 0;
+       }
+       else {
+               num_msgs = load_msg_ptrs("MSGS ALL");
        }
 
-       num_msgs = load_msg_ptrs("MSGS ALL");
        if (num_msgs < 1) {
                wprintf("<i>(None)</i><BR>\n");
-               return;
        }
-
-       wprintf("<UL>");
-       for (i=0; i<num_msgs; ++i) {
-               display_task(WC->msgarr[i]);
+       else {
+               wprintf("<UL>");
+               for (i=0; i<num_msgs; ++i) {
+                       display_task(WC->msgarr[i]);
+               }
+               wprintf("</UL>\n");
        }
-       wprintf("</UL>\n");
+
+#else /* WEBCIT_WITH_CALENDAR_SERVICE */
+       wprintf("<I>(This server does not support task lists)</I>\n");
+#endif /* WEBCIT_WITH_CALENDAR_SERVICE */
        do_template("endbox");
 }
 
@@ -165,21 +171,24 @@ void calendar_section(void) {
 #ifdef WEBCIT_WITH_CALENDAR_SERVICE
        gotoroom("Calendar", 0);
        if (strcasecmp(WC->wc_roomname, "Calendar")) {
-               wprintf("<i>(You do not have a calendar)</i><BR>\n");
-               return;
+               num_msgs = 0;
+       }
+       else {
+               num_msgs = load_msg_ptrs("MSGS ALL");
        }
 
-       num_msgs = load_msg_ptrs("MSGS ALL");
        if (num_msgs < 1) {
                wprintf("<i>(Nothing)</i><BR>\n");
-               return;
        }
-
-       for (i=0; i<num_msgs; ++i) {
-               display_calendar(WC->msgarr[i]);
+       else {
+               for (i=0; i<num_msgs; ++i) {
+                       display_calendar(WC->msgarr[i]);
+               }
+               calendar_summary_view();
        }
 
-       calendar_summary_view();
+#else /* WEBCIT_WITH_CALENDAR_SERVICE */
+       wprintf("<I>(This server does not support calendars)</I>\n");
 #endif /* WEBCIT_WITH_CALENDAR_SERVICE */
        do_template("endbox");
 }