Small maintenance fixes

This commit is contained in:
snipe 2017-09-08 17:49:01 -07:00
parent fd515654ff
commit 81e358a01d
2 changed files with 6 additions and 2 deletions

View file

@ -145,7 +145,7 @@ class AssetMaintenancesController extends Controller
'completion_date' => $maintenance->completion_date, 'completion_date' => $maintenance->completion_date,
'user_id' => ($maintenance->admin) ? (string)link_to('/admin/users/'.$maintenance->admin->id.'/view', $maintenance->admin->fullName()) : '', 'user_id' => ($maintenance->admin) ? (string)link_to('/admin/users/'.$maintenance->admin->id.'/view', $maintenance->admin->fullName()) : '',
'actions' => $actions, 'actions' => $actions,
'companyName' => ($maintenance->asset->company) ? $maintenance->asset->company->name : '' 'companyName' => ($maintenance->asset && $maintenance->asset->company) ? $maintenance->asset->company->name : ''
); );
} }

View file

@ -536,7 +536,11 @@
@foreach ($asset->assetmaintenances as $assetMaintenance) @foreach ($asset->assetmaintenances as $assetMaintenance)
@if (is_null($assetMaintenance->deleted_at)) @if (is_null($assetMaintenance->deleted_at))
<tr> <tr>
<td><a href="{{ route('view/supplier', $assetMaintenance->supplier_id) }}">{{ $assetMaintenance->supplier->name }}</a></td> <td>
@if ($assetMaintenance->supplier)
<a href="{{ route('view/supplier', $assetMaintenance->supplier_id) }}">{{ $assetMaintenance->supplier->name }}</a>
@endif
</td>
<td>{{ $assetMaintenance->title }}</td> <td>{{ $assetMaintenance->title }}</td>
<td>{{ $assetMaintenance->asset_maintenance_type }}</td> <td>{{ $assetMaintenance->asset_maintenance_type }}</td>
<td>{{ $assetMaintenance->start_date }}</td> <td>{{ $assetMaintenance->start_date }}</td>