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
|
* Get Displayable Name
|
||||||
* @return string
|
* @return string
|
||||||
|
*
|
||||||
|
* @todo this should be factored out - it should be subsumed by fullName (below)
|
||||||
|
*
|
||||||
**/
|
**/
|
||||||
public function name()
|
public function name()
|
||||||
{
|
{
|
||||||
|
return $this->fullName;
|
||||||
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 . ')';
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -382,13 +377,18 @@ class AssetPresenter extends Presenter
|
||||||
public function fullName()
|
public function fullName()
|
||||||
{
|
{
|
||||||
$str = '';
|
$str = '';
|
||||||
|
|
||||||
|
// Asset name
|
||||||
if ($this->model->name) {
|
if ($this->model->name) {
|
||||||
$str .= $this->name;
|
$str .= $this->model->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Asset tag
|
||||||
if ($this->asset_tag) {
|
if ($this->asset_tag) {
|
||||||
$str .= ' ('.$this->model->asset_tag.')';
|
$str .= ' ('.$this->model->asset_tag.')';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Asset Model name
|
||||||
if ($this->model->model) {
|
if ($this->model->model) {
|
||||||
$str .= ' - '.$this->model->model->name;
|
$str .= ' - '.$this->model->model->name;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue