From 9fe2a7f81d8ab04c3c8a3841fef1b0cc07923673 Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 12 Dec 2017 03:39:55 -0800 Subject: [PATCH 01/13] Removed duplicate log entry on asset creation --- app/Http/Controllers/AssetsController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/AssetsController.php b/app/Http/Controllers/AssetsController.php index a2598dca63..4fc6d8d2b4 100755 --- a/app/Http/Controllers/AssetsController.php +++ b/app/Http/Controllers/AssetsController.php @@ -219,7 +219,7 @@ class AssetsController extends Controller // Was the asset created? if ($asset->save()) { - $asset->logCreate(); + if (request('assigned_user')) { $target = User::find(request('assigned_user')); From 88ca852dcf65dcf2ac9335e726aa9aff33d8a444 Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 12 Dec 2017 03:40:04 -0800 Subject: [PATCH 02/13] Cleaned up asset observer --- app/Observers/AssetObserver.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/app/Observers/AssetObserver.php b/app/Observers/AssetObserver.php index 3066057d1c..6e2db974b0 100644 --- a/app/Observers/AssetObserver.php +++ b/app/Observers/AssetObserver.php @@ -18,8 +18,9 @@ class AssetObserver public function updating(Asset $asset) { - - if ((isset($asset->getOriginal()['assigned_to'])) && ($asset->getAttributes()['assigned_to'] == $asset->getOriginal()['assigned_to']) + // If the asset isn't being checked out or audited, log the update. + // (Those other actions already create log entries.) + if (($asset->getAttributes()['assigned_to'] == $asset->getOriginal()['assigned_to']) && ($asset->getAttributes()['next_audit_date'] == $asset->getOriginal()['next_audit_date']) && ($asset->getAttributes()['last_checkout'] == $asset->getOriginal()['last_checkout']) && ($asset->getAttributes()['status_id'] == $asset->getOriginal()['status_id'])) @@ -30,6 +31,13 @@ class AssetObserver $logAction->created_at = date("Y-m-d H:i:s"); $logAction->user_id = Auth::id(); $logAction->logaction('update'); + + } else { + \Log::debug('Something else happened'); + \Log::debug($asset->getOriginal()['assigned_to'].' == '.$asset->getAttributes()['assigned_to']); + \Log::debug($asset->getOriginal()['next_audit_date'].' == '.$asset->getAttributes()['next_audit_date']); + \Log::debug($asset->getOriginal()['last_checkout'].' == '.$asset->getAttributes()['last_checkout']); + \Log::debug($asset->getOriginal()['status_id'].' == '.$asset->getAttributes()['status_id']); } } From 1d543f83d4e1167e70882518509242bac8dfa82f Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 12 Dec 2017 04:31:53 -0800 Subject: [PATCH 03/13] Added line spacing between unstyled lists --- resources/views/hardware/view.blade.php | 43 +++++++++++++------------ 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/resources/views/hardware/view.blade.php b/resources/views/hardware/view.blade.php index 6ee49939d6..b222bb2555 100755 --- a/resources/views/hardware/view.blade.php +++ b/resources/views/hardware/view.blade.php @@ -143,29 +143,32 @@ {{ trans('admin/hardware/form.manufacturer') }} - @can('view', \App\Models\Manufacturer::class) - - {{ $asset->model->manufacturer->name }} - - @else - {{ $asset->model->manufacturer->name }} - @endcan + @endif @@ -426,7 +429,7 @@ {!! $asset->assignedTo->present()->glyph() . ' ' .$asset->assignedTo->present()->nameUrl() !!}

-