From 110b3a18f44057900d59deec777195d8f87fc25f Mon Sep 17 00:00:00 2001 From: skeeter Date: Sun, 25 Mar 2001 13:34:42 +0000 Subject: [PATCH] Fix for bug #411157 - Free/Busy and fullnames --- calendar/inc/class.calendar.inc.php | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/calendar/inc/class.calendar.inc.php b/calendar/inc/class.calendar.inc.php index d64328a563..163327dda2 100755 --- a/calendar/inc/class.calendar.inc.php +++ b/calendar/inc/class.calendar.inc.php @@ -132,6 +132,33 @@ class calendar extends calendar_ return (!!($this->rights & $needed) == True); } + function get_fullname($accountid) + { + global $phpgw; + + $account_id = get_account_id($accountid); + if($phpgw->accounts->exists($account_id) == False) + { + return False; + } + $db = $phpgw->db; + $db->query('SELECT account_lid,account_lastname,account_firstname FROM phpgw_accounts WHERE account_id='.$account_id,__LINE__,__FILE__); + if($db->num_rows()) + { + $db->next_record(); + $fullname = $db->f('account_lid'); + if($db->f('account_lastname') && $db->f('account_firstname')) + { ++ $fullname = $db->f('account_lastname').', '.$db->f('account_firstname'); + } + return $fullname; + } + else + { + return False; + } + } + function get_long_status($status_short) { switch ($status_short) @@ -1668,7 +1695,7 @@ class calendar extends calendar_ { $this->read_repeated_events($participants[$i]); $str .= ''; - $str .= ''.$phpgw->common->grab_owner_name($participants[$i]).''; + $str .= ''.$this->get_fullname($participants[$i]).''; $events = $this->get_sorted_by_date($date['raw'],$participants[$i]); if($this->sorted_events_matching == False) {