]> code.citadel.org Git - citadel.git/blobdiff - webcit/calendar_view.c
* Restored the '(none)' and '(nothing)' displays in the summary screen when the Tasks...
[citadel.git] / webcit / calendar_view.c
index f9863836bf81e9b5314b3716ee0def62686bc485..bd882d066a4bd6166d48ff50a864cca709837dc1 100644 (file)
@@ -1241,9 +1241,9 @@ void calendar_day_view(int year, int month, int day) {
 
 
 /*
- * Display today's events.
+ * Display today's events.  Returns the number of items displayed.
  */
-void calendar_summary_view(void) {
+int calendar_summary_view(void) {
        long hklen;
        const char *HashKey;
        void *vCal;
@@ -1258,9 +1258,10 @@ void calendar_summary_view(void) {
        int all_day_event = 0;
        char timestring[SIZ];
        wcsession *WCC = WC;
+       int num_displayed = 0;
 
        if (GetCount(WC->disp_cal_items) == 0) {
-               return;
+               return(0);
        }
 
        now = time(NULL);
@@ -1304,7 +1305,7 @@ void calendar_summary_view(void) {
                                                        "?gotofirst=",
                                                        Cal->cal_msgnum
                                                );
-                                               escputs(WCC->wc_roomname);
+                                               escputs(ChrPtr(WCC->wc_roomname));
                                                wprintf("\">");
                                        }
                                        else {
@@ -1320,17 +1321,22 @@ void calendar_summary_view(void) {
                                                        today_tm.tm_mon + 1,
                                                        today_tm.tm_mday
                                                );
-                                               escputs(WCC->wc_roomname);
+                                               escputs(ChrPtr(WCC->wc_roomname));
                                                wprintf("\">");
                                        }
                                        escputs((char *) icalproperty_get_comment(p));
-                                       wprintf(" (%s)</a><br />\n", timestring);
+                                       if (!all_day_event) {
+                                               wprintf(" (%s)", timestring);
+                                       }
+                                       wprintf("</a><br />\n");
+                                       ++num_displayed;
                                }
                        }
                }
        }
        DeleteHashPos(&Pos);
        DeleteHash(&WC->disp_cal_items);
+       return(num_displayed);
 }
 
 /*
@@ -1552,7 +1558,7 @@ void do_tasks_view(void) {
                p = icalcomponent_get_first_property(Cal->cal,
                        ICAL_SUMMARY_PROPERTY);
                wprintf("<a href=\"display_edit_task?msgnum=%ld?taskrm=", Cal->cal_msgnum);
-               urlescputs(WC->wc_roomname);
+               urlescputs(ChrPtr(WC->wc_roomname));
                wprintf("\">");
                /* wprintf("<img align=middle "
                "src=\"static/taskmanag_16x.gif\" border=0>&nbsp;"); */