From: Art Cancro Date: Thu, 29 Jan 2009 04:33:50 +0000 (+0000) Subject: * Restored the '(none)' and '(nothing)' displays in the summary screen when the Tasks... X-Git-Tag: v7.86~1543 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=cc79f17812982e6e5a20ffec485bb6f6d88c2bb9 * Restored the '(none)' and '(nothing)' displays in the summary screen when the Tasks and Calendar windows contain no relevant data. --- diff --git a/webcit/calendar_view.c b/webcit/calendar_view.c index 323016ff3..bd882d066 100644 --- a/webcit/calendar_view.c +++ b/webcit/calendar_view.c @@ -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); @@ -1328,12 +1329,14 @@ void calendar_summary_view(void) { wprintf(" (%s)", timestring); } wprintf("
\n"); + ++num_displayed; } } } } DeleteHashPos(&Pos); DeleteHash(&WC->disp_cal_items); + return(num_displayed); } /* diff --git a/webcit/summary.c b/webcit/summary.c index cb9ef3b5c..7f3db02f5 100644 --- a/webcit/summary.c +++ b/webcit/summary.c @@ -95,12 +95,7 @@ void tasks_section(void) { num_msgs = load_msg_ptrs("MSGS ALL", 0); } - if (num_msgs < 1) { - wprintf(""); - wprintf(_("(None)")); - wprintf("
\n"); - } - else { + if (num_msgs > 0) { at = GetNewHashPos(WCC->summ, 0); while (GetNextHashPos(WCC->summ, at, &HKLen, &HashKey, &vMsg)) { Msg = (message_summary*) vMsg; @@ -108,7 +103,11 @@ void tasks_section(void) { } } - calendar_summary_view(); + if (calendar_summary_view() < 1) { + wprintf(""); + wprintf(_("(None)")); + wprintf("
\n"); + } } @@ -138,18 +137,17 @@ void calendar_section(void) { parse_calendar_view_request(&c); - if (num_msgs < 1) { - wprintf(""); - wprintf(_("(Nothing)")); - wprintf("
\n"); - } - else { + if (num_msgs > 0) { at = GetNewHashPos(WCC->summ, 0); while (GetNextHashPos(WCC->summ, at, &HKLen, &HashKey, &vMsg)) { Msg = (message_summary*) vMsg; load_calendar_item(Msg, 0, &c); } - calendar_summary_view(); + } + if (calendar_summary_view() < 1) { + wprintf(""); + wprintf(_("(Nothing)")); + wprintf("
\n"); } } diff --git a/webcit/webcit.h b/webcit/webcit.h index 545089bad..5b2aa23ce 100644 --- a/webcit/webcit.h +++ b/webcit/webcit.h @@ -659,7 +659,7 @@ void updatenote(void); void parse_calendar_view_request(struct calview *c); void render_calendar_view(struct calview *c); void do_tasks_view(void); -void calendar_summary_view(void); +int calendar_summary_view(void); void free_march_list(wcsession *wcf); void display_rules_editor_inner_div(void); void generate_uuid(char *);