* Set up framework for "notes" view, and added a skeleton function for
authorArt Cancro <ajc@citadel.org>
Fri, 1 Oct 2004 16:23:24 +0000 (16:23 +0000)
committerArt Cancro <ajc@citadel.org>
Fri, 1 Oct 2004 16:23:24 +0000 (16:23 +0000)
  the actual display.

webcit/ChangeLog
webcit/Makefile.in
webcit/messages.c
webcit/notes.c [new file with mode: 0644]
webcit/roomops.c
webcit/webcit.h

index ef151dfb926ae55a3d1664ec61356a9db8ab8d5b..ac896a386374e2b09ea7a69507775aa133f38457 100644 (file)
@@ -1,4 +1,8 @@
 $Log$
+Revision 524.2  2004/10/01 16:23:23  ajc
+* Set up framework for "notes" view, and added a skeleton function for
+  the actual display.
+
 Revision 524.1  2004/09/30 03:44:01  ajc
 * fix line width break problem in chat
 
@@ -2083,4 +2087,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 029e3fa6bc7a777c95a84002d81804b0aadcf60f..b75b1a66a0e74ae0378be30ca16099c83b3436ef 100644 (file)
@@ -36,7 +36,7 @@ webserver: webserver.o context_loop.o tools.o ical_dezonify.o \
        vcard.o vcard_edit.o preferences.o html2html.o listsub.o \
        mime_parser.o graphics.o netconf.o siteconfig.o subst.o \
        calendar.o calendar_tools.o calendar_view.o event.o \
-       availability.o iconbar.o crypto.o inetconf.o \
+       availability.o iconbar.o crypto.o inetconf.o notes.o \
        $(LIBOBJS)
        $(CC) webserver.o context_loop.o tools.o cookie_conversion.o \
        webcit.o auth.o tcp_sockets.o mainmenu.o serv_func.o who.o listsub.o \
@@ -44,7 +44,7 @@ webserver: webserver.o context_loop.o tools.o ical_dezonify.o \
        locate_host.o siteconfig.o subst.o vcard.o vcard_edit.o floors.o \
        mime_parser.o graphics.o netconf.o preferences.o html2html.o \
        summary.o calendar.o calendar_tools.o calendar_view.o event.o \
-       availability.o ical_dezonify.o iconbar.o crypto.o inetconf.o \
+       availability.o ical_dezonify.o iconbar.o crypto.o inetconf.o notes.o \
        $(LIBOBJS) $(LIBS) $(LDFLAGS) -o webserver
 
 .c.o:
index d2a6f1c17e949b2807391fc91005d5b1f5663b34..5092c6abce64ffbb326c43c13e294f3802159684 100644 (file)
@@ -1032,6 +1032,7 @@ void readloop(char *oper)
        int is_singlecard = 0;
        int is_calendar = 0;
        int is_tasks = 0;
+       int is_notes = 0;
        int remaining_messages;
        int lo, hi;
        int lowest_displayed = (-1);
@@ -1103,11 +1104,16 @@ void readloop(char *oper)
                strcpy(cmd, "MSGS ALL");
                maxmsgs = 32767;
        }
+       if (WC->wc_view == VIEW_NOTES) {                /* notes */
+               is_notes = 1;
+               strcpy(cmd, "MSGS ALL");
+               maxmsgs = 32767;
+       }
 
        nummsgs = load_msg_ptrs(cmd);
        if (nummsgs == 0) {
 
-               if ((!is_tasks) && (!is_calendar)) {
+               if ((!is_tasks) && (!is_calendar) && (!is_notes)) {
                        if (!strcmp(oper, "readnew")) {
                                wprintf("<EM>No new messages.</EM>\n");
                        } else if (!strcmp(oper, "readold")) {
@@ -1188,6 +1194,9 @@ void readloop(char *oper)
                        else if (is_tasks) {
                                display_task(WC->msgarr[a]);
                        }
+                       else if (is_notes) {
+                               display_note(WC->msgarr[a]);
+                       }
                        else {
                                read_message(WC->msgarr[a]);
                        }
@@ -1217,7 +1226,7 @@ void readloop(char *oper)
 
        /* If we're only looking at one message, do a prev/next thing */
        if (num_displayed == 1) {
-          if ((!is_tasks) && (!is_calendar) && (!is_addressbook) && (!is_singlecard)) {
+          if ((!is_tasks) && (!is_calendar) && (!is_addressbook) && (!is_notes) && (!is_singlecard)) {
 
                wprintf("<CENTER>"
                        "<TABLE BORDER=0 WIDTH=100%% BGCOLOR=\"#DDDDDD\"><TR><TD>"
@@ -1266,7 +1275,7 @@ void readloop(char *oper)
         * messages, then display the selector bar
         */
        if (num_displayed > 1) {
-          if ((!is_tasks) && (!is_calendar) && (!is_addressbook) && (!is_singlecard)) {
+          if ((!is_tasks) && (!is_calendar) && (!is_addressbook) && (!is_notes) && (!is_singlecard)) {
                wprintf("<CENTER>"
                        "<TABLE BORDER=0 WIDTH=100%% BGCOLOR=\"#DDDDDD\"><TR><TD>"
                        "Reading #%d-%d of %d messages.</TD>\n"
diff --git a/webcit/notes.c b/webcit/notes.c
new file mode 100644 (file)
index 0000000..8fccbdc
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * $Id$
+ *
+ * Functions which handle "sticky notes"
+ *
+ */
+
+#include <ctype.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <signal.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <sys/socket.h>
+#include <limits.h>
+#include <string.h>
+#include <pwd.h>
+#include <errno.h>
+#include <stdarg.h>
+#include <time.h>
+#include "webcit.h"
+#include "webserver.h"
+
+void display_note(long msgnum) {
+       wprintf("<TABLE border=2><TR><TD>\n");
+       wprintf("FIXME note #%ld\n", msgnum);
+       wprintf("</TD></TR></TABLE\n");
+}
index af4b85c80e2fc3842f1df38a3c805486fd77cfc7..62dc983659a1ae6f900a9207b5ea672638398dbb 100644 (file)
@@ -36,7 +36,8 @@ char *viewdefs[] = {
        "Summary",
        "Address Book",
        "Calendar",
-       "Tasks"
+       "Tasks",
+       "Notes"
 };
 
 char floorlist[128][SIZ];
index 6e1c903db0109bc63f99d0781ff54bd461362bff..0ff542d77eee5aeaf52abc0a7f4e70d79c2dd531 100644 (file)
@@ -416,6 +416,7 @@ ssize_t write(int fd, const void *buf, size_t count);
 void cal_process_attachment(char *part_source, long msgnum, char *cal_partnum);
 void display_calendar(long msgnum);
 void display_task(long msgnum);
+void display_note(long msgnum);
 void do_calendar_view(void);
 void do_tasks_view(void);
 void free_calendar_buffer(void);
@@ -484,3 +485,4 @@ void client_write_ssl(char *buf, int nbytes);
 #define VIEW_ADDRESSBOOK       2       /* Address book view */
 #define VIEW_CALENDAR          3       /* Calendar view */
 #define VIEW_TASKS             4       /* Tasks view */
+#define VIEW_NOTES             5       /* Notes view */