From 57bc11d8de9362b04ec4b95e8ba09678c9230cc9 Mon Sep 17 00:00:00 2001 From: Miles Lott Date: Wed, 28 Mar 2001 04:49:31 +0000 Subject: [PATCH] Correct field choices for mainscreen_showbirthdays --- index.php | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/index.php b/index.php index cd2dae5668..fe3a22087d 100755 --- a/index.php +++ b/index.php @@ -157,24 +157,22 @@ if ($phpgw_info["user"]["apps"]["addressbook"] && $phpgw_info["user"]["preferences"]["addressbook"]["mainscreen_showbirthdays"]) { echo "\n"; - $phpgw->db->query("select a.owner,a.n_given,a.n_family,b.contact_name,b.contact_value from phpgw_addressbook as a, phpgw_addressbook_extra as b where " - . "b.contact_name='bday' and b.contact_value like '" . $phpgw->common->show_date(time(),"n/d") - . "/%' and (a.owner='" . $phpgw_info["user"]["account_id"] . "' or b.contact_name='access' and b.contact_value ='" - . "public')",__LINE__,__FILE__); + $phpgw->db->query("select owner,access,n_given,n_family,bday from phpgw_addressbook where bday like '" + . $phpgw->common->show_date(time(),"n/d")."/%'" + . " and owner='" . $phpgw_info["user"]["account_id"] . "' and access='public'",__LINE__,__FILE__); while ($phpgw->db->next_record()) { - echo "" . lang("Today is x's birthday!", $phpgw->db->f("ab_firstname") . " " - . $phpgw->db->f("ab_lastname")) . "\n"; + echo "" . lang("Today is x's birthday!", $phpgw->db->f("n_given") . " " + . $phpgw->db->f("n_family")) . "\n"; } $tomorrow = $phpgw->common->show_date(mktime(0,0,0, $phpgw->common->show_date(time(),"m"), $phpgw->common->show_date(time(),"d")+1, $phpgw->common->show_date(time(),"Y")),"n/d" ); - $phpgw->db->query("select a.owner,a.n_given,a.n_family,b.contact_name,b.contact_value from phpgw_addressbook as a, phpgw_addressbook_extra as b where " - . "b.contact_name='bday' and b.contact_value like '$tomorrow/%' and (a.owner='" - . $phpgw_info["user"]["account_id"] . "' or b.contact_name='access' and b.contact_value='public')",__LINE__,__FILE__); + $phpgw->db->query("select owner,access,n_given,n_family,bday from phpgw_addressbook where bday like '$tomorrow/%'" + . " and owner='" . $phpgw_info["user"]["account_id"] . "' and access='public'",__LINE__,__FILE__); while ($phpgw->db->next_record()) { - echo "" . lang("Tomorrow is x's birthday.", $phpgw->db->f("ab_firstname") . " " - . $phpgw->db->f("ab_lastname")) . "\n"; + echo "" . lang("Tomorrow is x's birthday.", $phpgw->db->f("n_given") . " " + . $phpgw->db->f("n_family")) . "\n"; } echo "\n"; }