diff --git a/app/Http/Controllers/Assets/AssetCheckinController.php b/app/Http/Controllers/Assets/AssetCheckinController.php index 657b02171..fd5cee30e 100644 --- a/app/Http/Controllers/Assets/AssetCheckinController.php +++ b/app/Http/Controllers/Assets/AssetCheckinController.php @@ -94,14 +94,18 @@ class AssetCheckinController extends Controller \Log::debug('Manually override the location IDs'); \Log::debug('Original Location ID: '.$asset->location_id); $asset->location_id = ''; - \Log::debug('New RTD Location ID: '.$asset->location_id); + \Log::debug('New Location ID: '.$asset->location_id); } $asset->location_id = $asset->rtd_location_id; if ($request->filled('location_id')) { \Log::debug('NEW Location ID: '.$request->get('location_id')); - $asset->location_id = e($request->get('location_id')); + $asset->location_id = $request->get('location_id'); + + if ($request->get('update_default_location') == 0){ + $asset->rtd_location_id = $request->get('location_id'); + } } $checkin_at = date('Y-m-d H:i:s'); diff --git a/resources/views/hardware/checkin.blade.php b/resources/views/hardware/checkin.blade.php index f7fe067c8..dd6237b1b 100755 --- a/resources/views/hardware/checkin.blade.php +++ b/resources/views/hardware/checkin.blade.php @@ -73,7 +73,7 @@ - @include ('partials.forms.edit.location-select', ['translated_name' => trans('general.location'), 'fieldname' => 'location_id', 'help_text' => ($asset->defaultLoc) ? 'You can choose to check this asset in to a location other than the default location of '.$asset->defaultLoc->name.' if one is set.' : null]) + @include ('partials.forms.edit.location-select', ['translated_name' => trans('general.location'), 'fieldname' => 'location_id', 'help_text' => ($asset->defaultLoc) ? 'You can choose to check this asset in to a location other than the default location of '.$asset->defaultLoc->name.' if one is set.' : null, 'hide_location_radio' => true])
diff --git a/resources/views/partials/forms/edit/location-select.blade.php b/resources/views/partials/forms/edit/location-select.blade.php index 719370fe7..c0ce9f9b8 100644 --- a/resources/views/partials/forms/edit/location-select.blade.php +++ b/resources/views/partials/forms/edit/location-select.blade.php @@ -30,6 +30,21 @@
@endif + @if (isset($hide_location_radio)) + +
+
+ + +
+
+ @endif