From 53d0d3d21fc42f05a53e387f71bc6604e2bdf133 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Tue, 1 May 2007 09:51:03 +0000 Subject: [PATCH] fix for bug #637: Birthday reminder on homepage not working properly --- addressbook/inc/hook_home.inc.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/addressbook/inc/hook_home.inc.php b/addressbook/inc/hook_home.inc.php index 261e267612..c96f4d1a4e 100644 --- a/addressbook/inc/hook_home.inc.php +++ b/addressbook/inc/hook_home.inc.php @@ -18,10 +18,10 @@ if ($GLOBALS['egw_info']['user']['apps']['addressbook'] && include_once(EGW_INCLUDE_ROOT.'/addressbook/inc/class.bocontacts.inc.php'); $contacts =& new bocontacts(); - $month_start = date('*-m-*',$contacts->now_su-$days*24*3600); + $month_start = date('*-m-*',$contacts->now_su); $bdays =& $contacts->search(array('bday' => $month_start),array('id','n_family','n_given','bday'),'n_given,n_family'); - - if (($month_end = date('*-m-*',$contacts->now_su)) != $month_start) + + if (($month_end = date('*-m-*',$contacts->now_su+$days*24*3600)) != $month_start) { if (($bdays2 =& $contacts->search(array('bday' => $month_start),array('id','n_family','n_given','bday'),'n_given,n_family'))) { @@ -64,6 +64,7 @@ if ($GLOBALS['egw_info']['user']['apps']['addressbook'] && { if(substr($contact['bday'],-6) == $day) { + if (!$ab_lang_loaded++) $GLOBALS['egw']->translation->add_app('addressbook'); switch($n) { case 0: @@ -81,7 +82,7 @@ if ($GLOBALS['egw_info']['user']['apps']['addressbook'] && } $portalbox->data[] = array( 'text' => $text, - 'link' => $GLOBALS['egw']->link('/index.php','menuaction=addressbook.uiaddressbook.view&ab_id=' . $contact['id']) + 'link' => $GLOBALS['egw']->link('/index.php','menuaction=addressbook.uicontacts.view&contact_id=' . $contact['id']) ); } }