$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
1998-12-03 Nathan Bryant <bryant@cs.usm.maine.edu>
* webserver.c: warning fix
+
-/*
- * 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("<A HREF=\"/display_edit_task?msgnum=%ld&taskrm=", msgnum);
- urlescputs(WC->wc_roomname);
- wprintf("\">");
- if (p != NULL) {
- escputs((char *)icalproperty_get_comment(p));
- }
- wprintf("</A><BR>\n");
-}
-
-
/*
* Display a task by itself (for editing)
*
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) {
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 */
/****************************************************************************/
}
+
+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 */
is_tasks = 1;
strcpy(cmd, "MSGS ALL");
maxmsgs = 32767;
- wprintf("<UL>");
}
nummsgs = load_msg_ptrs(cmd);
wprintf("</TABLE>\n");
}
- if (is_tasks) {
- wprintf("</UL>\n");
- }
-
/* Bump these because although we're thinking in zero base, the user
* is a drooling idiot and is thinking in one base.
*/
DONE:
if (is_tasks) {
- wprintf("<A HREF=\"/display_edit_task?msgnum=0\">"
- "Add new task</A>\n"
- );
+ do_tasks_view(); /* Render the task list */
}
if (is_calendar) {
</TD>
<TD ALIGN="RIGHT" VALIGN="TOP" BGCOLOR="#444455">
<?VIEWOMATIC>
+ </TD>
+ <TD ALIGN="RIGHT" VALIGN="TOP" BGCOLOR="#444455">
<SPAN CLASS="room_banner_new_messages"><?NEWMSGS> new of <?TOTALMSGS> messages</SPAN>
<BR>
<SPAN CLASS="room_banner_start_page"><?START></SPAN>
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);