From 3991f79115a41d34ba8a403ce5bb972ca039fd12 Mon Sep 17 00:00:00 2001 From: snipe Date: Sat, 28 Oct 2017 02:37:59 -0700 Subject: [PATCH] Use new location method for hardware view --- app/Http/Controllers/AssetsController.php | 4 ++-- resources/views/hardware/view.blade.php | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/app/Http/Controllers/AssetsController.php b/app/Http/Controllers/AssetsController.php index ed5650201e..4af0d0cfcd 100755 --- a/app/Http/Controllers/AssetsController.php +++ b/app/Http/Controllers/AssetsController.php @@ -594,8 +594,8 @@ class AssetsController extends Controller if (isset($asset)) { - if (!is_null($asset->assetloc)) { - $use_currency = $asset->assetloc->currency; + if ($asset->location) { + $use_currency = $asset->location->currency; } else { if ($settings->default_currency!='') { $use_currency = $settings->default_currency; diff --git a/resources/views/hardware/view.blade.php b/resources/views/hardware/view.blade.php index 6ae1746fbf..9e40dc1c84 100755 --- a/resources/views/hardware/view.blade.php +++ b/resources/views/hardware/view.blade.php @@ -224,10 +224,10 @@ {{ trans('admin/hardware/form.cost') }} - @if (($asset->id) && ($asset->userloc)) - {{ $asset->userloc->currency }} - @elseif (($asset->id) && ($asset->assetloc)) - {{ $asset->assetloc->currency }} + @if (($asset->id) && ($asset->location)) + {{ $asset->location->currency }} + @elseif (($asset->id) && ($asset->location)) + {{ $asset->location->currency }} @else {{ $snipeSettings->default_currency }} @endif @@ -335,16 +335,16 @@ {!! nl2br(e($asset->notes)) !!} - @if ($asset->assetloc) + @if ($asset->location) {{ trans('general.location') }} @can('superuser') - - {{ $asset->assetloc->name }} + + {{ $asset->location->name }} @else - {{ $asset->assetloc->name }} + {{ $asset->location->name }} @endcan