'calendar',
'enable_nextmatchs_class' => True,
'noheader' => True,
'nonavbar' => True,
'noappheader' => True,
'noappfooter' => True
);
$phpgw_info['flags'] = $phpgw_flags;
include('../header.inc.php');
if ($submit)
{
$phpgw->preferences->read_repository();
$phpgw->preferences->add('calendar','weekdaystarts');
$phpgw->preferences->add('calendar','workdaystarts');
$phpgw->preferences->add('calendar','workdayends');
$phpgw->preferences->add('calendar','defaultcalendar');
$phpgw->preferences->add('calendar','defaultfilter');
$phpgw->preferences->add('calendar','locale');
if ($mainscreen_showevents == True)
{
$phpgw->preferences->add('calendar','mainscreen_showevents');
}
else
{
$phpgw->preferences->delete('calendar','mainscreen_showevents');
}
if ($send_updates == True)
{
$phpgw->preferences->add('calendar','send_updates');
}
else
{
$phpgw->preferences->delete('calendar','send_updates');
}
if ($display_status == True)
{
$phpgw->preferences->add('calendar','display_status');
}
else
{
$phpgw->preferences->delete('calendar','display_status');
}
if ($default_private == True)
{
$phpgw->preferences->add('calendar','default_private');
}
else
{
$phpgw->preferences->delete('calendar','default_private');
}
if ($display_minicals == True)
{
$phpgw->preferences->add('calendar','display_minicals');
}
else
{
$phpgw->preferences->delete('calendar','display_minicals');
}
$phpgw->preferences->save_repository(True);
Header('Location: '.$phpgw->link('/preferences/index.php'));
$phpgw->common->phpgw_exit();
}
function display_item($field,$data)
{
global $phpgw, $p, $tr_color;
$tr_color = $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);
}
$phpgw->common->phpgw_header();
echo parse_navbar();
$p = CreateObject('phpgwapi.Template',$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' => $phpgw->link('/'.$phpgw_info['flags']['currentapp'].'/preferences.php'),
'bg_color' => $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 '
' . $phpgw->common->error_list($errors) . '';
// }
$str = '';
display_item(lang('show day view on main screen'),$str);
$t_weekday[$phpgw_info['user']['preferences']['calendar']['weekdaystarts']] = ' selected';
$str = '';
display_item(lang('weekday starts on'),$str);
$t_workdaystarts[$phpgw_info['user']['preferences']['calendar']['workdaystarts']] = ' selected';
$str = '';
display_item(lang('work day starts on'),$str);
$t_workdayends[$phpgw_info['user']['preferences']['calendar']['workdayends']] = ' selected';
$str = '';
display_item(lang('work day ends on'),$str);
$selected[$phpgw_info['user']['preferences']['calendar']['defaultcalendar']] = ' selected';
if (!isset($phpgw_info['user']['preferences']['calendar']['defaultcalendar']))
{
$selected['month.php'] = ' selected';
}
$str = '';
display_item(lang('default calendar view'),$str);
$selected = array();
$selected[$phpgw_info['user']['preferences']['calendar']['defaultfilter']] = ' selected';
if (! isset($phpgw_info['user']['preferences']['calendar']['defaultfilter']) || $phpgw_info['user']['preferences']['calendar']['defaultfilter'] == 'private')
{
$selected['private'] = ' selected';
}
$str = '';
display_item(lang('Default calendar filter'),$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);
$country = CreateObject('phpgwapi.country');
display_item(lang('Select country for including holidays'),$country->form_select($phpgw_info['user']['preferences']['calendar']['locale'],'locale'));
$p->pparse('out','pref');
$phpgw->common->phpgw_footer();
?>