From ece627b3a343f0884bcafd247bc5e850921f5bee Mon Sep 17 00:00:00 2001 From: snipe Date: Wed, 5 May 2021 10:23:46 -0700 Subject: [PATCH] Small fixes for location printing when relationships are missing/invalid, per #9521 Signed-off-by: snipe --- resources/views/locations/print.blade.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/resources/views/locations/print.blade.php b/resources/views/locations/print.blade.php index 3d20a6ce11..97fc15d958 100644 --- a/resources/views/locations/print.blade.php +++ b/resources/views/locations/print.blade.php @@ -84,11 +84,11 @@ {{ $counter }} - {{ $user->company->name }} - {{ $user->first_name }} {{ $user->last_name }} - {{ $user->employee_num }} - {{ $user->department->name }} - {{ $user->location->name }} + {{ (($user) && ($user->company)) ? $user->company->name : '' }} + {{ ($user) ? $user->first_name .' '. $user->last_name : '' }} + {{ ($user) ? $user->employee_num : '' }} + {{ (($user) && ($user->department)) ? $user->department->name : '' }} + {{ (($user) && ($user->location)) ? $user->location->name : '' }} @php $counter++ @@ -131,11 +131,11 @@ {{ $counter }} {{ $asset->asset_tag }} {{ $asset->name }} - {{ $asset->model->category->name }} - {{ $asset->model->manufacturer->name }} - {{ $asset->model->name }} {{ $asset->model->model_number }} - {{ $asset->serial }} - {{ $asset->location->name }} + {{ (($asset->model) && ($asset->model->category)) ? $asset->model->category->name : '' }} + {{ (($asset->model) && ($asset->model->manufacturer)) ? $asset->model->manufacturer->name : '' }} + {{ ($asset->model) ? $asset->model->name : '' }} + {{ $asset->serial }} + {{ $asset->location->name }} {{ $asset->last_checkout }} {{ $asset->expected_checkin }}