* * http://www.radix.net/~cknudsen * * Modified by Mark Peters * * -------------------------------------------- * * This program is free software; you can redistribute it and/or modify it * * under the terms of the GNU General Public License as published by the * * Free Software Foundation; either version 2 of the License, or (at your * * option) any later version. * \**************************************************************************/ /* $Id$ */ class uicalendar { var $template; var $template_dir; var $printer_friendly; var $owner; // var $contacts; var $bo; var $cat; var $prefs; var $holidays; var $holiday_color; var $debug = False; var $filter; var $cat_id; var $public_functions = array( 'mini_calendar' => True, 'index' => True, 'month' => True, 'week' => True, 'year' => True, 'view' => True, 'add' => True, 'edit' => True, 'delete' => True ); function uicalendar() { global $phpgw, $phpgw_info, $friendly; $phpgw->browser = CreateObject('phpgwapi.browser'); if($friendly == 1) { $this->printer_friendly = True; } else { $this->printer_friendly = False; } $this->bo = CreateObject('calendar.bocalendar',True); if(!isset($this->bo->year)) { $this->bo->year = date('Y',time()); } if(!isset($this->bo->month)) { $this->bo->month = date('m',time()); } if(!isset($this->bo->day)) { $this->bo->day = date('d',time()); } $this->owner = $this->bo->owner; $this->template = $phpgw->template; $this->template_dir = $phpgw->common->get_tpl_dir('calendar'); $this->cat = CreateObject('phpgwapi.categories'); $this->prefs = $phpgw_info['user']['preferences']['calendar']; $this->holiday_color = (substr($phpgw_info['theme']['bg07'],0,1)=='#'?'':'#').$phpgw_info['theme']['bg07']; $this->filter = $this->bo->filter; $this->cat_id = $this->bo->cat_id; $this->users_timeformat = $this->bo->users_timeformat; $this->save_sessiondata(); if($this->debug) { $this->_debug_sqsof(); } } /* Public functions */ function mini_calendar($day,$month,$year,$link='',$buttons="none",$outside_month=True) { global $phpgw, $phpgw_info; $this->bo->read_holiday(); $date = $this->bo->datetime->makegmttime(0,0,0,$month,$day,$year); $month_ago = intval(date('Ymd',mktime(0,0,0,$month - 1,$day,$year))); $month_ahead = intval(date('Ymd',mktime(0,0,0,$month + 1,$day,$year))); $monthstart = intval(date('Ymd',mktime(0,0,0,$month,1,$year))); $monthend = intval(date('Ymd',mktime(0,0,0,$month + 1,0,$year))); $weekstarttime = $this->bo->datetime->get_weekday_start($year,$month,1); $p = CreateObject('phpgwapi.Template',$this->template_dir); $p->set_unknowns('remove'); $templates = Array( 'mini_calendar' => 'mini_cal.tpl' ); $p->set_file($templates); $p->set_block('mini_calendar','mini_cal','mini_cal'); $p->set_block('mini_calendar','mini_week','mini_week'); $p->set_block('mini_calendar','mini_day','mini_day'); if($this->printer_friendly == False) { $month = '' . lang($phpgw->common->show_date($date['raw'],'F')).' '.$phpgw->common->show_date($date['raw'],'Y').''; } else { $month = lang($phpgw->common->show_date($date['raw'],'F')).' '.$phpgw->common->show_date($date['raw'],'Y'); } $var = Array( 'cal_img_root' => $phpgw->common->image('calendar','mini-calendar-bar.gif'), 'bgcolor' => $phpgw_info['theme']['bg_color'], 'bgcolor1' => $phpgw_info['theme']['bg_color'], 'month' => $month, 'bgcolor2' => $phpgw_info['theme']['cal_dayview'], 'holiday_color' => $this->holiday_color ); $p->set_var($var); switch(strtolower($buttons)) { case 'right': $var = Array( 'nextmonth' => '' ); break; case 'left': $var = Array( 'prevmonth' => '' ); break; case 'both': $var = Array( 'prevmonth' => '', 'nextmonth' => '' ); break; case 'none': default: $var = Array( 'prevmonth' => '', 'nextmonth' => '' ); break; } $p->set_var($var); for($i=0;$i<7;$i++) { $p->set_var('dayname','' . substr(lang($this->bo->datetime->days[$i]),0,2) . ''); $p->parse('daynames','mini_day',True); } $today = date('Ymd',time()); unset($date); for($i=$weekstarttime;date('Ymd',$i)<=$monthend;$i += (24 * 3600 * 7)) { unset($var); $daily = $this->bo->set_week_array($i,$cellcolor,$weekly); @reset($daily); while(list($date,$day_params) = each($daily)) { // echo 'Mini-Cal Date : '.$date."
\n"; $year = intval(substr($date,0,4)); $month = intval(substr($date,4,2)); $day = intval(substr($date,6,2)); $str = ''; if(($date >= $monthstart && $date <= $monthend) || $outside_month == True) { if(!$this->printer_friendly) { $str = ''.$day.''; } else { $str = $day; } } $var[] = Array( 'day_image' => $day_params['day_image'], 'dayname' => $str ); } for($l=0;$loutput_template_array($p,'monthweek_day','mini_day',$var[$l]); } $p->parse('display_monthweek','mini_week',True); $p->set_var('dayname',''); $p->set_var('monthweek_day',''); } $return_value = $p->fp('out','mini_cal'); unset($p); return $return_value; } function index() { global $phpgw; Header('Location: '. $this->page()); $phpgw->common->phpgw_exit(); } function month() { global $phpgw, $thismonth, $thisday, $thisyear; $this->bo->read_holiday(); $templates = Array( 'index_t' => 'index.tpl' ); $this->template->set_file($templates); $m = mktime(0,0,0,$this->bo->month,1,$this->bo->year); if ($this->printer_friendly == False) { $phpgw->common->phpgw_header(); echo parse_navbar(); $this->header(); $printer = ''; $param = '&year='.$this->bo->year.'&month='.$this->bo->month.'&friendly=1&filter='.$filter; $print = '[".lang('Printer Friendly').']'; $minical_prev = $this->mini_calendar(1,$this->bo->month - 1,$this->bo->year,'day'); $minical_next = $this->mini_calendar(1,$this->bo->month + 1,$this->bo->year,'day'); } else { $printer = ''; $print = ''; if($this->preferences['display_minicals'] == 'Y' || $this->preferences['display_minicals']) { $minical_prev = $this->mini_calendar(1,$this->bo->month - 1,$this->bo->year,'day'); $minical_next = $this->mini_calendar(1,$this->bo->month + 1,$this->bo->year,'day'); } else { $minical_prev = ''; $minical_next = ''; } } $var = Array( 'printer_friendly' => $printer, 'bg_text' => $phpgw_info['theme']['bg_text'], 'small_calendar_prev' => $minical_prev, 'month_identifier' => lang(strftime("%B",$m)) . ' ' . $this->bo->year, 'username' => $phpgw->common->grab_owner_name($this->owner), 'small_calendar_next' => $minical_next, 'large_month' => $this->display_month($this->bo->month,$this->bo->year,True,$this->owner), 'print' => $print ); $this->template->set_var($var); $this->template->pparse('out','index_t'); if($this->printer_friendly) { $phpgw->common->phpgw_exit(); } else { $this->footer(); } } function week() { global $phpgw, $phpgw_info; $next = $this->bo->datetime->makegmttime(0,0,0,$this->bo->month,$this->bo->day + 7,$this->bo->year); $prev = $this->bo->datetime->makegmttime(0,0,0,$this->bo->month,$this->bo->day - 7,$this->bo->year); $nextmonth = $this->bo->datetime->makegmttime(0,0,0,$this->bo->month + 1,1,$this->bo->year); $prevmonth = $this->bo->datetime->makegmttime(0,0,0,$this->bo->month - 1,1,$this->bo->year); $first = $this->bo->datetime->gmtdate($this->bo->datetime->get_weekday_start($this->bo->year, $this->bo->month, $this->bo->day)); $last = $this->bo->datetime->gmtdate($first['raw'] + 518400); // Week Label $week_id = lang(strftime("%B",$first['raw'])).' '.$first['day']; if($first['month'] <> $last['month'] && $first['year'] <> $last['year']) { $week_id .= ', '.$first['year']; } $week_id .= ' - '; if($first['month'] <> $last['month']) { $week_id .= lang(strftime("%B",$last['raw'])).' '; } $week_id .= $last['day'].', '.$last['year']; $p = CreateObject('phpgwapi.Template',$this->template_dir); $templates = Array( 'week_t' => 'week.tpl' ); $p->set_file($templates); if (!$this->printer_friendly) { $phpgw->common->phpgw_header(); echo parse_navbar(); $this->header(); $printer_header = ''; $prev_week_link = '<<'; $next_week_link = '>>'; $param = '&year='.$this->bo->year.'&month='.$this->bo->month.'&day='.$this->bo->day.'&friendly=1'; $printer_friendly = '[".lang('Printer Friendly').']'; $minical_this = $this->mini_calendar($this->bo->day,$this->bo->month,$this->bo->year,'day'); $minical_prev = $this->mini_calendar(1,$this->bo->month - 1,$this->bo->year,'day'); $minical_next = $this->mini_calendar(1,$this->bo->month + 1,$this->bo->year,'day'); } else { $printer_header = ''; $prev_week_link = '<<'; $next_week_link = '>>'; $printer_friendly = ''; if($this->prefs['display_minicals'] == 'Y' || $this->prefs['display_minicals']) { $minical_this = $this->mini_calendar($this->bo->day,$this->bo->month,$this->bo->year,'day'); $minical_prev = $this->mini_calendar(1,$this->bo->month - 1,$this->bo->year,'day'); $minical_next = $this->mini_calendar(1,$this->bo->month + 1,$this->bo->year,'day'); } else { $minical_this = ''; $minical_prev = ''; $minical_next = ''; } } $var = Array( 'printer_header' => $printer_header, 'bg_text' => $phpgw_info['themem']['bg_text'], 'small_calendar_prev' => $minical_prev, 'prev_week_link' => $prev_week_link, 'small_calendar_this' => $minical_this, 'week_identifier' => $week_id, 'next_week_link' => $next_week_link, 'username' => $phpgw->common->grab_owner_name($this->owner), 'small_calendar_next' => $minical_next, 'week_display' => $this->display_weekly($this->bo->day,$this->bo->month,$this->bo->year,true,$this->owner), 'printer_friendly' => $printer_friendly ); $p->set_var($var); $p->pparse('out','week_t'); flush(); if($this->printer_friendly) { $phpgw->common->phpgw_exit(); } else { $this->footer(); } } function year() { global $phpgw, $phpgw_info; if ($this->printer_friendly) { echo ''; } else { $phpgw->common->phpgw_header(); echo parse_navbar(); $this->header(); } ?>
printer_friendly) { echo 'printer_friendly) { echo 'printer_friendly) { $link = 'day.php'; } else { $link = ''; } for($i=1;$i<13;$i++) { echo ''; } } ?>
<<'; } ?> bo->year; ?> >>'; } ?>
'; echo $this->mini_calendar($i,$i,$this->bo->year,$link,'none',False); if($i % 3 == 0) { echo '
printer_friendly) { $phpgw->common->phpgw_exit(); } else { echo ' ['.lang('Printer Friendly').']'; $this->footer(); } } function view() { global $phpgw,$phpgw_info,$cal_id,$submit,$referer; $phpgw->common->phpgw_header(); echo parse_navbar(); $this->header(); // First, make sure they have permission to this entry if ($cal_id < 1) { echo lang('Invalid entry id.'); $phpgw->common->phpgw_footer(); $phpgw->common->phpgw_exit(); } if($this->bo->check_perms(PHPGW_ACL_READ) == False) { echo lang('You do not have permission to read this record!'); $phpgw->common->phpgw_footer(); $phpgw->common->phpgw_exit(); } $event = $this->bo->read_entry($cal_id); echo '
'; if(isset($event->id)) { echo $this->view_event($event); $thisyear = $event->start->year; $thismonth = $event->start->month; $thisday = $event->start->mday; $p = CreateObject('phpgwapi.Template',$this->template_dir); $templates = Array( 'form_button' => 'form_button_script.tpl' ); $p->set_file($templates); if ($this->owner == $event->owner && $this->bo->check_perms(PHPGW_ACL_EDIT) == True) { $var = Array( 'action_url_button' => $this->page('edit','&cal_id='.$cal_id), 'action_text_button' => lang('Edit'), 'action_confirm_button' => '', 'action_extra_field' => '' ); $p->set_var($var); echo $p->fp('out','form_button'); } if ($this->owner == $event->owner && $this->bo->check_perms(PHPGW_ACL_DELETE) == True) { $var = Array( 'action_url_button' => $this->page('delete','&cal_id='.$cal_id), 'action_text_button' => lang('Delete'), 'action_confirm_button' => "onClick=\"return confirm('".lang("Are you sure\\nyou want to\\ndelete this entry ?\\n\\nThis will delete\\nthis entry for all users.")."')\"", 'action_extra_field' => '' ); $p->set_var($var); echo $p->fp('out','form_button'); } } else { echo lang("Sorry, the owner has just deleted this event").'.'; } echo '
'; $this->footer(); } function edit() { global $phpgw, $phpgw_info, $cal_id, $readsess, $hour, $minute, $cd; $sb = CreateObject('phpgwapi.sbox'); if ($phpgw_info['user']['preferences']['common']['timeformat'] == '12') { $hourformat = 'h'; } else { $hourformat = 'H'; } if ($cal_id > 0) { $event = $this->bo->read_entry(intval($cal_id)); $can_edit = False; if(($event->owner == $this->owner) && ($this->bo->check_perms(PHPGW_ACL_EDIT) == True)) { if($event->public != True) { if($this->bo->check_perms(PHPGW_ACL_PRIVATE) == True) { $can_edit = True; } } else { $can_edit = True; } } if($can_edit == False) { header('Location: '.$this->page('view','&cal_id='.$cal_id)); } } elseif(isset($readsess)) { $event = unserialize(str_replace('O:8:"stdClass"','O:13:"calendar_time"',serialize($phpgw->session->appsession('entry','calendar')))); if($event->owner == 0) { $this->so->add_attribute('owner',$this->owner); } $can_edit = True; } else { if($this->bo->check_perms(PHPGW_ACL_ADD) == False) { header('Location: '.$this->page('view','&cal_id='.$cal_id)); } $this->so->event_init(); $this->so->add_attribute('id',0); $can_edit = True; if (!isset($hour)) { $thishour = 0; } else { $thishour = (int)$hour; } if (!isset($minute)) { $thisminute = 00; } else { $thisminute = (int)$minute; } $this->so->set_start($this->bo->year,$this->bo->month,$this->bo->day,$thishour,$thisminute,0); $this->so->set_end($this->bo->year,$this->bo->month,$this->bo->day,$thishour,$thisminute,0); $this->so->set_title(''); $this->so->set_description(''); $this->so->add_attribute('priority',2); if($this->preferences['default_private'] == 'Y' || $this->prefs['default_private'] == True) { $this->so->set_class(False); } else { $this->so->set_class(True); } $this->so->set_recur_none(); $event = $this->so->get_cached_event(); } $start = mktime($event->start->hour,$event->start->min,$event->start->sec,$event->start->month,$event->start->mday,$event->start->year) - $this->bo->datetime->tz_offset; $end = mktime($event->end->hour,$event->end->min,$event->end->sec,$event->end->month,$event->end->mday,$event->end->year) - $this->bo->datetime->tz_offset; $phpgw->common->phpgw_header(); echo parse_navbar(); $p = CreateObject('phpgwapi.Template',$this->template_dir); $templates = Array( 'edit' => 'edit.tpl', 'form_button' => 'form_button_script.tpl' ); $p->set_file($templates); $p->set_block('edit','edit_entry','edit_entry'); $p->set_block('edit','list','list'); $p->set_block('edit','hr','hr'); if($cal_id > 0) { $action = lang('Calendar - Edit'); } else { $action = lang('Calendar - Add'); } if($cd) { $errormsg = $phpgw->common->check_code($cd); } else { $errormsg = ''; } $common_hidden = ''."\n" . ''."\n"; $vars = Array( 'font' => $phpgw_info['theme']['font'], 'bg_color' => $phpgw_info['theme']['bg_text'], 'calendar_action' => $action, 'action_url' => $this->page('update'), 'common_hidden' => $common_hidden, 'errormsg' => $errormsg ); $p->set_var($vars); // Brief Description $var[] = Array( 'field' => lang('Title'), 'data' => '' ); // Full Description $var[] = Array( 'field' => lang('Full Description'), 'data' => '' ); // Display Categories $var[] = Array( 'field' => lang('Category'), 'data' => '' ); // Date $day_html = $sb->getDays('start[mday]',intval($phpgw->common->show_date($start,'d'))); $month_html = $sb->getMonthText('start[month]',intval($phpgw->common->show_date($start,'n'))); $year_html = $sb->getYears('start[year]',intval($phpgw->common->show_date($start,'Y')),intval($phpgw->common->show_date($start,'Y'))); $var[] = Array( 'field' => lang('Start Date'), 'data' => $phpgw->common->dateformatorder($year_html,$month_html,$day_html) ); // Time $amsel = ' checked'; $pmsel = ''; if ($phpgw_info['user']['preferences']['common']['timeformat'] == '12') { if ($event->start->hour >= 12) { $amsel = ''; $pmsel = ' checked'; } } $str = ':'; if ($phpgw_info['user']['preferences']['common']['timeformat'] == '12') { $str .= 'am'; $str .= 'pm'; } $var[] = Array( 'field' => lang('Start Time'), 'data' => $str ); // End Date $day_html = $sb->getDays('end[mday]',intval($phpgw->common->show_date($end,'d'))); $month_html = $sb->getMonthText('end[month]',intval($phpgw->common->show_date($end,'n'))); $year_html = $sb->getYears('end[year]',intval($phpgw->common->show_date($end,'Y')),intval($phpgw->common->show_date($end,'Y'))); $var[] = Array( 'field' => lang('End Date'), 'data' => $phpgw->common->dateformatorder($year_html,$month_html,$day_html) ); // End Time $amsel = ' checked'; $pmsel = ''; if ($phpgw_info['user']['preferences']['common']['timeformat'] == '12') { if ($event->end->hour >= 12) { $amsel = ''; $pmsel = ' checked'; } } $str = ':'; if ($phpgw_info['user']['preferences']['common']['timeformat'] == '12') { $str .= 'am'; $str .= 'pm'; } $var[] = Array( 'field' => lang("End Time"), 'data' => $str ); // Priority $var[] = Array( 'field' => lang('Priority'), 'data' => $sb->getPriority('priority',$event->priority) ); // Access $str = 'public != True) { $str .= ' checked'; } $str .= '>'; $var[] = Array( 'field' => lang('Private'), 'data' => $str ); function build_part_list(&$users,$accounts,$owner) { global $phpgw; if($accounts == False) { return; } while(list($index,$id) = each($accounts)) { if(intval($id) == $owner) { continue; } if(!isset($users[intval($id)])) { if($phpgw->accounts->exists(intval($id)) == True) { $users[intval($id)] = $phpgw->common->grab_owner_name(intval($id)); } if($phpgw->accounts->get_type(intval($id)) == 'g') { build_part_list($users,$phpgw->acl->get_ids_for_location(intval($id),1,'phpgw_group'),$owner); } } } } // Participants $accounts = $phpgw->acl->get_ids_for_location('run',1,'calendar'); $users = Array(); build_part_list($users,$accounts,$owner); while(list($key,$status) = each($event->participants)) { $parts[$key] = ' selected'; } $str = "\n".' '; $var[] = Array( 'field' => lang('Participants'), 'data' => $str ); // I Participate $str = ' 0) && isset($event->participants[$owner])) || !isset($id)) { $str .= ' checked'; } $str .= '>'; $var[] = Array( 'field' => $phpgw->common->grab_owner_name($owner).' '.lang('Participates'), 'data' => $str ); for($i=0;$ioutput_template_array($p,'row','list',$var[$i]); } unset($var); // Repeat Type $p->set_var('hr_text','
'); $p->parse('row','hr',True); $p->set_var('hr_text','
'.lang('Repeating Event Information').'

'); $p->parse('row','hr',True); $str = ''; $var[] = Array( 'field' => lang('Repeat Type'), 'data' => $str ); $str = 'recur_enddate->year != 0 && $event->recur_enddate->month != 0 && $event->recur_enddate->mday != 0) { $str .= ' checked'; $recur_end = mktime($event->recur_enddate->hour,$event->recur_enddate->min,$event->recur_enddate->sec,$event->recur_enddate->month,$event->recur_enddate->mday,$event->recur_enddate->year) - $this->bo->datetime->tz_offset; } else { $recur_end = mktime($event->start->hour,$event->start->min,$event->start->sec,$event->start->month,$event->start->mday,$event->start->year) + 86400 - $this->bo->datetime->tz_offset; } $str .= '>'.lang('Use End Date').' '; $day_html = $sb->getDays('recur_enddate[mday]',intval($phpgw->common->show_date($recur_end,'d'))); $month_html = $sb->getMonthText('recur_enddate[month]',intval($phpgw->common->show_date($recur_end,'n'))); $year_html = $sb->getYears('recur_enddate[year]',intval($phpgw->common->show_date($recur_end,'Y')),intval($phpgw->common->show_date($recur_end,'Y'))); $str .= $phpgw->common->dateformatorder($year_html,$month_html,$day_html); $var[] = Array( 'field' => lang('Repeat End Date'), 'data' => $str ); $str = 'recur_data & MCAL_M_SUNDAY) ?' checked':'').'> '.lang('Sunday').' '; $str .= 'recur_data & MCAL_M_MONDAY) ?' checked':'').'> '.lang('Monday').' '; $str .= 'recur_data & MCAL_M_TUESDAY) ?' checked':'').'> '.lang('Tuesday').' '; $str .= 'recur_data & MCAL_M_WEDNESDAY) ?' checked':'').'> '.lang('Wednesday').'
'; $str .= 'recur_data & MCAL_M_THURSDAY) ?' checked':'').'> '.lang('Thursday').' '; $str .= 'recur_data & MCAL_M_FRIDAY) ?' checked':'').'> '.lang('Friday').' '; $str .= 'recur_data & MCAL_M_SATURDAY) ?' checked':'').'> '.lang('Saturday').' '; $var[] = Array( 'field' => lang('Repeat Day').'
'.lang('(for weekly)'), 'data' => $str ); $var[] = Array( 'field' => lang('Frequency'), 'data' => '' ); for($i=0;$ioutput_template_array($p,'row','list',$var[$i]); } $p->set_var('submit_button',lang('Submit')); if ($cal_id > 0) { $action_url_button = $this->page('delete','&cal_id='.$cal_id); $action_text_button = lang('Delete'); $action_confirm_button = "onClick=\"return confirm('".lang("Are you sure\\nyou want to \\ndelete this entry?\\n\\nThis will delete\\nthis entry for all users.")."')\""; $var = Array( 'action_url_button' => $action_url_button, 'action_text_button' => $action_text_button, 'action_confirm_button' => $action_confirm_button, 'action_extra_field' => '' ); $p->set_var($var); $p->parse('delete_button','form_button'); } else { $p->set_var('delete_button',''); } $p->pparse('out','edit_entry'); $this->footer(); } /* Private functions */ function _debug_sqsof() { $data = array( 'filter' => $this->filter, 'cat_id' => $this->cat_id, 'owner' => $this->owner, 'year' => $this->bo->year, 'month' => $this->bo->month, 'day' => $this->bo->day ); echo '
UI:'; _debug_array($data); } /* Called only by get_list(), just prior to page footer. */ function save_sessiondata() { $data = array( 'filter' => $this->filter, 'cat_id' => $this->cat_id, 'owner' => $this->owner, 'year' => $this->bo->year, 'month' => $this->bo->month, 'day' => $this->bo->day ); $this->bo->save_sessiondata($data); } function output_template_array(&$p,$row,$list,$var) { $p->set_var($var); $p->parse($row,$list,True); } function page($page='',$params='') { global $phpgw, $phpgw_info; if($page == '') { $page_ = explode('.',$this->prefs['defaultcalendar']); $page = $page_[0]; if ($page=='index' || ($page != 'day' && $page != 'week' && $page != 'month' && $page != 'year')) { $page = 'month'; $phpgw->preferences->add('calendar','defaultcalendar','month'); $phpgw->preferences->save_repository(); } } return $phpgw->link('/index.php','menuaction='.$phpgw_info['flags']['currentapp'].'.ui'.$phpgw_info['flags']['currentapp'].'.'.$page.$params); } function header() { if (floor(phpversion()) == 4) { global $date, $year, $month, $day, $thisyear, $thismonth, $thisday, $filter, $keywords; global $matrixtype, $participants, $owner, $phpgw, $grants, $rights, $SCRIPT_FILENAME, $remainder, $tpl; } $cols = 8; if($this->bo->check_perms(PHPGW_ACL_PRIVATE) == True) { $cols++; } $tpl = CreateObject('phpgwapi.Template',$this->template_dir); $tpl->set_unknowns('remove'); include($this->template_dir.'/header.inc.php'); flush(); } function footer() { global $phpgw; if (@$this->printer_friendly) { $phpgw->common->phpgw_footer(); $phpgw->common->phpgw_exit(); } $p = CreateObject('phpgwapi.Template',$this->template_dir); $templates = Array( 'footer' => 'footer.tpl' ); $p->set_file($templates); $p->set_block('footer','footer_table','footer_table'); $p->set_block('footer','footer_row','footer_row'); $m = $this->bo->month; $y = $this->bo->year; $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' => $this->page('week',''), 'form_name' => 'SelectWeek', 'label' => lang('Week'), 'form_label' => 'date', 'form_onchange' => 'document.SelectWeek.submit()', 'row' => $str, 'go' => lang('Go!') ); $this->output_template_array($p,'table_row','footer_row',$var); $str = ''; for ($i = ($y - 3); $i < ($y + 3); $i++) { $str .= '