* calendar_view.c: added. (This module will contain month/week/day views)
authorArt Cancro <ajc@citadel.org>
Sun, 22 Sep 2002 03:50:54 +0000 (03:50 +0000)
committerArt Cancro <ajc@citadel.org>
Sun, 22 Sep 2002 03:50:54 +0000 (03:50 +0000)
* Move "add new task" to below "DONE" label.  This causes it to appear even
  when there are no existing tasks (messages) in the room.

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

index c843bbff1aee927aa919b6c55786a79232dbb568..ec48965e64994d429b6ea57ff7b664b59e1d8320 100644 (file)
@@ -28,13 +28,13 @@ webserver: webserver.o context_loop.o tools.o \
        roomops.o messages.o userlist.o paging.o sysmsgs.o useredit.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 $(LIBOBJS)
+       calendar.o calendar_tools.o calendar_view.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 \
        roomops.o messages.o userlist.o paging.o sysmsgs.o useredit.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 \
+       summary.o calendar.o calendar_tools.o calendar_view.o \
        $(LIBOBJS) $(LIBS) -o webserver
 
 .c.o:
diff --git a/webcit/calendar_view.c b/webcit/calendar_view.c
new file mode 100644 (file)
index 0000000..148786a
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * $Id$
+ *
+ *
+ */
+
+#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 <netinet/in.h>
+#include <netdb.h>
+#include <string.h>
+#include <pwd.h>
+#include <errno.h>
+#include <stdarg.h>
+#include <pthread.h>
+#include <signal.h>
+#include <time.h>
+#include "webcit.h"
+#include "webserver.h"
+
+#ifndef HAVE_ICAL_H
+
+void do_calendar_view(void) {  /* stub for non-libical builds */
+       wprintf("<CENTER><I>Calendar view not available</I></CENTER><BR>\n");
+}
+
+#else  /* HAVE_ICAL_H */
+
+/****************************************************************************/
+
+/*
+ * We loaded calendar events into memory during a pass through the
+ * messages in this room ... now display them.
+ */
+void do_calendar_view(void) {
+       wprintf("<CENTER><I>Calendar view not available</I></CENTER><BR>\n");
+}
+
+
+#endif /* HAVE_ICAL_H */
index f6a88c416f6a1c0b058815d0bce16221a448eb3e..91e282d71cdb151ad74c678fc1dc10a770b03ad9 100644 (file)
@@ -837,10 +837,7 @@ void readloop(char *oper)
        }
 
        if (is_tasks) {
-               wprintf("</UL>\n"
-                       "<A HREF=\"/display_edit_task?msgnum=0\">"
-                       "Add new task</A>\n"
-               );
+               wprintf("</UL>\n");
        }
 
        /* Bump these because although we're thinking in zero base, the user
@@ -950,7 +947,18 @@ void readloop(char *oper)
        }
        if (is_summary) wprintf("</FORM>\n");
 
-DONE:  wDumpContent(1);
+DONE:
+       if (is_tasks) {
+               wprintf("<A HREF=\"/display_edit_task?msgnum=0\">"
+                       "Add new task</A>\n"
+               );
+       }
+
+       if (is_calendar) {
+               do_calendar_view();
+       }
+
+       wDumpContent(1);
 }
 
 
index 4f24c5cadb19abe2ad2e4e601af8921d6c6011bf..edcf5e43a682067f68d57b36a10c00d9a4a6da7a 100644 (file)
@@ -348,6 +348,7 @@ ssize_t write(int fd, const void *buf, size_t count);
 void cal_process_attachment(char *part_source);
 void display_calendar(long msgnum);
 void display_task(long msgnum);
+void do_calendar_view(void);
 
 #ifdef HAVE_ICAL_H
 void display_edit_task(void);