'calendar',
'enable_nextmatchs_class' => True,
'noheader' => True,
'nonavbar' => True,
'noappheader' => True,
'noappfooter' => True
);
$GLOBALS['phpgw_info']['flags'] = $GLOBALS['phpgw']_flags;
include('../header.inc.php');
if ($submit)
{
$GLOBALS['phpgw']->preferences->read_repository();
$GLOBALS['phpgw']->preferences->add('calendar','weekdaystarts');
$GLOBALS['phpgw']->preferences->add('calendar','workdaystarts');
$GLOBALS['phpgw']->preferences->add('calendar','workdayends');
$GLOBALS['phpgw']->preferences->add('calendar','defaultcalendar');
$GLOBALS['phpgw']->preferences->add('calendar','defaultfilter');
$GLOBALS['phpgw']->preferences->add('calendar','interval');
if ($mainscreen_showevents == True)
{
$GLOBALS['phpgw']->preferences->add('calendar','mainscreen_showevents');
}
else
{
$GLOBALS['phpgw']->preferences->delete('calendar','mainscreen_showevents');
}
if ($send_updates == True)
{
$GLOBALS['phpgw']->preferences->add('calendar','send_updates');
}
else
{
$GLOBALS['phpgw']->preferences->delete('calendar','send_updates');
}
if ($display_status == True)
{
$GLOBALS['phpgw']->preferences->add('calendar','display_status');
}
else
{
$GLOBALS['phpgw']->preferences->delete('calendar','display_status');
}
if ($default_private == True)
{
$GLOBALS['phpgw']->preferences->add('calendar','default_private');
}
else
{
$GLOBALS['phpgw']->preferences->delete('calendar','default_private');
}
if ($display_minicals == True)
{
$GLOBALS['phpgw']->preferences->add('calendar','display_minicals');
}
else
{
$GLOBALS['phpgw']->preferences->delete('calendar','display_minicals');
}
if ($print_black_white == True)
{
$GLOBALS['phpgw']->preferences->add('calendar','print_black_white');
}
else
{
$GLOBALS['phpgw']->preferences->delete('calendar','print_black_white');
}
$GLOBALS['phpgw']->preferences->save_repository(True);
Header('Location: '.$GLOBALS['phpgw']->link('/preferences/index.php'));
$GLOBALS['phpgw']->common->phpgw_exit();
}
function display_item($field,$data)
{
global $GLOBALS['phpgw'], $p, $tr_color;
$tr_color = $GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
$var = Array(
'bg_color' => $tr_color,
'field' => $field,
'data' => $data
);
$p->set_var($var);
$p->parse('row','pref_list',True);
}
$GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar();
$p = CreateObject('phpgwapi.Template',$GLOBALS['phpgw']->common->get_tpl_dir('calendar'));
$templates = Array(
'pref' => 'pref.tpl',
'pref_colspan' => 'pref_colspan.tpl',
'pref_list' => 'pref_list.tpl'
);
$p->set_file($templates);
$var = Array(
'title' => lang('Calendar preferences'),
'action_url' => $GLOBALS['phpgw']->link('/'.$GLOBALS['phpgw_info']['flags']['currentapp'].'/preferences.php'),
'bg_color' => $GLOBALS['phpgw_info']['theme']['th_bg'],
'submit_lang' => lang('submit')
);
$p->set_var($var);
$p->set_var('text',' ');
$p->parse('row','pref_colspan',True);
// if ($totalerrors)
// {
// echo '
' . $GLOBALS['phpgw']->common->error_list($errors) . '';
// }
$str = '';
display_item(lang('show day view on main screen'),$str);
$t_weekday[$GLOBALS['phpgw_info']['user']['preferences']['calendar']['weekdaystarts']] = ' selected';
$str = '';
display_item(lang('weekday starts on'),$str);
$t_workdaystarts[$GLOBALS['phpgw_info']['user']['preferences']['calendar']['workdaystarts']] = ' selected';
$str = '';
display_item(lang('work day starts on'),$str);
$t_workdayends[$GLOBALS['phpgw_info']['user']['preferences']['calendar']['workdayends']] = ' selected';
$str = '';
display_item(lang('work day ends on'),$str);
$selected[$GLOBALS['phpgw_info']['user']['preferences']['calendar']['defaultcalendar']] = ' selected';
if (!isset($GLOBALS['phpgw_info']['user']['preferences']['calendar']['defaultcalendar']))
{
$selected['month.php'] = ' selected';
}
$str = '';
display_item(lang('default calendar view'),$str);
$selected = array();
$selected[$GLOBALS['phpgw_info']['user']['preferences']['calendar']['defaultfilter']] = ' selected';
if (! isset($GLOBALS['phpgw_info']['user']['preferences']['calendar']['defaultfilter']) || $GLOBALS['phpgw_info']['user']['preferences']['calendar']['defaultfilter'] == 'private')
{
$selected['private'] = ' selected';
}
$str = '';
display_item(lang('Default calendar filter'),$str);
$selected = array();
$selected[intval($GLOBALS['phpgw_info']['user']['preferences']['calendar']['interval'])] = ' selected';
if (! isset($GLOBALS['phpgw_info']['user']['preferences']['calendar']['interval']))
{
$selected[60] = ' selected';
}
$var = Array(
5 => '5',
10 => '10',
15 => '15',
20 => '20',
30 => '30',
45 => '45',
60 => '60'
);
$str = '';
display_item(lang('Display interval in Day View'),$str);
$str = '';
display_item(lang('Send/receive updates via email'),$str);
$str = '';
display_item(lang('Display status of events'),$str);
$str = '';
display_item(lang('When creating new events default set to private'),$str);
$str = '';
display_item(lang('Display mini calendars when printing'),$str);
$str = '';
display_item(lang('Print calendars in black & white'),$str);
$p->pparse('out','pref');
$GLOBALS['phpgw']->common->phpgw_footer();
?>