From 9a4968dd53adc0276215b0f6aab6841da1e11bbf Mon Sep 17 00:00:00 2001
From: Art Cancro
Date: Wed, 20 Oct 2004 02:41:45 +0000
Subject: [PATCH] * New "notes" icon * Added the notes room to the icon bar *
Set up an initial implementation of Notes view. Attractive enough to
publish, but read-only. Needs a note editor.
---
webcit/ChangeLog | 7 +++++-
webcit/iconbar.c | 50 ++++++++++++++++++++++++++++++++++-------
webcit/notes.c | 40 ++++++++++++++++++++++++++++++---
webcit/static/note.gif | Bin 0 -> 244 bytes
4 files changed, 85 insertions(+), 12 deletions(-)
create mode 100644 webcit/static/note.gif
diff --git a/webcit/ChangeLog b/webcit/ChangeLog
index 56067409c..8ce9d9b7a 100644
--- a/webcit/ChangeLog
+++ b/webcit/ChangeLog
@@ -1,4 +1,10 @@
$Log$
+Revision 524.6 2004/10/20 02:41:41 ajc
+* New "notes" icon
+* Added the notes room to the icon bar
+* Set up an initial implementation of Notes view. Attractive enough to
+ publish, but read-only. Needs a note editor.
+
Revision 524.5 2004/10/15 03:10:24 ajc
* Calendar objects UID now generated by generate_uuid() which creates
pseudo-DCE-ish UUID's.
@@ -2097,4 +2103,3 @@ Sun Dec 6 19:50:55 EST 1998 Art Cancro
1998-12-03 Nathan Bryant
* webserver.c: warning fix
-
diff --git a/webcit/iconbar.c b/webcit/iconbar.c
index ab5ce32af..9a9320398 100644
--- a/webcit/iconbar.c
+++ b/webcit/iconbar.c
@@ -45,6 +45,7 @@ void do_iconbar(void) {
int ib_inbox = 0; /* Inbox icon */
int ib_calendar = 0; /* Calendar icon */
int ib_contacts = 0; /* Contacts icon */
+ int ib_notes = 0; /* Notes icon */
int ib_tasks = 0; /* Tasks icon */
int ib_rooms = 1; /* Rooms icon */
int ib_users = 1; /* Users icon */
@@ -67,6 +68,7 @@ void do_iconbar(void) {
if (!strcasecmp(key, "ib_inbox")) ib_inbox = atoi(value);
if (!strcasecmp(key, "ib_calendar")) ib_calendar = atoi(value);
if (!strcasecmp(key, "ib_contacts")) ib_contacts = atoi(value);
+ if (!strcasecmp(key, "ib_notes")) ib_notes = atoi(value);
if (!strcasecmp(key, "ib_tasks")) ib_tasks = atoi(value);
if (!strcasecmp(key, "ib_rooms")) ib_rooms = atoi(value);
if (!strcasecmp(key, "ib_users")) ib_users = atoi(value);
@@ -151,6 +153,22 @@ void do_iconbar(void) {
wprintf("
\n");
}
+ if (ib_notes) {
+ wprintf(""
+ ""
+ );
+ if (ib_displayas != IB_TEXTONLY) {
+ wprintf("
");
+ }
+ if (ib_displayas != IB_PICONLY) {
+ wprintf("Notes
");
+ }
+ wprintf("
\n");
+ }
+
if (ib_tasks) {
wprintf(""
"
"
+ ""
+ " | "
+ ""
+ " | "
+ "Notes "
+ "Your personal notes."
+ " | \n",
+ (ib_notes ? "CHECKED" : "")
+ );
+
+#ifdef WEBCIT_WITH_CALENDAR_SERVICE
+ wprintf(""
""
" | "
@@ -411,7 +444,7 @@ void display_customize_iconbar(void) {
(ib_calendar ? "CHECKED" : "")
);
- wprintf(" |
"
+ wprintf(" |
"
""
" | "
" | "
+ wprintf(" |
"
""
" | "
" | "
+ wprintf(" |
"
""
" | "
" | "
+ wprintf(" |
"
""
" | "
" | "
+ wprintf(" |
"
""
" | "
@@ -476,7 +509,7 @@ void display_customize_iconbar(void) {
(ib_advanced ? "CHECKED" : "")
);
- wprintf(" |
"
+ wprintf(" |
"
""
" | "
@@ -489,7 +522,7 @@ void display_customize_iconbar(void) {
" |
\n",
(ib_logoff ? "CHECKED" : "")
);
- wprintf(""
+ wprintf(" |
"
""
" | "
@@ -525,6 +558,7 @@ void commit_iconbar(void) {
"ib_inbox",
"ib_calendar",
"ib_contacts",
+ "ib_notes",
"ib_tasks",
"ib_rooms",
"ib_users",
diff --git a/webcit/notes.c b/webcit/notes.c
index 8fccbdcdf..2e6d7ce09 100644
--- a/webcit/notes.c
+++ b/webcit/notes.c
@@ -24,7 +24,41 @@
#include "webserver.h"
void display_note(long msgnum) {
- wprintf("\n");
- wprintf("FIXME note #%ld\n", msgnum);
- wprintf(" | \n");
+
+ serv_printf("MSG0 %ld", msgnum);
+ serv_gets(buf);
+ if (buf[0] != '1') {
+ wprintf("%s \n", &buf[4]);
+ return;
+ }
+
+ strcpy(notetext, "");
+ while (serv_gets(buf), strcmp(buf, "000")) {
+
+ /* Fill the buffer to at least 256 characters */
+ if ( (in_text) && (strlen(notetext) < 256) ) {
+ strcat(notetext, buf);
+ }
+
+ if ( (!in_text) && (!strcasecmp(buf, "text")) ) {
+ in_text = 1;
+ }
+ }
+
+ /* Now sanitize the buffer, and shorten it to just a small snippet */
+ for (i=0; i\n", display_notetext);
}
diff --git a/webcit/static/note.gif b/webcit/static/note.gif
new file mode 100644
index 0000000000000000000000000000000000000000..ac6a860c4fbc57469776d140b0be71152c22c540
GIT binary patch
literal 244
zcmZ?wbhEHbRA5kGIK;{T0{{Q-+qZ8)kZwam!+#I}3jA06$->CRz|NopQUFrRz`V0!
z*Bw5AU7pek63wS_|3zPCJh;5GXNr*HZ6QT2k+xMa3cDECVs8k}UgN%m)%eiF^%2ce
z6AW$^c@|~)DKA^k)vT~N_|emunnyK^bNQcFm1@8IaBYbo&m{A&CK4O@-|<&fF_g77
z@E0{PFt@d9c24M-)Th}rv2IG`glV=j*==SotTz;#vyg2{;j*U1V#^n$TeGY#S}QED
r#b=(_s^#SyGZsu^%D0-o*R |