From 01f768818537df4a028c180578614d092bc29996 Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Tue, 12 Oct 2010 09:49:17 +0000 Subject: [PATCH] allow to set/choose the view in home-view --- calendar/inc/class.calendar_hooks.inc.php | 4 ++-- calendar/inc/class.calendar_ui.inc.php | 2 +- calendar/inc/class.calendar_uilist.inc.php | 2 +- calendar/inc/class.calendar_uiviews.inc.php | 8 +++++--- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/calendar/inc/class.calendar_hooks.inc.php b/calendar/inc/class.calendar_hooks.inc.php index 2538aeda19..9289c55e1c 100644 --- a/calendar/inc/class.calendar_hooks.inc.php +++ b/calendar/inc/class.calendar_hooks.inc.php @@ -53,7 +53,7 @@ class calendar_hooks $save_app_header = $GLOBALS['egw_info']['flags']['app_header']; - if ($GLOBALS['egw_info']['user']['preferences']['calendar']['defaultcalendar'] == 'listview') + if ($GLOBALS['egw_info']['user']['preferences']['calendar']['mainscreen_showevents'] == 'listview') { if (!file_exists(EGW_SERVER_ROOT.($et_css_file ='/etemplate/templates/'.$GLOBALS['egw_info']['user']['preferences']['common']['template_set'].'/app.css'))) { @@ -300,7 +300,7 @@ class calendar_hooks 'type' => 'select', 'label' => 'show default view on main screen', 'name' => 'mainscreen_showevents', - 'values' => $mainpage, + 'values' => $mainpage+$default, 'help' => 'Displays your default calendar view on the startpage (page you get when you enter eGroupWare or click on the homepage icon)?', 'xmlrpc' => True, 'admin' => False, diff --git a/calendar/inc/class.calendar_ui.inc.php b/calendar/inc/class.calendar_ui.inc.php index 878dded371..8e4f9cf616 100644 --- a/calendar/inc/class.calendar_ui.inc.php +++ b/calendar/inc/class.calendar_ui.inc.php @@ -271,7 +271,7 @@ class calendar_ui 'save_owner' => 0, 'sortby' => 'category', 'planner_days'=> 0, // full month - 'view' => $this->bo->cal_prefs['defaultcalendar'], + 'view' => ($this->bo->cal_prefs['defaultcalendar']?$this->bo->cal_prefs['defaultcalendar']:'day'), // use pref, if exists else use the dayview 'listview_days'=> '', // no range ) as $state => $default) { diff --git a/calendar/inc/class.calendar_uilist.inc.php b/calendar/inc/class.calendar_uilist.inc.php index 1e39c00a55..224f5954fe 100644 --- a/calendar/inc/class.calendar_uilist.inc.php +++ b/calendar/inc/class.calendar_uilist.inc.php @@ -80,7 +80,7 @@ class calendar_uilist extends calendar_ui 'filter' => 'all', 'owner' => $this->user, 'multiple' => 0, - 'view' => $this->bo->cal_prefs['defaultcalendar'], + 'view' => $this->bo->cal_prefs['mainscreen_showevents'], )); egw_session::appsession('calendar_list','calendar',''); // in case there's already something set diff --git a/calendar/inc/class.calendar_uiviews.inc.php b/calendar/inc/class.calendar_uiviews.inc.php index 57a9792c1c..01cc0c6731 100644 --- a/calendar/inc/class.calendar_uiviews.inc.php +++ b/calendar/inc/class.calendar_uiviews.inc.php @@ -198,10 +198,10 @@ class calendar_uiviews extends calendar_ui 'date' => $this->bo->date2string($this->bo->now_su), 'cat_id' => 0, 'filter' => 'all', - 'owner' => substr($this->cal_prefs['defaultcalendar'],0,7) == 'planner' && $this->cal_prefs['planner_start_with_group'] ? + 'owner' => substr($this->cal_prefs['mainscreen_showevents'],0,7) == 'planner' && $this->cal_prefs['planner_start_with_group'] ? $this->cal_prefs['planner_start_with_group'] : $this->user, 'multiple' => 0, - 'view' => $this->bo->cal_prefs['defaultcalendar'], + 'view' => $this->bo->cal_prefs['mainscreen_showevents'], )); if (($error = $this->check_owners_access())) @@ -212,7 +212,7 @@ class calendar_uiviews extends calendar_ui { $group_warning = '

'.$this->group_warning."

\n"; } - switch($this->cal_prefs['defaultcalendar']) + switch($this->cal_prefs['mainscreen_showevents']) { case 'planner_user': case 'planner_cat': @@ -234,6 +234,8 @@ class calendar_uiviews extends calendar_ui case 'day': return $group_warning.$this->day(true); + case 'day4': + return $group_warning.$this->week(4,true); } }