From 9325c7c46dd69a31071566b5af55d7cbf6f0f867 Mon Sep 17 00:00:00 2001 From: skeeter Date: Fri, 29 Jun 2001 10:45:17 +0000 Subject: [PATCH] This is for feature request #414427. This adds a preference for printing in black & white. --- calendar/inc/class.calendar.inc.php | 14 +++++++++++++- calendar/preferences.php | 13 +++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/calendar/inc/class.calendar.inc.php b/calendar/inc/class.calendar.inc.php index aa7adaf4ac..ba2f7182b8 100755 --- a/calendar/inc/class.calendar.inc.php +++ b/calendar/inc/class.calendar.inc.php @@ -1003,11 +1003,19 @@ class calendar extends calendar_ $p->set_file($templates); $p->set_block('month_header','monthly_header','monthly_header'); $p->set_block('month_header','column_title','column_title'); - + $var = Array( 'bgcolor' => $phpgw_info['theme']['th_bg'], '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('col_width','14'); @@ -1118,6 +1126,10 @@ class calendar extends calendar_ else { $day_number = $day; + if(@$phpgw_info['user']['preferences']['calendar']['print_black_white']) + { + $extra = ''; + } } $var = Array( diff --git a/calendar/preferences.php b/calendar/preferences.php index 46cff97d4d..8701ad53a2 100644 --- a/calendar/preferences.php +++ b/calendar/preferences.php @@ -75,6 +75,16 @@ { $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); Header('Location: '.$phpgw->link('/preferences/index.php')); @@ -221,6 +231,9 @@ $str = ''; display_item(lang('Display mini calendars when printing'),$str); + $str = ''; + display_item(lang('Print calendars in black & white'),$str); + $p->pparse('out','pref'); $phpgw->common->phpgw_footer(); ?>