A free open source IT asset/license management system
Add a warning well if the asset’s checkout is bonked
snipeda5bb6126a0f
diff --git a/resources/views/hardware/view.blade.php b/resources/views/hardware/view.blade.phpindex e256693006..5fcb17ea44 100755--- a/resources/views/hardware/view.blade.php+++ b/resources/views/hardware/view.blade.php@@ -220,6 +220,26 @@<!-- start side stats column --><x-page-column class="col-md-4 col-sm-12">++ @if ($asset->hasOrphanedAssignment())+ <x-well class="well-sm">+ <p class="text-danger" style="line-height: 20px;">+ <x-icon type="warning" class="text-danger"/> {{ trans('general.warning', ['warning' => trans('general.item_target_not_found_hard', ['item_type' => $asset->assignedType(), 'id' => $asset->assigned_to])]) }}+ </p>++ <form action="{{ route('asset.checkin.force', $asset) }}" method="POST" class="form-inline" style="display: inline;">+ {{ csrf_field() }}+ {{ method_field('POST') }}+ <button class="btn btn-sm btn-danger btn-block hidden-print" type="submit" data-tooltip="true" data-placement="top" data-title="{{ trans('general.force_checkin') }}">+ <x-icon type="checkin" class="fa-fw"/>+ {{ trans('general.force_checkin') }}+ </button>+ </form>++ </x-well>+ @endif++@if($asset->purchase_date || $asset->asset_eol_date || $asset->depreciated_date() || $asset->warranty_expires)<x-well class="well-sm">@if($asset->purchase_date && $asset->asset_eol_date)diff --git a/tests/Feature/Assets/Ui/ForceCheckinAssetTest.php b/tests/Feature/Assets/Ui/ForceCheckinAssetTest.phpindex 7275994c7d..341db449cc 100644--- a/tests/Feature/Assets/Ui/ForceCheckinAssetTest.php+++ b/tests/Feature/Assets/Ui/ForceCheckinAssetTest.php@@ -3,7 +3,6 @@namespace Tests\Feature\Assets\Ui;use App\Models\Asset;-use App\Models\Location;use App\Models\User;use Tests\TestCase;@@ -111,4 +110,3 @@ class ForceCheckinAssetTest extends TestCase->assertDontSeeText(trans('general.force_checkin'));}}-diff --git a/tests/Unit/Models/AssetOrphanedAssignmentTest.php b/tests/Unit/Models/AssetOrphanedAssignmentTest.phpindex 68989317b8..026cff2f4e 100644--- a/tests/Unit/Models/AssetOrphanedAssignmentTest.php+++ b/tests/Unit/Models/AssetOrphanedAssignmentTest.php@@ -97,4 +97,3 @@ class AssetOrphanedAssignmentTest extends TestCase$this->assertFalse($asset->hasOrphanedAssignment());}}-