forked from extern/egroupware
display_fullname and get_account_name replace now an empty firstname with the lid and an empty lastname with group or user
This commit is contained in:
parent
3960fcc0ae
commit
335cef9104
@ -775,6 +775,9 @@
|
|||||||
}
|
}
|
||||||
$Ok = accounts_::get_account_name($accountid,$lid,$fname,$lname);
|
$Ok = accounts_::get_account_name($accountid,$lid,$fname,$lname);
|
||||||
|
|
||||||
|
if (empty($fname)) $fname = $lid;
|
||||||
|
if (empty($lname)) $lname = $this->get_type($accountid) == 'g' ? lang('Group') : lang('user');
|
||||||
|
|
||||||
$account_name[$account_id] = array(
|
$account_name[$account_id] = array(
|
||||||
'lid' => $lid,
|
'lid' => $lid,
|
||||||
'fname' => $fname,
|
'fname' => $fname,
|
||||||
|
@ -481,11 +481,12 @@
|
|||||||
/**
|
/**
|
||||||
* return the fullname of a user
|
* return the fullname of a user
|
||||||
*
|
*
|
||||||
* @param $lid account loginid
|
* @param $lid='' account loginid
|
||||||
* @param $firstname firstname
|
* @param $firstname='' firstname
|
||||||
* @param $lastname lastname
|
* @param $lastname='' lastname
|
||||||
|
* @param $accountid=0 id, to check if it's a user or group, otherwise the lid will be used
|
||||||
*/
|
*/
|
||||||
function display_fullname($lid = '', $firstname = '', $lastname = '')
|
function display_fullname($lid = '', $firstname = '', $lastname = '',$accountid=0)
|
||||||
{
|
{
|
||||||
if (! $lid && ! $firstname && ! $lastname)
|
if (! $lid && ! $firstname && ! $lastname)
|
||||||
{
|
{
|
||||||
@ -494,6 +495,12 @@
|
|||||||
$lastname = $GLOBALS['egw_info']['user']['lastname'];
|
$lastname = $GLOBALS['egw_info']['user']['lastname'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (empty($firstname)) $firstname = $lid;
|
||||||
|
if (empty($lastname))
|
||||||
|
{
|
||||||
|
$lastname = $GLOBALS['egw']->accounts->get_type($accountid ? $accountid : $lid) == 'g' ?
|
||||||
|
lang('Group') : lang('User');
|
||||||
|
}
|
||||||
$display = $GLOBALS['egw_info']['user']['preferences']['common']['account_display'];
|
$display = $GLOBALS['egw_info']['user']['preferences']['common']['account_display'];
|
||||||
|
|
||||||
if ($firstname && $lastname)
|
if ($firstname && $lastname)
|
||||||
@ -539,7 +546,8 @@
|
|||||||
function grab_owner_name($accountid = '')
|
function grab_owner_name($accountid = '')
|
||||||
{
|
{
|
||||||
$GLOBALS['egw']->accounts->get_account_name($accountid,$lid,$fname,$lname);
|
$GLOBALS['egw']->accounts->get_account_name($accountid,$lid,$fname,$lname);
|
||||||
return $this->display_fullname($lid,$fname,$lname);
|
|
||||||
|
return $this->display_fullname($lid,$fname,$lname,$accountid);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user