mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
* Fix #29314 Add method getFullName * Update conferenceorboothattendee.class.php
This commit is contained in:
parent
b133d9386e
commit
5c3caa3f31
|
|
@ -1121,6 +1121,30 @@ class ConferenceOrBoothAttendee extends CommonObject
|
|||
|
||||
return CommonObject::commonReplaceThirdparty($dbs, $origin_id, $dest_id, $tables);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return full name ('name+' '+lastname)
|
||||
*
|
||||
* @param Translate $langs Language object for translation of civility (used only if option is 1)
|
||||
* @param int $option 0=No option
|
||||
* @param int $nameorder -1=Auto, 0=Lastname+Firstname, 1=Firstname+Lastname, 2=Firstname, 3=Firstname if defined else lastname, 4=Lastname, 5=Lastname if defined else firstname
|
||||
* @param int $maxlen Maximum length
|
||||
* @return string String with full name
|
||||
*/
|
||||
public function getFullName($langs, $option = 0, $nameorder = -1, $maxlen = 0)
|
||||
{
|
||||
$lastname = $this->lastname;
|
||||
$firstname = $this->firstname;
|
||||
if (empty($lastname)) {
|
||||
$lastname = (isset($this->lastname) ? $this->lastname : (isset($this->name) ? $this->name : (isset($this->nom) ? $this->nom : (isset($this->societe) ? $this->societe : (isset($this->company) ? $this->company : '')))));
|
||||
}
|
||||
|
||||
$ret = '';
|
||||
|
||||
$ret .= dolGetFirstLastname($firstname, $lastname, $nameorder);
|
||||
|
||||
return dol_trunc($ret, $maxlen);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user