]> code.citadel.org Git - citadel.git/commitdiff
* Add "Tasks" to the summary page
authorArt Cancro <ajc@citadel.org>
Sun, 5 Jan 2003 04:27:28 +0000 (04:27 +0000)
committerArt Cancro <ajc@citadel.org>
Sun, 5 Jan 2003 04:27:28 +0000 (04:27 +0000)
webcit/ChangeLog
webcit/calendar.c
webcit/messages.c
webcit/summary.c
webcit/webcit.h

index 8ebddc81af5bc6e46989f0715b74cd782c689d44..e97e61f2cf42e85167e5bb45109f93396d2515fb 100644 (file)
@@ -1,4 +1,7 @@
 $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)
 
@@ -1208,4 +1211,3 @@ Sun Dec  6 19:50:55 EST 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
 
 1998-12-03 Nathan Bryant <bryant@cs.usm.maine.edu>
        * webserver.c: warning fix
-
index 975efd10e215fca718e1267b72857f1c2a6ce0f4..f1b20868f11c252532a62d93f6e1233f45f0ca7b 100644 (file)
@@ -483,7 +483,9 @@ void display_individual_task(icalcomponent *vtodo, long msgnum) {
        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));
        }
@@ -764,6 +766,11 @@ void display_task(long msgnum) {
 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 */
index 5d0eef91cbcd90f249a559255c131923253b0f96..17eaeb9abbc6b3af8f2682b738c08ca5c964c41d 100644 (file)
@@ -639,8 +639,7 @@ void display_addressbook(long msgnum, char alpha) {
 /* 
  * load message pointers from the server
  */
-int load_msg_ptrs(servcmd)
-char *servcmd;
+int load_msg_ptrs(char *servcmd)
 {
        char buf[SIZ];
        int nummsgs;
@@ -654,6 +653,7 @@ char *servcmd;
        }
        while (serv_gets(buf), strcmp(buf, "000")) {
                WC->msgarr[nummsgs] = atol(buf);
+               /* FIXME check for overflow */
                ++nummsgs;
        }
        return (nummsgs);
index 4b7bf9dfdbd7244ec8608e3303f27bfc0faa69a2..786eab1b703957f2d971e31f7c7f28af26081451 100644 (file)
@@ -128,6 +128,31 @@ void wholist_section(void) {
 }
 
 
+/*
+ * 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)
  */
@@ -204,6 +229,8 @@ void summary(void) {
         */
        wprintf("</TD><TD>");
        server_info_section();
+       wprintf("<BR><BR>");
+       tasks_section();
 
        /*
         * Column Three
index 032ae020218df3bea0d3531033314b226366f370..f6ca1452da62423c2379dce3eb71c22962df66de 100644 (file)
@@ -167,7 +167,7 @@ struct wcsession {
        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;
@@ -354,6 +354,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);
+int load_msg_ptrs(char *servcmd);
 
 #ifdef HAVE_ICAL_H
 void display_edit_task(void);