is_singlecard = atoi(bstr("is_singlecard"));
- if ((WC->wc_view == VIEW_CALENDAR) ||
- (WC->wc_view == VIEW_CALBRIEF)){ /**< calendar */
+ if (WC->wc_default_view == VIEW_CALENDAR) { /**< calendar */
is_calendar = 1;
strcpy(cmd, "MSGS ALL");
maxmsgs = 32767;
}
- if (WC->wc_view == VIEW_TASKS) { /**< tasks */
+ if (WC->wc_default_view == VIEW_TASKS) { /**< tasks */
is_tasks = 1;
strcpy(cmd, "MSGS ALL");
maxmsgs = 32767;
}
- if (WC->wc_view == VIEW_NOTES) { /**< notes */
+ if (WC->wc_default_view == VIEW_NOTES) { /**< notes */
is_notes = 1;
strcpy(cmd, "MSGS ALL");
maxmsgs = 32767;
* Are we perhaps in an address book view? If so, then an "enter
* message" command really means "add new entry."
*/
- if (WC->wc_view == VIEW_ADDRESSBOOK) {
+ if (WC->wc_default_view == VIEW_ADDRESSBOOK) {
do_edit_vcard(-1, "", "");
return;
}
#ifdef WEBCIT_WITH_CALENDAR_SERVICE
/**
- * Are we perhaps in a calendar view? If so, then an "enter
+ * Are we perhaps in a calendar room? If so, then an "enter
* message" command really means "add new calendar item."
*/
- if ((WC->wc_view == VIEW_CALENDAR) ||
- (WC->wc_view == VIEW_CALBRIEF)){
+ if (WC->wc_default_view == VIEW_CALENDAR) {
display_edit_event();
return;
}
* Are we perhaps in a tasks view? If so, then an "enter
* message" command really means "add new task."
*/
- if (WC->wc_view == VIEW_TASKS) {
+ if (WC->wc_default_view == VIEW_TASKS) {
display_edit_task();
return;
}
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 load the list of floors
"\">"
);
}
- 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"
"\">"
*/
if (
(i == WC->wc_view)
- || (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 */
+ || (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\" "
" } "
"\">\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" ;
}