]> code.citadel.org Git - citadel.git/blobdiff - webcit/roomops.c
* Room info popup now uses Scriptactulous appear and fade effects
[citadel.git] / webcit / roomops.c
index 47bb358cf8d04222e500f7e4aed9a58431ed0d41..5cee8c9f21012816ca6b76aa303147fe42346f85 100644 (file)
@@ -3,13 +3,14 @@
  */
 /**
  * \defgroup RoomOps Lots of different room-related operations.
+ * \ingroup CitadelCommunitacion
  */
 /*@{*/
 #include "webcit.h"
 
 char floorlist[128][SIZ]; /**< list of our floor names */
 
-char *viewdefs[7]; /**< the different kinds of available views */
+char *viewdefs[8]; /**< the different kinds of available views */
 
 /**
  * \brief initialize the viewdefs with localized strings
@@ -22,6 +23,27 @@ void initialize_viewdefs(void) {
        viewdefs[4] = _("Task List");
        viewdefs[5] = _("Notes List");
        viewdefs[6] = _("Wiki");
+       viewdefs[7] = _("Calendar List");
+}
+
+/**
+ * \brief      Determine which views are allowed as the default for creating a new room.
+ *
+ * \param      which_view      The view ID being queried.
+ */
+int is_view_allowed_as_default(int which_view)
+{
+       switch(which_view) {
+               case VIEW_BBS:          return(1);
+               case VIEW_MAILBOX:      return(1);
+               case VIEW_ADDRESSBOOK:  return(1);
+               case VIEW_CALENDAR:     return(1);
+               case VIEW_TASKS:        return(1);
+               case VIEW_NOTES:        return(1);
+               case VIEW_WIKI:         return(0);      /**< because it isn't finished yet */
+               case VIEW_CALBRIEF:     return(0);
+               default:                return(0);      /**< should never get here */
+       }
 }
 
 
@@ -48,6 +70,25 @@ void load_floorlist(void)
 }
 
 
+/**
+ * \brief      Free a session's march list
+ *
+ * \param      wcf             Pointer to session being cleared
+ */
+void free_march_list(struct wcsession *wcf)
+{
+       struct march *mptr;
+
+       while (wcf->march != NULL) {
+               mptr = wcf->march->next;
+               free(wcf->march);
+               wcf->march = mptr;
+       }
+
+}
+
+
+
 /**
  * \brief remove a room from the march list
  */
@@ -156,7 +197,6 @@ void listrms(char *variety)
        struct roomlisting *rp;
        struct roomlisting *rs;
 
-
        /** Ask the server for a room list */
        serv_puts(variety);
        serv_getln(buf, sizeof buf);
@@ -164,6 +204,7 @@ void listrms(char *variety)
                wprintf("&nbsp;");
                return;
        }
+
        while (serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
                ++num_rooms;
                rp = malloc(sizeof(struct roomlisting));
@@ -236,7 +277,18 @@ void readinfo(void)
        serv_puts("RINF");
        serv_getln(buf, sizeof buf);
        if (buf[0] == '1') {
-               fmout("CENTER");
+                wprintf("<div class=\"infos\" "
+                "onclick=\"javascript:Effect.Appear('room_infos', { duration: 0.5 });\" "
+                ">");
+                wprintf(_("Room info"));
+                wprintf("</div><div id=\"room_infos\" style=\"display:none;\">"
+                "<p class=\"close_infos\" "
+                "onclick=\"javascript:Effect.Fade('room_infos', { duration: 0.5 });\" "
+                ">");
+               wprintf(_("Close window"));
+               wprintf("</p>");
+                fmout("CENTER");
+                wprintf("</div>");
        }
        else {
                wprintf("&nbsp;");
@@ -271,7 +323,7 @@ void embed_room_graphic(void) {
                        "\">"
                );
        }
-       else if (WC->wc_view == VIEW_CALENDAR) {
+       else if ( (WC->wc_view == VIEW_CALENDAR) || (WC->wc_view == VIEW_CALBRIEF) ) {
                wprintf("<img height=48 width=48 src=\""
                        "static/calarea_48x.gif"
                        "\">"
@@ -313,12 +365,11 @@ void embed_view_o_matic(void) {
        int i;
 
        wprintf("<form name=\"viewomatic\" action=\"changeview\">\n"
-               "<span class=\"room_banner_new_messages\">");
+               "<label for=\"view_name\">");
        wprintf(_("View as:"));
-       wprintf(" "
-               "<SELECT NAME=\"newview\" SIZE=\"1\" "
-               "STYLE=\"font-family: Bitstream Vera Sans,Arial,Helvetica,sans-serif;"
-               " font-size: 7pt; background: #444455; color: #ddddcc;\" "
+       wprintf("</label> "
+               "<select name=\"newview\" size=\"1\" "
+               "id=\"view_name\" class=\"selectbox\" "
                "OnChange=\"location.href=viewomatic.newview.options"
                "[selectedIndex].value\">\n");
 
@@ -330,27 +381,46 @@ void embed_view_o_matic(void) {
                 */
                if (
                        (i == WC->wc_view)
-                  ||   (i == WC->wc_default_view)
-                  ||   ( (i == 0) && (WC->wc_default_view == 1) )
-                  ||   ( (i == 1) && (WC->wc_default_view == 0) )
+                       ||      (i == WC->wc_default_view)                      /**< default */
+                       ||      ( (i == 0) && (WC->wc_default_view == 1) )      /**< mail or bulletin */
+                       ||      ( (i == 1) && (WC->wc_default_view == 0) )      /**< mail or bulletin */
+                       /** ||  ( (i == 7) && (WC->wc_default_view == 3) )      (calendar list temporarily disabled) */
                ) {
 
-                       wprintf("<OPTION %s VALUE=\"changeview?view=%d\">",
-                               ((i == WC->wc_view) ? "SELECTED" : ""),
+                       wprintf("<option %s value=\"changeview?view=%d\">",
+                               ((i == WC->wc_view) ? "selected" : ""),
                                i );
                        escputs(viewdefs[i]);
-                       wprintf("</OPTION>\n");
+                       wprintf("</option>\n");
                }
        }
-       wprintf("</select></span></form>\n");
+       wprintf("</select></form>\n");
 }
 
 
 /**
- * \brief view room banner
- * \param got what???
- * \param navbar_style
+ * \brief Display a search box
  */
+void embed_search_o_matic(void) {
+       wprintf("<form name=\"searchomatic\" action=\"do_search\">\n"
+               "<label for=\"search_name\">");
+       wprintf(_("Search: "));
+       wprintf("</label> <input "
+               "type=\"text\" name=\"query\" size=\"15\" maxlength=\"128\" "
+               "id=\"search_name\" class=\"inputbox\">\n"
+       );
+       wprintf("</select></form>\n");
+}
+
+
+/**
+ * \brief              Embed the room banner
+ *
+ * \param got          The information returned from a GOTO server command
+ * \param navbar_style         Determines which navigation buttons to display
+ *
+ */
+
 void embed_room_banner(char *got, int navbar_style) {
        char buf[256];
 
@@ -392,30 +462,32 @@ void embed_room_banner(char *got, int navbar_style) {
        svcallback("ROOMPIC", embed_room_graphic);
        svcallback("ROOMINFO", readinfo);
        svcallback("VIEWOMATIC", embed_view_o_matic);
+       svcallback("SEARCHOMATIC", embed_search_o_matic);
        svcallback("START", offer_start_page);
 
        do_template("roombanner");
        if (navbar_style != navbar_none) {
 
-               wprintf("<div style=\"position:absolute; bottom:0px; left:0px\">\n"
-                       "<table width=\"100%%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr>\n");
+               wprintf("<div id=\"navbar\">\n"
+                       "<ul>");
 
+               
 
                if (navbar_style == navbar_default) wprintf(
-                       "<td>"
+                       "<li class=\"ungoto\">"
                        "<a href=\"ungoto\">"
                        "<img align=\"middle\" src=\"static/ungoto2_24x.gif\" border=\"0\">"
                        "<span class=\"navbar_link\">%s</span></A>"
-                       "</td>\n", _("Ungoto")
+                       "</li>\n", _("Ungoto")
                );
 
                if ( (navbar_style == navbar_default) && (WC->wc_view == VIEW_BBS) ) {
                        wprintf(
-                               "<td>"
+                               "<li class=\"newmess\">"
                                "<a href=\"readnew\">"
                                "<img align=\"middle\" src=\"static/newmess2_24x.gif\" border=\"0\">"
                                "<span class=\"navbar_link\">%s</span></A>"
-                               "</td>\n", _("Read new messages")
+                               "</li>\n", _("Read new messages")
                        );
                }
 
@@ -423,88 +495,99 @@ void embed_room_banner(char *got, int navbar_style) {
                        switch(WC->wc_view) {
                                case VIEW_ADDRESSBOOK:
                                        wprintf(
-                                               "<td>"
+                                               "<li class=\"viewcontacts\">"
                                                "<a href=\"readfwd\">"
                                                "<img align=\"middle\" src=\"static/viewcontacts_24x.gif\" "
                                                "border=\"0\">"
                                                "<span class=\"navbar_link\">"
                                                "%s"
-                                               "</span></a></td>\n", _("View contacts")
+                                               "</span></a></li>\n", _("View contacts")
                                        );
                                        break;
                                case VIEW_CALENDAR:
                                        wprintf(
-                                               "<td>"
+                                               "<li class=\"staskday\">"
                                                "<a href=\"readfwd?calview=day\">"
                                                "<img align=\"middle\" src=\"static/taskday2_24x.gif\" "
                                                "border=\"0\">"
                                                "<span class=\"navbar_link\">"
                                                "%s"
-                                               "</span></a></td>\n", _("Day view")
+                                               "</span></a></li>\n", _("Day view")
                                        );
                                        wprintf(
-                                               "<td>"
+                                               "<li class=\"monthview\">"
                                                "<a href=\"readfwd?calview=month\">"
                                                "<img align=\"middle\" src=\"static/monthview2_24x.gif\" "
                                                "border=\"0\">"
                                                "<span class=\"navbar_link\">"
                                                "%s"
-                                               "</span></a></td>\n", _("Month view")
+                                               "</span></a></li>\n", _("Month view")
+                                       );
+                                       break;
+                               case VIEW_CALBRIEF:
+                                       wprintf(
+                                               "<li class=\"monthview\">"
+                                               "<a href=\"readfwd?calview=month\">"
+                                               "<img align=\"middle\" src=\"static/monthview2_24x.gif\" "
+                                               "border=\"0\">"
+                                               "<span class=\"navbar_link\">"
+                                               "%s"
+                                               "</span></a></li>\n", _("Calendar list")
                                        );
                                        break;
                                case VIEW_TASKS:
                                        wprintf(
-                                               "<td>"
+                                               "<li class=\"taskmanag\">"
                                                "<a href=\"readfwd\">"
                                                "<img align=\"middle\" src=\"static/taskmanag_24x.gif\" "
                                                "border=\"0\">"
                                                "<span class=\"navbar_link\">"
                                                "%s"
-                                               "</span></a></td>\n", _("View tasks")
+                                               "</span></a></li>\n", _("View tasks")
                                        );
                                        break;
                                case VIEW_NOTES:
                                        wprintf(
-                                               "<td>"
+                                               "<li class=\"viewnotes\">"
                                                "<a href=\"readfwd\">"
                                                "<img align=\"middle\" src=\"static/viewnotes_24x.gif\" "
                                                "border=\"0\">"
                                                "<span class=\"navbar_link\">"
                                                "%s"
-                                               "</span></a></td>\n", _("View notes")
+                                               "</span></a></li>\n", _("View notes")
                                        );
                                        break;
                                case VIEW_MAILBOX:
                                        wprintf(
-                                               "<td>"
+                                               "<li class=\"readallmess\">"
                                                "<a href=\"readfwd\">"
                                                "<img align=\"middle\" src=\"static/readallmess3_24x.gif\" "
                                                "border=\"0\">"
                                                "<span class=\"navbar_link\">"
                                                "%s"
-                                               "</span></a></td>\n", _("View message list")
+                                               "</span></a></li>\n", _("View message list")
                                        );
                                        break;
                                case VIEW_WIKI:
                                        wprintf(
-                                               "<td>"
+                                               "<li class=\"readallmess\">"
                                                "<a href=\"readfwd\">"
                                                "<img align=\"middle\" src=\"static/readallmess3_24x.gif\" "
                                                "border=\"0\">"
                                                "<span class=\"navbar_link\">"
                                                "%s"
-                                               "</span></a></td>\n", _("Wiki home")
+                                               "</span></a></li>\n", _("Wiki home")
                                        );
                                        break;
                                default:
                                        wprintf(
-                                               "<td>"
+                                               "<li class=\"readallmess\">"
                                                "<a href=\"readfwd\">"
                                                "<img align=\"middle\" src=\"static/readallmess3_24x.gif\" "
                                                "border=\"0\">"
                                                "<span class=\"navbar_link\">"
                                                "%s"
-                                               "</span></a></td>\n", _("Read all messages")
+                                               "</span></a></li>\n", _("Read all messages")
                                        );
                                        break;
                        }
@@ -514,94 +597,110 @@ void embed_room_banner(char *got, int navbar_style) {
                        switch(WC->wc_view) {
                                case VIEW_ADDRESSBOOK:
                                        wprintf(
-                                               "<td><a href=\"display_enter\">"
+                                               "<li class=\"addnewcontact\">"
+                                               "<a href=\"display_enter\">"
                                                "<img align=\"middle\" src=\"static/addnewcontact_24x.gif\" "
                                                "border=\"0\"><span class=\"navbar_link\">"
                                                "%s"
-                                               "</span></a></td>\n", _("Add new contact")
+                                               "</span></a></li>\n", _("Add new contact")
                                        );
                                        break;
                                case VIEW_CALENDAR:
-                                       wprintf(
-                                               "<td><a href=\"display_enter\">"
+                               case VIEW_CALBRIEF:
+                                       wprintf("<li class=\"addevent\"><a href=\"display_enter");
+                                       if (strlen(bstr("year")) > 0) wprintf("?year=%s", bstr("year"));
+                                       if (strlen(bstr("month")) > 0) wprintf("?month=%s", bstr("month"));
+                                       if (strlen(bstr("day")) > 0) wprintf("?day=%s", bstr("day"));
+                                       wprintf("\">"
                                                "<img align=\"middle\" src=\"static/addevent_24x.gif\" "
                                                "border=\"0\"><span class=\"navbar_link\">"
                                                "%s"
-                                               "</span></a></td>\n", _("Add new event")
+                                               "</span></a></li>\n", _("Add new event")
                                        );
                                        break;
                                case VIEW_TASKS:
                                        wprintf(
-                                               "<td><a href=\"display_enter\">"
+                                               "<li class=\"newmess\">"
+                                               "<a href=\"display_enter\">"
                                                "<img align=\"middle\" src=\"static/newmess3_24x.gif\" "
                                                "border=\"0\"><span class=\"navbar_link\">"
                                                "%s"
-                                               "</span></a></td>\n", _("Add new task")
+                                               "</span></a></li>\n", _("Add new task")
                                        );
                                        break;
                                case VIEW_NOTES:
                                        wprintf(
-                                               "<td><a href=\"javascript:add_new_note();\">"
+                                               "<li class=\"enternewnote\">"
+                                               "<a href=\"javascript:add_new_note();\">"
                                                "<img align=\"middle\" src=\"static/enternewnote_24x.gif\" "
                                                "border=\"0\"><span class=\"navbar_link\">"
                                                "%s"
-                                               "</span></a></td>\n", _("Add new note")
+                                               "</span></a></li>\n", _("Add new note")
                                        );
                                        break;
                                case VIEW_WIKI:
                                        safestrncpy(buf, bstr("page"), sizeof buf);
                                        str_wiki_index(buf);
                                        wprintf(
-                                               "<td><a href=\"display_enter?wikipage=%s\">"
+                                               "<li class=\"newmess\">"
+                                               "<a href=\"display_enter?wikipage=%s\">"
                                                "<img align=\"middle\" src=\"static/newmess3_24x.gif\" "
                                                "border=\"0\"><span class=\"navbar_link\">"
                                                "%s"
-                                               "</span></a></td>\n", buf, _("Edit this page")
+                                               "</span></a></li>\n", buf, _("Edit this page")
+                                       );
+                                       break;
+                               case VIEW_MAILBOX:
+                                       wprintf(
+                                               "<li class=\"newmess\">"
+                                               "<a href=\"display_enter\">"
+                                               "<img align=\"middle\" src=\"static/newmess3_24x.gif\" "
+                                               "border=\"0\"><span class=\"navbar_link\">"
+                                               "%s"
+                                               "</span></a></li>\n", _("Write mail")
                                        );
                                        break;
                                default:
                                        wprintf(
-                                               "<td><a href=\"display_enter\">"
+                                               "<li class=\"newmess\">"
+                                               "<a href=\"display_enter\">"
                                                "<img align=\"middle\" src=\"static/newmess3_24x.gif\" "
                                                "border=\"0\"><span class=\"navbar_link\">"
                                                "%s"
-                                               "</span></a></td>\n", _("Enter a message")
+                                               "</span></a></li>\n", _("Enter a message")
                                        );
                                        break;
                        }
                }
 
                if (navbar_style == navbar_default) wprintf(
-                       "<td>"
+                       "<li class=\"skipthisroom\">"
                        "<a href=\"skip\" "
-                       "TITLE=\"%s\">"
+                       "title=\"%s\">"
                        "<img align=\"middle\" src=\"static/skipthisroom_24x.gif\" border=\"0\">"
                        "<span class=\"navbar_link\">%s</span></a>"
-                       "</td>\n",
+                       "</li>\n",
                        _("Leave all messages marked as unread, go to next room with unread messages"),
                        _("Skip this room")
                );
 
                if (navbar_style == navbar_default) wprintf(
-                       "<td>"
+                       "<li class=\"markngo\">"
                        "<a href=\"gotonext\" "
-                       "TITLE=\"%s\">"
+                       "title=\"%s\">"
                        "<img align=\"middle\" src=\"static/markngo_24x.gif\" border=\"0\">"
                        "<span class=\"navbar_link\">%s</span></a>"
-                       "</td>\n",
+                       "</li>\n",
                        _("Mark all messages as read, go to next room with unread messages"),
                        _("Goto next room")
                );
 
-               wprintf("</tr></table></div>\n");
+               wprintf("</ul></div>\n");
        }
 
 }
 
 
-
-
-
 /**
  * \brief back end routine to take the session to a new room
  * \param gname room to go to
@@ -642,6 +741,7 @@ int gotoroom(char *gname)
        WC->wc_view = extract_int(&buf[4], 11);
        WC->wc_default_view = extract_int(&buf[4], 12);
        WC->wc_is_trash = extract_int(&buf[4], 13);
+       WC->room_flags2 = extract_int(&buf[4], 14);
 
        if (WC->is_aide)
                WC->is_room_aide = WC->is_aide;
@@ -708,8 +808,9 @@ char *pop_march(int desired_floor)
  */
 void gotonext(void)
 {
-       char buf[SIZ];
+       char buf[256];
        struct march *mptr, *mptr2;
+       char room_name[128];
        char next_room[128];
 
        /**
@@ -722,18 +823,21 @@ void gotonext(void)
                serv_getln(buf, sizeof buf);
                if (buf[0] == '1')
                        while (serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
-                               mptr = (struct march *) malloc(sizeof(struct march));
-                               mptr->next = NULL;
-                               extract_token(mptr->march_name, buf, 0, '|', sizeof mptr->march_name);
-                               mptr->march_floor = extract_int(buf, 2);
-                               mptr->march_order = extract_int(buf, 3);
-                               if (WC->march == NULL) {
-                                       WC->march = mptr;
-                               } else {
-                                       mptr2 = WC->march;
-                                       while (mptr2->next != NULL)
-                                               mptr2 = mptr2->next;
-                                       mptr2->next = mptr;
+                               extract_token(room_name, buf, 0, '|', sizeof room_name);
+                               if (strcasecmp(room_name, WC->wc_roomname)) {
+                                       mptr = (struct march *) malloc(sizeof(struct march));
+                                       mptr->next = NULL;
+                                       safestrncpy(mptr->march_name, room_name, sizeof mptr->march_name);
+                                       mptr->march_floor = extract_int(buf, 2);
+                                       mptr->march_order = extract_int(buf, 3);
+                                       if (WC->march == NULL) {
+                                               WC->march = mptr;
+                                       } else {
+                                               mptr2 = WC->march;
+                                               while (mptr2->next != NULL)
+                                                       mptr2 = mptr2->next;
+                                               mptr2->next = mptr;
+                                       }
                                }
                        }
                /**
@@ -784,15 +888,10 @@ void smart_goto(char *next_room) {
  */
 void slrp_highest(void)
 {
-       char buf[SIZ];
+       char buf[256];
 
-       /* set pointer */
        serv_puts("SLRP HIGHEST");
        serv_getln(buf, sizeof buf);
-       if (buf[0] != '2') {
-               wprintf("<EM>%s</EM><br />\n", &buf[4]);
-               return;
-       }
 }
 
 
@@ -894,15 +993,16 @@ int self_service(int newval) {
 void display_editroom(void)
 {
        char buf[SIZ];
-       char cmd[SIZ];
-       char node[SIZ];
-       char remote_room[SIZ];
-       char recp[SIZ];
+       char cmd[1024];
+       char node[256];
+       char remote_room[128];
+       char recp[1024];
        char er_name[128];
        char er_password[10];
        char er_dirname[15];
        char er_roomaide[26];
        unsigned er_flags;
+       unsigned er_flags2;
        int er_floor;
        int i, j;
        char *tab;
@@ -930,6 +1030,7 @@ void display_editroom(void)
        extract_token(er_dirname, &buf[4], 2, '|', sizeof er_dirname);
        er_flags = extract_int(&buf[4], 3);
        er_floor = extract_int(&buf[4], 4);
+       er_flags2 = extract_int(&buf[4], 7);
 
        output_headers(1, 1, 1, 0, 0, 0);
 
@@ -941,10 +1042,10 @@ void display_editroom(void)
                "<TD>&nbsp;</TD>\n");
 
        if (!strcmp(tab, "admin")) {
-               wprintf("<TD BGCOLOR=\"#FFFFFF\"><SPAN CLASS=\"tablabel\">");
+               wprintf("<TD class=\"roomops_cell_label\"><SPAN CLASS=\"tablabel\">");
        }
        else {
-               wprintf("<TD BGCOLOR=\"#CCCCCC\"><a href=\"display_editroom&tab=admin\">");
+               wprintf("<TD class=\"roomops_cell_edit\"><a href=\"display_editroom&tab=admin\">");
        }
        wprintf(_("Administration"));
        if (!strcmp(tab, "admin")) {
@@ -957,10 +1058,10 @@ void display_editroom(void)
        wprintf("<TD>&nbsp;</TD>\n");
 
        if (!strcmp(tab, "config")) {
-               wprintf("<TD BGCOLOR=\"#FFFFFF\"><SPAN CLASS=\"tablabel\">");
+               wprintf("<TD class=\"roomops_cell_label\"><SPAN CLASS=\"tablabel\">");
        }
        else {
-               wprintf("<TD BGCOLOR=\"#CCCCCC\"><a href=\"display_editroom&tab=config\">");
+               wprintf("<TD class=\"roomops_cell_edit\"><a href=\"display_editroom&tab=config\">");
        }
        wprintf(_("Configuration"));
        if (!strcmp(tab, "config")) {
@@ -973,10 +1074,10 @@ void display_editroom(void)
        wprintf("<TD>&nbsp;</TD>\n");
 
        if (!strcmp(tab, "expire")) {
-               wprintf("<TD BGCOLOR=\"#FFFFFF\"><SPAN CLASS=\"tablabel\">");
+               wprintf("<TD class=\"roomops_cell_label\"><SPAN CLASS=\"tablabel\">");
        }
        else {
-               wprintf("<TD BGCOLOR=\"#CCCCCC\"><a href=\"display_editroom&tab=expire\">");
+               wprintf("<TD class=\"roomops_cell_edit\"><a href=\"display_editroom&tab=expire\">");
        }
        wprintf(_("Message expire policy"));
        if (!strcmp(tab, "expire")) {
@@ -989,10 +1090,10 @@ void display_editroom(void)
        wprintf("<TD>&nbsp;</TD>\n");
 
        if (!strcmp(tab, "access")) {
-               wprintf("<TD BGCOLOR=\"#FFFFFF\"><SPAN CLASS=\"tablabel\">");
+               wprintf("<TD class=\"roomops_cell_label\"><SPAN CLASS=\"tablabel\">");
        }
        else {
-               wprintf("<TD BGCOLOR=\"#CCCCCC\"><a href=\"display_editroom&tab=access\">");
+               wprintf("<TD class=\"roomops_cell_edit\"><a href=\"display_editroom&tab=access\">");
        }
        wprintf(_("Access controls"));
        if (!strcmp(tab, "access")) {
@@ -1005,10 +1106,10 @@ void display_editroom(void)
        wprintf("<TD>&nbsp;</TD>\n");
 
        if (!strcmp(tab, "sharing")) {
-               wprintf("<TD BGCOLOR=\"#FFFFFF\"><SPAN CLASS=\"tablabel\">");
+               wprintf("<TD class=\"roomops_cell_label\"><SPAN CLASS=\"tablabel\">");
        }
        else {
-               wprintf("<TD BGCOLOR=\"#CCCCCC\"><a href=\"display_editroom&tab=sharing\">");
+               wprintf("<TD class=\"roomops_cell_edit\"><a href=\"display_editroom&tab=sharing\">");
        }
        wprintf(_("Sharing"));
        if (!strcmp(tab, "sharing")) {
@@ -1021,10 +1122,10 @@ void display_editroom(void)
        wprintf("<TD>&nbsp;</TD>\n");
 
        if (!strcmp(tab, "listserv")) {
-               wprintf("<TD BGCOLOR=\"#FFFFFF\"><SPAN CLASS=\"tablabel\">");
+               wprintf("<TD class=\"roomops_cell_label\"><SPAN CLASS=\"tablabel\">");
        }
        else {
-               wprintf("<TD BGCOLOR=\"#CCCCCC\"><a href=\"display_editroom&tab=listserv\">");
+               wprintf("<TD class=\"roomops_cell_edit\"><a href=\"display_editroom&tab=listserv\">");
        }
        wprintf(_("Mailing list service"));
        if (!strcmp(tab, "listserv")) {
@@ -1041,7 +1142,7 @@ void display_editroom(void)
 
        /** begin content of whatever tab is open now */
        wprintf("<div class=\"fix_scrollbar_bug\">"
-               "<TABLE border=0 width=100%% bgcolor=\"#FFFFFF\">\n"
+               "<TABLE class=\"roomops_background\">\n"
                "<TR><TD>\n");
 
        if (!strcmp(tab, "admin")) {
@@ -1138,6 +1239,12 @@ void display_editroom(void)
                wprintf("> ");
                wprintf(_("Read-only room"));
        
+               wprintf("\n<LI><INPUT TYPE=\"checkbox\" NAME=\"collabdel\" VALUE=\"yes\" ");
+               if (er_flags2 & QR2_COLLABDEL)
+                       wprintf("CHECKED ");
+               wprintf("> ");
+               wprintf(_("All users allowed to post may also delete messages"));
+       
                /** directory stuff */
                wprintf("\n<LI><INPUT TYPE=\"checkbox\" NAME=\"directory\" VALUE=\"yes\" ");
                if (er_flags & QR_DIRECTORY)
@@ -1216,7 +1323,7 @@ void display_editroom(void)
                serv_puts("GETA");
                serv_getln(buf, sizeof buf);
                if (buf[0] != '2') {
-                       wprintf("<EM>%s</EM>\n", &buf[4]);
+                       wprintf("<em>%s</em>\n", &buf[4]);
                } else {
                        extract_token(er_roomaide, &buf[4], 0, '|', sizeof er_roomaide);
                        wprintf("<INPUT TYPE=\"text\" NAME=\"er_roomaide\" VALUE=\"%s\" MAXLENGTH=\"25\">\n", er_roomaide);
@@ -1291,7 +1398,7 @@ void display_editroom(void)
                wprintf("</I></B></TD></TR>\n"
                        "<TR><TD VALIGN=TOP>\n");
 
-               wprintf("<TABLE border=0 cellpadding=5><TR BGCOLOR=\"#CCCCCC\"><TD>");
+               wprintf("<TABLE border=0 cellpadding=5><TR class=\"roomops_cell\"><TD>");
                wprintf(_("Remote node name"));
                wprintf("</TD><TD>");
                wprintf(_("Remote room name"));
@@ -1336,7 +1443,7 @@ void display_editroom(void)
 
                wprintf("</TABLE>\n");
                wprintf("</TD><TD VALIGN=TOP>\n");
-               wprintf("<TABLE border=0 cellpadding=5><TR BGCOLOR=\"#CCCCCC\"><TD>");
+               wprintf("<TABLE border=0 cellpadding=5><TR class=\"roomops_cell\"><TD>");
                wprintf(_("Remote node name"));
                wprintf("</TD><TD>");
                wprintf(_("Remote room name"));
@@ -1604,6 +1711,9 @@ void editroom(void)
        char er_roomaide[26];
        int er_floor;
        unsigned er_flags;
+       int er_listingorder;
+       int er_defaultview;
+       unsigned er_flags2;
        int bump;
 
 
@@ -1625,6 +1735,9 @@ void editroom(void)
        extract_token(er_password, &buf[4], 1, '|', sizeof er_password);
        extract_token(er_dirname, &buf[4], 2, '|', sizeof er_dirname);
        er_flags = extract_int(&buf[4], 3);
+       er_listingorder = extract_int(&buf[4], 5);
+       er_defaultview = extract_int(&buf[4], 6);
+       er_flags2 = extract_int(&buf[4], 7);
 
        strcpy(er_roomaide, bstr("er_roomaide"));
        if (strlen(er_roomaide) == 0) {
@@ -1676,6 +1789,12 @@ void editroom(void)
                er_flags &= ~QR_READONLY;
        }
 
+       if (!strcmp(bstr("collabdel"), "yes")) {
+               er_flags2 |= QR2_COLLABDEL;
+       } else {
+               er_flags2 &= ~QR2_COLLABDEL;
+       }
+
        if (!strcmp(bstr("permanent"), "yes")) {
                er_flags |= QR_PERMANENT;
        } else {
@@ -1726,8 +1845,9 @@ void editroom(void)
 
        er_floor = atoi(bstr("er_floor"));
 
-       sprintf(buf, "SETR %s|%s|%s|%u|%d|%d",
-            er_name, er_password, er_dirname, er_flags, bump, er_floor);
+       sprintf(buf, "SETR %s|%s|%s|%u|%d|%d|%d|%d|%u",
+               er_name, er_password, er_dirname, er_flags, bump, er_floor,
+               er_listingorder, er_defaultview, er_flags2);
        serv_puts(buf);
        serv_getln(buf, sizeof buf);
        if (buf[0] != '2') {
@@ -1884,7 +2004,7 @@ void display_entroom(void)
 
        output_headers(1, 1, 2, 0, 0, 0);
        wprintf("<div id=\"banner\">\n"
-               "<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>"
+               "<TABLE class=\"roomops_banner\"><TR><TD>"
                "<SPAN CLASS=\"titlebar\">");
        wprintf(_("Create a new room"));
        wprintf("</SPAN>"
@@ -1893,7 +2013,7 @@ void display_entroom(void)
        );
 
        wprintf("<div class=\"fix_scrollbar_bug\">"
-               "<table border=0 width=100%% bgcolor=\"#ffffff\"><tr><td>\n");
+               "<table class=\"roomops_background\"><tr><td>\n");
 
        wprintf("<form name=\"create_room_form\" method=\"POST\" action=\"entroom\">\n");
 
@@ -1934,10 +2054,12 @@ void display_entroom(void)
                "       }                                               "
                "\">\n");
        for (i=0; i<(sizeof viewdefs / sizeof (char *)); ++i) {
-               wprintf("<OPTION %s VALUE=\"%d\">",
-                       ((i == 0) ? "SELECTED" : ""), i );
-               escputs(viewdefs[i]);
-               wprintf("</OPTION>\n");
+               if (is_view_allowed_as_default(i)) {
+                       wprintf("<OPTION %s VALUE=\"%d\">",
+                               ((i == 0) ? "SELECTED" : ""), i );
+                       escputs(viewdefs[i]);
+                       wprintf("</OPTION>\n");
+               }
        }
        wprintf("</SELECT>\n");
 
@@ -2095,7 +2217,7 @@ void display_private(char *rname, int req_pass)
 {
        output_headers(1, 1, 2, 0, 0, 0);
        wprintf("<div id=\"banner\">\n"
-               "<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>"
+               "<TABLE class=\"roomops_banner\"><TR><TD>"
                "<SPAN CLASS=\"titlebar\">");
        wprintf(_("Go to a hidden room"));
        wprintf("</SPAN>"
@@ -2104,7 +2226,7 @@ void display_private(char *rname, int req_pass)
        );
 
        wprintf("<div class=\"fix_scrollbar_bug\">"
-               "<table border=0 width=100%% bgcolor=\"#ffffff\"><tr><td>\n");
+               "<table class=\"roomops_background\"><tr><td>\n");
 
        wprintf("<CENTER>\n");
        wprintf("<br />");
@@ -2118,7 +2240,7 @@ void display_private(char *rname, int req_pass)
        wprintf("<FORM METHOD=\"POST\" action=\"goto_private\">\n");
 
        wprintf("<table border=\"0\" cellspacing=\"5\" "
-               "cellpadding=\"5\" BGCOLOR=\"#EEEEEE\">\n"
+               "cellpadding=\"5\" class=\"roomops_background_alt\">\n"
                "<TR><TD>");
        wprintf(_("Enter room name:"));
        wprintf("</TD><TD>"
@@ -2187,7 +2309,7 @@ void display_zap(void)
        output_headers(1, 1, 2, 0, 0, 0);
 
        wprintf("<div id=\"banner\">\n");
-       wprintf("<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#770000\"><TR><TD>");
+       wprintf("<TABLE class=\"roomops_zap\"><TR><TD>");
        wprintf("<SPAN CLASS=\"titlebar\">");
        wprintf(_("Zap (forget/unsubscribe) the current room"));
        wprintf("</SPAN>\n");
@@ -2472,6 +2594,9 @@ void do_folder_view(struct folder *fold, int max_folders, int num_floors) {
                else if (fold[i].view == VIEW_CALENDAR) {
                        wprintf("'static/calarea_16x.gif'");
                }
+               else if (fold[i].view == VIEW_CALBRIEF) {
+                       wprintf("'static/calarea_16x.gif'");
+               }
                else if (fold[i].view == VIEW_TASKS) {
                        wprintf("'static/taskmanag_16x.gif'");
                }
@@ -2679,6 +2804,9 @@ void do_iconbar_view(struct folder *fold, int max_folders, int num_floors) {
                        else if (fold[i].view == VIEW_CALENDAR) {
                                icon = "calarea_16x.gif" ;
                        }
+                       else if (fold[i].view == VIEW_CALBRIEF) {
+                               icon = "calarea_16x.gif" ;
+                       }
                        else if (fold[i].view == VIEW_TASKS) {
                                icon = "taskmanag_16x.gif" ;
                        }
@@ -2812,6 +2940,9 @@ void list_all_rooms_by_floor(char *viewpref) {
                ++num_floors;
        }
 
+       /** refresh the messages index for this room */
+//     serv_puts("GOTO ");
+//     while (serv_getln(buf, sizeof buf), strcmp(buf, "000"));
        /** Now add rooms */
        serv_puts("LKRA");
        serv_getln(buf, sizeof buf);
@@ -2919,7 +3050,7 @@ void knrooms(void)
 
        /** title bar */
        wprintf("<div id=\"banner\">\n"
-               "<TABLE WIDTH=100%% BORDER=0 BGCOLOR=\"#444455\"><TR><TD>"
+               "<TABLE class=\"roomops_banner\"><TR><TD>"
                "<SPAN CLASS=\"titlebar\">"
        );
        if (!strcasecmp(listviewpref, "rooms")) {