Fixed #8721 - duplicate asset tags in select list when asset has name
This commit is contained in:
parent
13ed6cde67
commit
e6ba4a423d
1 changed files with 10 additions and 10 deletions
|
@ -361,18 +361,13 @@ class AssetPresenter extends Presenter
|
|||
/**
|
||||
* Get Displayable Name
|
||||
* @return string
|
||||
*
|
||||
* @todo this should be factored out - it should be subsumed by fullName (below)
|
||||
*
|
||||
**/
|
||||
public function name()
|
||||
{
|
||||
|
||||
if (empty($this->model->name)) {
|
||||
if (isset($this->model->model)) {
|
||||
return $this->model->model->name.' ('.$this->model->asset_tag.')';
|
||||
}
|
||||
return $this->model->asset_tag;
|
||||
}
|
||||
return $this->model->name . ' (' . $this->model->asset_tag . ')';
|
||||
|
||||
return $this->fullName;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -382,13 +377,18 @@ class AssetPresenter extends Presenter
|
|||
public function fullName()
|
||||
{
|
||||
$str = '';
|
||||
|
||||
// Asset name
|
||||
if ($this->model->name) {
|
||||
$str .= $this->name;
|
||||
$str .= $this->model->name;
|
||||
}
|
||||
|
||||
// Asset tag
|
||||
if ($this->asset_tag) {
|
||||
$str .= ' ('.$this->model->asset_tag.')';
|
||||
}
|
||||
|
||||
// Asset Model name
|
||||
if ($this->model->model) {
|
||||
$str .= ' - '.$this->model->model->name;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue