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
This commit is contained in:
Ralf Becker 2009-06-15 13:48:09 +00:00
parent ea13efc0af
commit bacf86c1a8
2 changed files with 21 additions and 16 deletions

View File

@ -118,21 +118,24 @@ class addressbook_hooks
'xmlrpc' => True, 'xmlrpc' => True,
'admin' => False, 'admin' => False,
); );
$settings['mainscreen_showbirthdays'] = array( if ($GLOBALS['egw_info']['server']['hide_birthdays'] != 'yes')
'type' => 'select', {
'label' => 'Show birthday reminders on main screen', $settings['mainscreen_showbirthdays'] = array(
'name' => 'mainscreen_showbirthdays', 'type' => 'select',
'help' => 'Displays a remider for birthdays on the startpage (page you get when you enter eGroupWare or click on the homepage icon).', 'label' => 'Show birthday reminders on main screen',
'values' => array( 'name' => 'mainscreen_showbirthdays',
0 => lang('No'), 'help' => 'Displays a remider for birthdays on the startpage (page you get when you enter eGroupWare or click on the homepage icon).',
1 => lang('Yes, for today and tomorrow'), 'values' => array(
3 => lang('Yes, for the next three days'), 0 => lang('No'),
7 => lang('Yes, for the next week'), 1 => lang('Yes, for today and tomorrow'),
14=> lang('Yes, for the next two weeks'), 3 => lang('Yes, for the next three days'),
), 7 => lang('Yes, for the next week'),
'xmlrpc' => True, 14=> lang('Yes, for the next two weeks'),
'admin' => False, ),
); 'xmlrpc' => True,
'admin' => False,
);
}
$settings['no_auto_hide'] = array( $settings['no_auto_hide'] = array(
'type' => 'check', 'type' => 'check',
'label' => 'Don\'t hide empty columns', 'label' => 'Don\'t hide empty columns',

View File

@ -9,7 +9,8 @@
*/ */
if ($GLOBALS['egw_info']['user']['apps']['addressbook'] && 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<!-- Birthday info -->\n"; echo "\n<!-- Birthday info -->\n";
@ -74,6 +75,7 @@ if ($GLOBALS['egw_info']['user']['apps']['addressbook'] &&
break; break;
default: default:
list($y,$m,$d) = explode('-',$contact['bday']); 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, $text = lang("In %1 days (%2) is %3's birthday.",$n,
$GLOBALS['egw']->common->dateformatorder($y,$m,$d,true), $GLOBALS['egw']->common->dateformatorder($y,$m,$d,true),
$contact['n_given'].' '.$contact['n_family']); $contact['n_given'].' '.$contact['n_family']);