This is for feature request #414427. This adds a preference for printing in black & white.

This commit is contained in:
skeeter 2001-06-29 10:45:17 +00:00
parent cdd707d2ea
commit 9325c7c46d
2 changed files with 26 additions and 1 deletions

View File

@ -1003,11 +1003,19 @@ class calendar extends calendar_
$p->set_file($templates); $p->set_file($templates);
$p->set_block('month_header','monthly_header','monthly_header'); $p->set_block('month_header','monthly_header','monthly_header');
$p->set_block('month_header','column_title','column_title'); $p->set_block('month_header','column_title','column_title');
$var = Array( $var = Array(
'bgcolor' => $phpgw_info['theme']['th_bg'], 'bgcolor' => $phpgw_info['theme']['th_bg'],
'font_color' => $phpgw_info['theme']['th_text'] 'font_color' => $phpgw_info['theme']['th_text']
); );
if($this->printer_friendly && @$phpgw_info['user']['preferences']['calendar']['print_black_white'])
{
$var = Array(
'bgcolor' => '',
'font_color' => ''
);
}
$p->set_var($var); $p->set_var($var);
$p->set_var('col_width','14'); $p->set_var('col_width','14');
@ -1118,6 +1126,10 @@ class calendar extends calendar_
else else
{ {
$day_number = $day; $day_number = $day;
if(@$phpgw_info['user']['preferences']['calendar']['print_black_white'])
{
$extra = '';
}
} }
$var = Array( $var = Array(

View File

@ -75,6 +75,16 @@
{ {
$phpgw->preferences->delete('calendar','display_minicals'); $phpgw->preferences->delete('calendar','display_minicals');
} }
if ($print_black_white == True)
{
$phpgw->preferences->add('calendar','print_black_white');
}
else
{
$phpgw->preferences->delete('calendar','print_black_white');
}
$phpgw->preferences->save_repository(True); $phpgw->preferences->save_repository(True);
Header('Location: '.$phpgw->link('/preferences/index.php')); Header('Location: '.$phpgw->link('/preferences/index.php'));
@ -221,6 +231,9 @@
$str = '<input type="checkbox" name="display_minicals" value="True"'.($phpgw_info['user']['preferences']['calendar']['display_minicals'] == 'Y' || $phpgw_info['user']['preferences']['calendar']['display_minicals'] == True?' checked':'').'>'; $str = '<input type="checkbox" name="display_minicals" value="True"'.($phpgw_info['user']['preferences']['calendar']['display_minicals'] == 'Y' || $phpgw_info['user']['preferences']['calendar']['display_minicals'] == True?' checked':'').'>';
display_item(lang('Display mini calendars when printing'),$str); display_item(lang('Display mini calendars when printing'),$str);
$str = '<input type="checkbox" name="print_black_white" value="True"'.($phpgw_info['user']['preferences']['calendar']['print_black_white'] == 'Y' || $phpgw_info['user']['preferences']['calendar']['print_black_white'] == True?' checked':'').'>';
display_item(lang('Print calendars in black & white'),$str);
$p->pparse('out','pref'); $p->pparse('out','pref');
$phpgw->common->phpgw_footer(); $phpgw->common->phpgw_footer();
?> ?>