*/
/**
* \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
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 */
+ }
}
}
+/**
+ * \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
*/
"\">"
);
}
- 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"
"\">"
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;\" "
+ "STYLE=\"font-size: 7pt; background: #444455; color: #ddddcc;\" "
"OnChange=\"location.href=viewomatic.newview.options"
"[selectedIndex].value\">\n");
*/
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 */
) {
wprintf("<OPTION %s VALUE=\"changeview?view=%d\">",
"</span></a></td>\n", _("Month view")
);
break;
+ case VIEW_CALBRIEF:
+ wprintf(
+ "<td>"
+ "<a href=\"readfwd?calview=month\">"
+ "<img align=\"middle\" src=\"static/monthview2_24x.gif\" "
+ "border=\"0\">"
+ "<span class=\"navbar_link\">"
+ "%s"
+ "</span></a></td>\n", _("Calendar list")
+ );
+ break;
case VIEW_TASKS:
wprintf(
"<td>"
);
break;
case VIEW_CALENDAR:
+ case VIEW_CALBRIEF:
wprintf(
"<td><a href=\"display_enter\">"
"<img align=\"middle\" src=\"static/addevent_24x.gif\" "
*/
void gotonext(void)
{
- char buf[SIZ];
+ char buf[256];
struct march *mptr, *mptr2;
char next_room[128];
" } "
"\">\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");
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'");
}
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" ;
}