Slight tweak to model name presenter

This commit is contained in:
snipe 2017-10-26 21:50:39 -07:00
parent a99e09e5e3
commit 6bcb55a129

View file

@ -45,9 +45,14 @@ class AssetModelPresenter extends Presenter
*/
public function modelName()
{
$name = $this->model->manufacturer->name.' '.$this->name;
$name = '';
if ($this->model->manufacturer) {
$name .= $this->model->manufacturer->name;
}
$name .= $this->name;
if ($this->model_number) {
$name .=" / ".$this->model_number;
$name .=" (#".$this->model_number.')';
}
return $name;
}