allow to set/choose the view in home-view

This commit is contained in:
Klaus Leithoff 2010-10-12 09:49:17 +00:00
parent 2a801e61fe
commit 01f7688185
4 changed files with 9 additions and 7 deletions

View File

@ -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,

View File

@ -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)
{

View File

@ -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

View File

@ -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 = '<p class="redItalic" align="center">'.$this->group_warning."</p>\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);
}
}