* Calendar: fixed week 13 was skiped (due to daylight saving change) when using week navigation, added propper header for multiple week view

This commit is contained in:
Ralf Becker 2015-02-18 08:47:04 +00:00
parent 843bbd1dc1
commit 23c51a7acd

View File

@ -655,16 +655,18 @@ class calendar_uiviews extends calendar_ui
$this->first = $this->datetime->get_weekday_start($this->year,$this->month,$this->day); $this->first = $this->datetime->get_weekday_start($this->year,$this->month,$this->day);
$this->last = strtotime("+$weeks weeks",$this->first) - 1; $this->last = strtotime("+$weeks weeks",$this->first) - 1;
$weekNavH = "$weeks weeks"; $weekNavH = "$weeks weeks";
$navHeader = lang('Week').' '.$this->week_number($this->first).' - '.$this->week_number($this->last).': '.
$this->bo->long_date($this->first,$this->last);
} }
else else
{ {
$this->_week_align_month($this->first,$this->last); $this->_week_align_month($this->first,$this->last);
$weekNavH = "1 month"; $weekNavH = "1 month";
$navHeader = lang(adodb_date('F',$this->bo->date2ts($this->date))).' '.$this->year;
} }
if ($this->debug > 0) $this->bo->debug_message('uiviews::month(%1) date=%2: first=%3, last=%4',False,$weeks,$this->date,$this->bo->date2string($this->first),$this->bo->date2string($this->last)); if ($this->debug > 0) $this->bo->debug_message('uiviews::month(%1) date=%2: first=%3, last=%4',False,$weeks,$this->date,$this->bo->date2string($this->first),$this->bo->date2string($this->last));
$GLOBALS['egw_info']['flags']['app_header'] .= ': '.lang(adodb_date('F',$this->bo->date2ts($this->date))).' '.$this->year; $GLOBALS['egw_info']['flags']['app_header'] .= ': '.$navHeader;
$navHeader = lang(adodb_date('F',$this->bo->date2ts($this->date))).' '.$this->year;
$days =& $this->bo->search(array( $days =& $this->bo->search(array(
'start' => $this->first, 'start' => $this->first,
@ -842,32 +844,15 @@ class calendar_uiviews extends calendar_ui
$navHeader = lang('Week').' '.$this->week_number($this->first).': '.$this->bo->long_date($this->first,$this->last); $navHeader = lang('Week').' '.$this->week_number($this->first).': '.$this->bo->long_date($this->first,$this->last);
} }
# temporarly disabled, because it collides with the title for the website
#
# // add navigation for previous and next
# // prev. week
# $GLOBALS['egw_info']['flags']['app_header'] = html::a_href(html::image('phpgwapi','first',lang('previous'),$options=' alt="<<"'),array(
# 'menuaction' => $this->view_menuaction,
# 'date' => date('Ymd',$this->first-$days*DAY_s),
# )) . ' &nbsp; <b>'.$GLOBALS['egw_info']['flags']['app_header'];
# // next week
# $GLOBALS['egw_info']['flags']['app_header'] .= '</b> &nbsp; '.html::a_href(html::image('phpgwapi','last',lang('next'),$options=' alt=">>"'),array(
# 'menuaction' => $this->view_menuaction,
# 'date' => date('Ymd',$this->last+$days*DAY_s),
# ));
#
# $class = $class == 'row_on' ? 'th' : 'row_on';
//echo "<p>weekdaystarts='".$this->cal_prefs['weekdaystarts']."', get_weekday_start($this->year,$this->month,$this->day)=".date('l Y-m-d',$wd_start).", first=".date('l Y-m-d',$this->first)."</p>\n";
$navHeader = '<div class="calendar_calWeek calendar_calWeekNavHeader">' $navHeader = '<div class="calendar_calWeek calendar_calWeekNavHeader">'
.html::a_href(html::image('phpgwapi','left',lang('previous'),$options=' alt="<<"'),array( .html::a_href(html::image('phpgwapi','left',lang('previous'),$options=' alt="<<"'),array(
'menuaction' => $this->view_menuaction, 'menuaction' => $this->view_menuaction,
'date' => date('Ymd',$this->first-$days*DAY_s), 'date' => date('Ymd', strtotime("-$days days",$this->first)),
)). '<span>'.$navHeader; )). '<span>'.$navHeader;
$navHeader = $navHeader.'</span>'.html::a_href(html::image('phpgwapi','right',lang('next'),$options=' alt=">>"'),array( $navHeader = $navHeader.'</span>'.html::a_href(html::image('phpgwapi','right',lang('next'),$options=' alt=">>"'),array(
'menuaction' => $this->view_menuaction, 'menuaction' => $this->view_menuaction,
'date' => date('Ymd',$this->last+$days*DAY_s), 'date' => date('Ymd', strtotime("+$days days",$this->last)),
)).'</div>'; )).'</div>';
$merge = $this->merge(); $merge = $this->merge();