From b740e02b625367fe98b34ded61a36b3d573c771c Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Tue, 3 Aug 2004 03:55:40 +0000 Subject: [PATCH] * Tasks view now uses the same buffer/dump logic as the calendar views, so we can sort them by due date and do a prettier display. (Only the logic is changed so far. The prettier display is forthcoming.) --- webcit/ChangeLog | 6 ++++++ webcit/calendar.c | 19 +------------------ webcit/calendar_view.c | 32 ++++++++++++++++++++++++++++++++ webcit/messages.c | 9 +-------- webcit/static/roombanner.html | 2 ++ webcit/webcit.h | 1 + 6 files changed, 43 insertions(+), 26 deletions(-) diff --git a/webcit/ChangeLog b/webcit/ChangeLog index 98fe467a2..a2a53c814 100644 --- a/webcit/ChangeLog +++ b/webcit/ChangeLog @@ -1,4 +1,9 @@ $Log$ +Revision 522.20 2004/08/03 03:55:37 ajc +* Tasks view now uses the same buffer/dump logic as the calendar views, so + we can sort them by due date and do a prettier display. (Only the logic is + changed so far. The prettier display is forthcoming.) + Revision 522.19 2004/07/21 02:57:09 ajc * Internet Configuration screen looks a little neater now @@ -1989,3 +1994,4 @@ Sun Dec 6 19:50:55 EST 1998 Art Cancro 1998-12-03 Nathan Bryant * webserver.c: warning fix + diff --git a/webcit/calendar.c b/webcit/calendar.c index bc1de49c6..f1f23b7aa 100644 --- a/webcit/calendar.c +++ b/webcit/calendar.c @@ -482,23 +482,6 @@ void display_individual_cal(icalcomponent *cal, long msgnum) { -/* - * Display a task in the task list - */ -void display_individual_task(icalcomponent *vtodo, long msgnum) { - icalproperty *p; - - p = icalcomponent_get_first_property(vtodo, ICAL_SUMMARY_PROPERTY); - wprintf("wc_roomname); - wprintf("\">"); - if (p != NULL) { - escputs((char *)icalproperty_get_comment(p)); - } - wprintf("
\n"); -} - - /* * Display a task by itself (for editing) * @@ -805,7 +788,7 @@ void display_calendar(long msgnum) { void display_task(long msgnum) { display_using_handler(msgnum, "text/calendar", ICAL_VTODO_COMPONENT, - display_individual_task); + display_individual_cal); } void display_edit_task(void) { diff --git a/webcit/calendar_view.c b/webcit/calendar_view.c index 9c273e386..70c4d537d 100644 --- a/webcit/calendar_view.c +++ b/webcit/calendar_view.c @@ -32,6 +32,10 @@ void do_calendar_view(void) { /* stub for non-libical builds */ wprintf("
Calendar view not available

\n"); } +void do_tasks_view(void) { /* stub for non-libical builds */ + wprintf("
Tasks view not available

\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("cal_msgnum[i] ); + urlescputs(WC->wc_roomname); + wprintf("\">"); + if (p != NULL) { + escputs((char *)icalproperty_get_comment(p)); + } + wprintf("
\n"); + } + + wprintf("

" + "Add new task\n" + ); + + + /* Free the list */ + free_calendar_buffer(); + +} + #endif /* WEBCIT_WITH_CALENDAR_SERVICE */ diff --git a/webcit/messages.c b/webcit/messages.c index c9e0c5588..e30cc1820 100644 --- a/webcit/messages.c +++ b/webcit/messages.c @@ -1107,7 +1107,6 @@ void readloop(char *oper) is_tasks = 1; strcpy(cmd, "MSGS ALL"); maxmsgs = 32767; - wprintf("
    "); } nummsgs = load_msg_ptrs(cmd); @@ -1215,10 +1214,6 @@ void readloop(char *oper) wprintf("\n"); } - if (is_tasks) { - wprintf("
\n"); - } - /* Bump these because although we're thinking in zero base, the user * is a drooling idiot and is thinking in one base. */ @@ -1331,9 +1326,7 @@ void readloop(char *oper) DONE: if (is_tasks) { - wprintf("" - "Add new task\n" - ); + do_tasks_view(); /* Render the task list */ } if (is_calendar) { diff --git a/webcit/static/roombanner.html b/webcit/static/roombanner.html index 83a9d2e9d..562d60f9e 100644 --- a/webcit/static/roombanner.html +++ b/webcit/static/roombanner.html @@ -14,6 +14,8 @@ + + new of messages
diff --git a/webcit/webcit.h b/webcit/webcit.h index b3e99e71e..435bd1df8 100644 --- a/webcit/webcit.h +++ b/webcit/webcit.h @@ -415,6 +415,7 @@ void cal_process_attachment(char *part_source, long msgnum, char *cal_partnum); void display_calendar(long msgnum); void display_task(long msgnum); void do_calendar_view(void); +void do_tasks_view(void); void free_calendar_buffer(void); void calendar_summary_view(void); int load_msg_ptrs(char *servcmd); -- 2.39.2