diff --git a/calendar/inc/class.calendar_sql.inc.php b/calendar/inc/class.calendar_sql.inc.php index 650d89f892..0f72bef9b9 100755 --- a/calendar/inc/class.calendar_sql.inc.php +++ b/calendar/inc/class.calendar_sql.inc.php @@ -22,8 +22,6 @@ class calendar_ var $cal_event; var $today = Array('raw','day','month','year','full','dow','dm','bd'); - //this will be deleted once I delete the alternative mini-calendars - var $daysinweek = 7; function open($calendar='',$user='',$passwd='',$options='') { @@ -1255,7 +1253,7 @@ class calendar_ $str .= ''; - for($i=0;$i<$daysinweek;$i++) + for($i=0;$i<7;$i++) { $str .= ''.lang($days[$i]).''; } @@ -1265,7 +1263,7 @@ class calendar_ for($i=$weekstarttime;date('Ymd',$i)<=$monthend['full'];$i+=604800) { $str .= ''; - for($j=0;$j<$daysinweek;$j++) + for($j=0;$j<7;$j++) { $date = $this->localdates($i + ($j * 86400)); diff --git a/calendar/inc/footer.inc.php b/calendar/inc/footer.inc.php index acc65fcfaf..210abaff04 100644 --- a/calendar/inc/footer.inc.php +++ b/calendar/inc/footer.inc.php @@ -13,112 +13,156 @@ /* $Id$ */ - if (isset($friendly) && $friendly){ - $phpgw->common->phpgw_footer(); - $phpgw->common->phpgw_exit(); - } + if (isset($friendly) && $friendly) + { + $phpgw->common->phpgw_footer(); + $phpgw->common->phpgw_exit(); + } + + $p = CreateObject('phpgwapi.Template',$phpgw->calendar->template_dir); + + $templates = Array( + 'footer' => 'footer.tpl', + 'footer_column' => 'footer_column.tpl' + ); + + $p->set_file($templates); + + if ($phpgw->calendar->tempyear && $phpgw->calendar->tempmonth) + { + $m = $phpgw->calendar->tempmonth; + $y = $phpgw->calendar->tempyear; + } + else + { + $m = date('m'); + $y = date('Y'); + } + + $d_time = mktime(0,0,0,$m,1,$y); + $thisdate = date('Ymd', $d_time); + $y--; + + $str = ''; + + for ($i = 0; $i < 25; $i++) + { + $m++; + if ($m > 12) + { + $m = 1; + $y++; + } + $d = mktime(0,0,0,$m,1,$y); + $str .= ''."\n"; + } + + $var = Array( + 'action_url' => $phpgw->link('week.php','owner='.$owner), + 'form_name' => 'SelectWeek', + 'label' => lang('Week'), + 'form_label' => 'date', + 'form_onchange' => 'document.SelectWeek.submit()', + 'row' => $str, + 'go' => lang('Go!') + ); + + $p->set_var($var); + + $p->parse('output','footer_column',True); + + if ($phpgw->calendar->tempyear) + { + $y = $phpgw->calendar->tempyear; + } + else + { + $y = date('Y'); + } + $str = ''; + for ($i = ($y - 3); $i < ($y + 3); $i++) + { + $str .= '