$Log$
+Revision 400.74 2003/01/05 04:27:28 ajc
+* Add "Tasks" to the summary page
+
Revision 400.73 2002/12/28 05:44:09 ajc
* ical_dezonify.c: brought over new version from the Citadel source (again)
1998-12-03 Nathan Bryant <bryant@cs.usm.maine.edu>
* webserver.c: warning fix
-
icalproperty *p;
p = icalcomponent_get_first_property(vtodo, ICAL_SUMMARY_PROPERTY);
- wprintf("<LI><A HREF=\"/display_edit_task?msgnum=%ld\">", msgnum);
+ wprintf("<LI><A HREF=\"/display_edit_task?msgnum=%ld&taskrm=", msgnum);
+ urlescputs(WC->wc_roomname);
+ wprintf("\">");
if (p != NULL) {
escputs((char *)icalproperty_get_comment(p));
}
void display_edit_task(void) {
long msgnum = 0L;
+ /* Force change the room if we have to */
+ if (strlen(bstr("taskrm")) > 0) {
+ gotoroom(bstr("taskrm"), 0);
+ }
+
msgnum = atol(bstr("msgnum"));
if (msgnum > 0L) {
/* existing task */
/*
* load message pointers from the server
*/
-int load_msg_ptrs(servcmd)
-char *servcmd;
+int load_msg_ptrs(char *servcmd)
{
char buf[SIZ];
int nummsgs;
}
while (serv_gets(buf), strcmp(buf, "000")) {
WC->msgarr[nummsgs] = atol(buf);
+ /* FIXME check for overflow */
++nummsgs;
}
return (nummsgs);
}
+/*
+ * Task list section
+ */
+void tasks_section(void) {
+ int num_msgs = 0;
+ int i;
+
+ gotoroom("Tasks", 0);
+ if (strcasecmp(WC->wc_roomname, "Tasks")) {
+ wprintf("<i>(You do not have a task list)</i><BR>\n");
+ return;
+ }
+
+ num_msgs = load_msg_ptrs("MSGS ALL");
+ if (num_msgs < 1) {
+ wprintf("<i>(None)</i><BR>\n");
+ return;
+ }
+
+ for (i=0; i<num_msgs; ++i) {
+ display_task(WC->msgarr[i]);
+ }
+}
+
+
/*
* Server info section (fluff, really)
*/
*/
wprintf("</TD><TD>");
server_info_section();
+ wprintf("<BR><BR>");
+ tasks_section();
/*
* Column Three
int killthis; /* Nonzero == purge this session */
struct march *march; /* march mode room list */
char reply_to[SIZ]; /* reply-to address */
- long msgarr[1024]; /* for read operations */
+ long msgarr[4096]; /* for read operations */
int fake_frames;
int is_wap; /* Client is a WAP gateway */
struct urlcontent *urlstrings;
void display_calendar(long msgnum);
void display_task(long msgnum);
void do_calendar_view(void);
+int load_msg_ptrs(char *servcmd);
#ifdef HAVE_ICAL_H
void display_edit_task(void);