Removed getCompleteNameAttribute(), modified getFullNameAttribute()

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2023-08-21 20:11:17 +01:00
parent f3460b5a4f
commit 354550b52e

View file

@ -247,21 +247,12 @@ class User extends SnipeModel implements AuthenticatableContract, AuthorizableCo
*/ */
public function getFullNameAttribute() public function getFullNameAttribute()
{ {
return $this->first_name.' '.$this->last_name; $setting = Setting::getSettings();
}
/** if ($setting->name_display_format=='last_first') {
* Returns the complete name attribute with username return ($this->last_name) ? $this->last_name.' '.$this->first_name : $this->first_name;
* }
* @todo refactor this so it's less repetitive and dumb return $this->last_name ? $this->first_name.' '.$this->last_name : $this->first_name;
*
* @author A. Gianotto <snipe@snipe.net>
* @since [v2.0]
* @return string
*/
public function getCompleteNameAttribute()
{
return $this->last_name.', '.$this->first_name.' ('.$this->username.')';
} }