From 018cc879241fb7fa01657cd65388a3d9ba23a1f5 Mon Sep 17 00:00:00 2001 From: skeeter Date: Tue, 6 Nov 2001 01:49:16 +0000 Subject: [PATCH] Fix for bug #478418. --- calendar/inc/class.bopreferences.inc.php | 43 +++++++++++------------- calendar/inc/class.uipreferences.inc.php | 5 --- 2 files changed, 19 insertions(+), 29 deletions(-) diff --git a/calendar/inc/class.bopreferences.inc.php b/calendar/inc/class.bopreferences.inc.php index bcaede9478..cdd94f1394 100755 --- a/calendar/inc/class.bopreferences.inc.php +++ b/calendar/inc/class.bopreferences.inc.php @@ -25,73 +25,68 @@ function bopreferences() { - global $GLOBALS; - $GLOBALS['phpgw']->nextmatchs = CreateObject('phpgwapi.nextmatchs'); - $this->prefs['calendar'] = $GLOBALS['phpgw_info']['user']['preferences']['calendar']; } function preferences() { - global $GLOBALS, $HTTP_POST_VARS; - - if (isset($HTTP_POST_VARS['submit'])) + if (isset($GLOBALS['HTTP_POST_VARS']['submit'])) { $GLOBALS['phpgw']->preferences->read_repository(); - $GLOBALS['phpgw']->preferences->add('calendar','weekdaystarts',$HTTP_POST_VARS['prefs']['weekdaystarts']); - $GLOBALS['phpgw']->preferences->add('calendar','workdaystarts',intval($HTTP_POST_VARS['prefs']['workdaystarts'])); - $GLOBALS['phpgw']->preferences->add('calendar','workdayends',intval($HTTP_POST_VARS['prefs']['workdayends'])); - $GLOBALS['phpgw']->preferences->add('calendar','defaultcalendar',$HTTP_POST_VARS['prefs']['defaultcalendar']); - $GLOBALS['phpgw']->preferences->add('calendar','defaultfilter',$HTTP_POST_VARS['prefs']['defaultfilter']); - $GLOBALS['phpgw']->preferences->add('calendar','interval',intval($HTTP_POST_VARS['prefs']['interval'])); - if ($HTTP_POST_VARS['prefs']['mainscreen_showevents'] == True) + $GLOBALS['phpgw']->preferences->add('calendar','weekdaystarts',$GLOBALS['HTTP_POST_VARS']['prefs']['weekdaystarts']); + $GLOBALS['phpgw']->preferences->add('calendar','workdaystarts',intval($GLOBALS['HTTP_POST_VARS']['prefs']['workdaystarts'])); + $GLOBALS['phpgw']->preferences->add('calendar','workdayends',intval($GLOBALS['HTTP_POST_VARS']['prefs']['workdayends'])); + $GLOBALS['phpgw']->preferences->add('calendar','defaultcalendar',$GLOBALS['HTTP_POST_VARS']['prefs']['defaultcalendar']); + $GLOBALS['phpgw']->preferences->add('calendar','defaultfilter',$GLOBALS['HTTP_POST_VARS']['prefs']['defaultfilter']); + $GLOBALS['phpgw']->preferences->add('calendar','interval',intval($GLOBALS['HTTP_POST_VARS']['prefs']['interval'])); + if ($GLOBALS['HTTP_POST_VARS']['prefs']['mainscreen_showevents'] == True) { - $GLOBALS['phpgw']->preferences->add('calendar','mainscreen_showevents',$HTTP_POST_VARS['prefs']['mainscreen_showevents']); + $GLOBALS['phpgw']->preferences->add('calendar','mainscreen_showevents',$GLOBALS['HTTP_POST_VARS']['prefs']['mainscreen_showevents']); } else { $GLOBALS['phpgw']->preferences->delete('calendar','mainscreen_showevents'); } - if ($HTTP_POST_VARS['prefs']['send_updates'] == True) + if ($GLOBALS['HTTP_POST_VARS']['prefs']['send_updates'] == True) { - $GLOBALS['phpgw']->preferences->add('calendar','send_updates',$HTTP_POST_VARS['prefs']['send_updates']); + $GLOBALS['phpgw']->preferences->add('calendar','send_updates',$GLOBALS['HTTP_POST_VARS']['prefs']['send_updates']); } else { $GLOBALS['phpgw']->preferences->delete('calendar','send_updates'); } - if ($HTTP_POST_VARS['prefs']['display_status'] == True) + if ($GLOBALS['HTTP_POST_VARS']['prefs']['display_status'] == True) { - $GLOBALS['phpgw']->preferences->add('calendar','display_status',$HTTP_POST_VARS['prefs']['display_status']); + $GLOBALS['phpgw']->preferences->add('calendar','display_status',$GLOBALS['HTTP_POST_VARS']['prefs']['display_status']); } else { $GLOBALS['phpgw']->preferences->delete('calendar','display_status'); } - if ($HTTP_POST_VARS['prefs']['default_private'] == True) + if ($GLOBALS['HTTP_POST_VARS']['prefs']['default_private'] == True) { - $GLOBALS['phpgw']->preferences->add('calendar','default_private',$HTTP_POST_VARS['prefs']['default_private']); + $GLOBALS['phpgw']->preferences->add('calendar','default_private',$GLOBALS['HTTP_POST_VARS']['prefs']['default_private']); } else { $GLOBALS['phpgw']->preferences->delete('calendar','default_private'); } - if ($HTTP_POST_VARS['prefs']['display_minicals'] == True) + if ($GLOBALS['HTTP_POST_VARS']['prefs']['display_minicals'] == True) { - $GLOBALS['phpgw']->preferences->add('calendar','display_minicals',$HTTP_POST_VARS['prefs']['display_minicals']); + $GLOBALS['phpgw']->preferences->add('calendar','display_minicals',$GLOBALS['HTTP_POST_VARS']['prefs']['display_minicals']); } else { $GLOBALS['phpgw']->preferences->delete('calendar','display_minicals'); } - if ($HTTP_POST_VARS['prefs']['print_black_white'] == True) + if ($GLOBALS['HTTP_POST_VARS']['prefs']['print_black_white'] == True) { - $GLOBALS['phpgw']->preferences->add('calendar','print_black_white',$HTTP_POST_VARS['prefs']['print_black_white']); + $GLOBALS['phpgw']->preferences->add('calendar','print_black_white',$GLOBALS['HTTP_POST_VARS']['prefs']['print_black_white']); } else { diff --git a/calendar/inc/class.uipreferences.inc.php b/calendar/inc/class.uipreferences.inc.php index a034b5c934..f101cb3536 100755 --- a/calendar/inc/class.uipreferences.inc.php +++ b/calendar/inc/class.uipreferences.inc.php @@ -32,8 +32,6 @@ function uipreferences() { - global $GLOBALS; - $GLOBALS['phpgw']->nextmatchs = CreateObject('phpgwapi.nextmatchs'); $this->template = $GLOBALS['phpgw']->template; $this->theme = $GLOBALS['phpgw_info']['theme']; @@ -42,8 +40,6 @@ function preferences() { - global $GLOBALS; - unset($GLOBALS['phpgw_info']['flags']['noheader']); unset($GLOBALS['phpgw_info']['flags']['nonavbar']); $GLOBALS['phpgw_info']['flags']['noappheader'] = True; @@ -169,7 +165,6 @@ function display_item($field,$data) { - global $GLOBALS; static $tr_color; $tr_color = $GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color); $var = Array(