From: Art Cancro Date: Tue, 7 Feb 2006 17:03:41 +0000 (+0000) Subject: Some changes to view vs. default view behavior. X-Git-Tag: v7.86~4224 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=1f897db2a1e2d181620b2b7ecae3ed0867bca229;p=citadel.git Some changes to view vs. default view behavior. This is to support the new Calendar List view without destroying the server behavior for Calendar rooms. --- diff --git a/webcit/messages.c b/webcit/messages.c index ec3e13ff9..b8b5bea66 100644 --- a/webcit/messages.c +++ b/webcit/messages.c @@ -2078,18 +2078,17 @@ void readloop(char *oper) 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; @@ -2672,18 +2671,17 @@ void display_enter(void) * 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; } @@ -2692,7 +2690,7 @@ void display_enter(void) * 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; } diff --git a/webcit/roomops.c b/webcit/roomops.c index 23bb57d2e..382339e43 100644 --- a/webcit/roomops.c +++ b/webcit/roomops.c @@ -26,6 +26,26 @@ void initialize_viewdefs(void) { 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 @@ -273,7 +293,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("" @@ -331,10 +351,10 @@ void embed_view_o_matic(void) { */ 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("