From 20edfad1a99f17956c4cd54020990138e1ce573d Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sat, 15 Feb 2003 20:52:18 +0000 Subject: [PATCH] corrected birthday check: a birthday of 12/x/y was shown on a date like 2/x/y --- addressbook/inc/hook_home.inc.php | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/addressbook/inc/hook_home.inc.php b/addressbook/inc/hook_home.inc.php index 0442e0a6af..8fe8dd5c6d 100644 --- a/addressbook/inc/hook_home.inc.php +++ b/addressbook/inc/hook_home.inc.php @@ -41,12 +41,15 @@ 'title' => lang('addressbook'))); while(list($key,$val) = @each($bdays)) { - $GLOBALS['phpgw']->portalbox->data[] = array - ( - 'text' => lang("Today is x's birthday!", $val['n_given'] . ' ' . $val['n_family']), - 'link' => $GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.view&ab_id=' . $val['id']), - 'lang_link_statustext' => lang('show contact') - ); + if (substr($val['bday'],0,strlen($today)) == $today) + { + $GLOBALS['phpgw']->portalbox->data[] = array + ( + 'text' => lang("Today is x's birthday!", $val['n_given'] . ' ' . $val['n_family']), + 'link' => $GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.view&ab_id=' . $val['id']), + 'lang_link_statustext' => lang('show contact') + ); + } } $tomorrow = $GLOBALS['phpgw']->common->show_date($now + 86400,'n/d/'); @@ -55,12 +58,15 @@ while(list($key,$val) = @each($bdays)) { - $GLOBALS['phpgw']->portalbox->data[] = array - ( - 'text' => lang("Tomorrow is x's birthday.", $val['n_given'] . ' ' . $val['n_family']), - 'link' => $GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.view&ab_id='.$val['id']), - 'lang_link_statustext' => lang('show contact') - ); + if (substr($val['bday'],0,strlen($tomorrow)) == $tomorrow) + { + $GLOBALS['phpgw']->portalbox->data[] = array + ( + 'text' => lang("Tomorrow is x's birthday.", $val['n_given'] . ' ' . $val['n_family']), + 'link' => $GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.view&ab_id='.$val['id']), + 'lang_link_statustext' => lang('show contact') + ); + } } $GLOBALS['phpgw']->portalbox->draw(); }