From 4153b3b0a4c40efda1584f7d2c7474a6ead94620 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Mon, 15 Jun 2009 13:59:19 +0000 Subject: [PATCH] Fixed display of birthdays from addressbook on home page: - dont display year, if calendar config forbidds to display of birthyear - dont display them at all, if they are forbidden in calendar --- .../inc/class.addressbook_hooks.inc.php | 33 ++++++++++--------- addressbook/inc/hook_home.inc.php | 4 ++- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/addressbook/inc/class.addressbook_hooks.inc.php b/addressbook/inc/class.addressbook_hooks.inc.php index 791a235875..ad5f630c3b 100644 --- a/addressbook/inc/class.addressbook_hooks.inc.php +++ b/addressbook/inc/class.addressbook_hooks.inc.php @@ -118,21 +118,24 @@ class addressbook_hooks 'xmlrpc' => True, 'admin' => False, ); - $settings['mainscreen_showbirthdays'] = array( - 'type' => 'select', - 'label' => 'Show birthday reminders on main screen', - 'name' => 'mainscreen_showbirthdays', - 'help' => 'Displays a remider for birthdays on the startpage (page you get when you enter eGroupWare or click on the homepage icon).', - 'values' => array( - 0 => lang('No'), - 1 => lang('Yes, for today and tomorrow'), - 3 => lang('Yes, for the next three days'), - 7 => lang('Yes, for the next week'), - 14=> lang('Yes, for the next two weeks'), - ), - 'xmlrpc' => True, - 'admin' => False, - ); + if ($GLOBALS['egw_info']['server']['hide_birthdays'] != 'yes') + { + $settings['mainscreen_showbirthdays'] = array( + 'type' => 'select', + 'label' => 'Show birthday reminders on main screen', + 'name' => 'mainscreen_showbirthdays', + 'help' => 'Displays a remider for birthdays on the startpage (page you get when you enter eGroupWare or click on the homepage icon).', + 'values' => array( + 0 => lang('No'), + 1 => lang('Yes, for today and tomorrow'), + 3 => lang('Yes, for the next three days'), + 7 => lang('Yes, for the next week'), + 14=> lang('Yes, for the next two weeks'), + ), + 'xmlrpc' => True, + 'admin' => False, + ); + } $settings['no_auto_hide'] = array( 'type' => 'check', 'label' => 'Don\'t hide empty columns', diff --git a/addressbook/inc/hook_home.inc.php b/addressbook/inc/hook_home.inc.php index abe1ddd6fe..3c44cd6236 100644 --- a/addressbook/inc/hook_home.inc.php +++ b/addressbook/inc/hook_home.inc.php @@ -9,7 +9,8 @@ */ if ($GLOBALS['egw_info']['user']['apps']['addressbook'] && - ($days = $GLOBALS['egw_info']['user']['preferences']['addressbook']['mainscreen_showbirthdays'])) + ($days = $GLOBALS['egw_info']['user']['preferences']['addressbook']['mainscreen_showbirthdays']) && + $GLOBALS['egw_info']['server']['hide_birthdays'] != 'yes') { echo "\n\n"; @@ -74,6 +75,7 @@ if ($GLOBALS['egw_info']['user']['apps']['addressbook'] && break; default: list($y,$m,$d) = explode('-',$contact['bday']); + if ($GLOBALS['egw_info']['server']['hide_birthdays'] == 'dateonly') $y = ''; $text = lang("In %1 days (%2) is %3's birthday.",$n, $GLOBALS['egw']->common->dateformatorder($y,$m,$d,true), $contact['n_given'].' '.$contact['n_family']);