From f5122b01b11e04292259fcb56194e7f3b6603914 Mon Sep 17 00:00:00 2001 From: akemidx Date: Tue, 4 Apr 2023 15:51:04 -0400 Subject: [PATCH 1/3] Mock Up of the Buttons --- resources/views/hardware/view.blade.php | 70 +++++++++++++++++++++++-- 1 file changed, 66 insertions(+), 4 deletions(-) diff --git a/resources/views/hardware/view.blade.php b/resources/views/hardware/view.blade.php index e5fc43b613..584d70311b 100755 --- a/resources/views/hardware/view.blade.php +++ b/resources/views/hardware/view.blade.php @@ -864,15 +864,74 @@
@if (($asset->image) || (($asset->model) && ($asset->model->image!=''))) - - + @else + @endif + + + @if (($asset->assetstatus) && ($asset->assetstatus->deployable=='1')) + @if (($asset->assigned_to != '') && ($asset->deleted_at=='')) + @can('checkin', \App\Models\Asset::class) + + @endcan + @elseif (($asset->assigned_to == '') && ($asset->deleted_at=='')) + @can('checkout', \App\Models\Asset::class) + + @endcan + @endif + @endif + + + @can('update', $asset) + + @endcan + + @can('create', $asset) + + @endcan + + @can('audit', \App\Models\Asset::class) + + @endcan + + @can('delete', $asset) + @if ($asset->deleted_at=='') +
+
+ {{csrf_field()}} + {{ method_field("DELETE")}} + +
+
+ @endif + @endcan + @if ($asset->deleted_at!='')
@@ -887,11 +946,13 @@ @endif @if (($asset->assignedTo) && ($asset->deleted_at=='')) -

{{ trans('admin/hardware/form.checkedout_to') }}

+
+

{{ trans('admin/hardware/form.checkedout_to') }}

@if($asset->checkedOutToUser()) - {{ $asset->assignedTo->present()->fullName() }} + {{ $asset->assignedTo->present()->fullName() }} @endif +

{!! $asset->assignedTo->present()->glyph() . ' ' .$asset->assignedTo->present()->nameUrl() !!}

@@ -926,6 +987,7 @@ @endif +
@endif
From cc88a361ca462104e9ea947d13d0b5cdb4311d6e Mon Sep 17 00:00:00 2001 From: akemidx Date: Thu, 6 Apr 2023 15:01:01 -0400 Subject: [PATCH 2/3] commiting --- resources/views/hardware/view.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/hardware/view.blade.php b/resources/views/hardware/view.blade.php index 584d70311b..866e8464b6 100755 --- a/resources/views/hardware/view.blade.php +++ b/resources/views/hardware/view.blade.php @@ -946,7 +946,7 @@ @endif @if (($asset->assignedTo) && ($asset->deleted_at=='')) -
+

{{ trans('admin/hardware/form.checkedout_to') }}

@if($asset->checkedOutToUser()) From a65b8025b61a568b347ce82490a986c18276069e Mon Sep 17 00:00:00 2001 From: akemidx Date: Tue, 11 Apr 2023 13:52:14 -0400 Subject: [PATCH 3/3] push for testing --- app/Http/Controllers/Assets/AssetsController.php | 2 +- resources/views/hardware/view.blade.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Http/Controllers/Assets/AssetsController.php b/app/Http/Controllers/Assets/AssetsController.php index 3b2ff4623f..d6c4732d29 100755 --- a/app/Http/Controllers/Assets/AssetsController.php +++ b/app/Http/Controllers/Assets/AssetsController.php @@ -767,7 +767,7 @@ class AssetsController extends Controller } /** - * Retore a deleted asset. + * Restore a deleted asset. * * @author [A. Gianotto] [] * @param int $assetId diff --git a/resources/views/hardware/view.blade.php b/resources/views/hardware/view.blade.php index 866e8464b6..60fd2cab97 100755 --- a/resources/views/hardware/view.blade.php +++ b/resources/views/hardware/view.blade.php @@ -873,7 +873,7 @@ @endif - + @if (($asset->assetstatus) && ($asset->assetstatus->deployable=='1')) @if (($asset->assigned_to != '') && ($asset->deleted_at=='')) @@ -923,10 +923,10 @@ @can('delete', $asset) @if ($asset->deleted_at=='')

- + {{csrf_field()}} {{ method_field("DELETE")}} - +
@endif