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:59:19 +00:00
parent 9949b618a9
commit 4153b3b0a4
2 changed files with 21 additions and 16 deletions

View File

@ -118,6 +118,8 @@ class addressbook_hooks
'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',
@ -133,6 +135,7 @@ class addressbook_hooks
'xmlrpc' => True,
'admin' => False,
);
}
$settings['no_auto_hide'] = array(
'type' => 'check',
'label' => 'Don\'t hide empty columns',

View File

@ -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<!-- Birthday info -->\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']);