From aab409dec22af87380a8444059db6800875618c8 Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 28 Sep 2017 22:22:21 -0700 Subject: [PATCH] Fixes #4061 - bulk checkout error --- app/Http/Controllers/AssetsController.php | 2 +- resources/views/hardware/bulk-checkout.blade.php | 3 ++- resources/views/partials/bootstrap-table.blade.php | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/AssetsController.php b/app/Http/Controllers/AssetsController.php index e7373105e7..ecaaa1d0d9 100755 --- a/app/Http/Controllers/AssetsController.php +++ b/app/Http/Controllers/AssetsController.php @@ -1230,7 +1230,7 @@ class AssetsController extends Controller foreach ($asset_ids as $asset_id) { $asset = Asset::find($asset_id); $this->authorize('checkout', $asset); - $error = $asset->checkOutToUser($user, $admin, $checkout_at, $expected_checkin, e(Input::get('note')), null); + $error = $asset->checkOut($user, $admin, $checkout_at, $expected_checkin, e(Input::get('note')), null); if ($error) { array_merge_recursive($errors, $asset->getErrors()->toArray()); diff --git a/resources/views/hardware/bulk-checkout.blade.php b/resources/views/hardware/bulk-checkout.blade.php index 00390274ee..766637df37 100644 --- a/resources/views/hardware/bulk-checkout.blade.php +++ b/resources/views/hardware/bulk-checkout.blade.php @@ -82,13 +82,14 @@ {!! $errors->first('selected_asset', ' :message') !!} - + + diff --git a/resources/views/partials/bootstrap-table.blade.php b/resources/views/partials/bootstrap-table.blade.php index d02d376aa8..0823a04a99 100644 --- a/resources/views/partials/bootstrap-table.blade.php +++ b/resources/views/partials/bootstrap-table.blade.php @@ -139,7 +139,7 @@ $('.snipe-table').bootstrapTable({ // Use this when we're introspecting into a column object and need to link function genericColumnObjLinkFormatter(destination) { return function (value,row) { - if (value.status_type) { + if ((value) && (value.status_type)) { return ' ' + value.name + ' ' + ''; } else if ((value) && (value.name)) { return ' ' + value.name + '';