From 1a407dc05b00f063e6e7ded0826cefd6ff9b05a3 Mon Sep 17 00:00:00 2001 From: akemidx Date: Tue, 20 Jun 2023 19:17:14 -0400 Subject: [PATCH 1/6] user department now in side view of asset view page --- resources/views/hardware/view.blade.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/resources/views/hardware/view.blade.php b/resources/views/hardware/view.blade.php index 50b80de0f2..816246b299 100755 --- a/resources/views/hardware/view.blade.php +++ b/resources/views/hardware/view.blade.php @@ -553,7 +553,7 @@
- {{ trans('admin/hardware/table.current_value') }} + {{ trans('admin/hardware/table.git_value') }}
@@ -919,6 +919,10 @@ @endif + @if((isset($asset->assignedTo)) && ($asset->assignedTo->department!='')) +
  • {{ $asset->assignedTo->department->name}}
  • + @endif + @if (isset($asset->location))
  • {{ $asset->location->name }}
  • {{ $asset->location->address }} From 4b8a08edc16c12697b7f08cc2f7088d12ff47785 Mon Sep 17 00:00:00 2001 From: akemidx Date: Tue, 20 Jun 2023 19:32:16 -0400 Subject: [PATCH 2/6] typo --- 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 816246b299..d3b744f3da 100755 --- a/resources/views/hardware/view.blade.php +++ b/resources/views/hardware/view.blade.php @@ -553,7 +553,7 @@
    - {{ trans('admin/hardware/table.git_value') }} + {{ trans('admin/hardware/table.current_value') }}
    From af03b9f140737351aa525ec31a002a18ee50cd14 Mon Sep 17 00:00:00 2001 From: akemidx Date: Wed, 28 Jun 2023 17:45:13 -0400 Subject: [PATCH 3/6] user department clarification & translation for that phrase. will be used in a later PR --- resources/lang/en/admin/hardware/general.php | 1 + resources/views/hardware/view.blade.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/lang/en/admin/hardware/general.php b/resources/lang/en/admin/hardware/general.php index b0a48f2ce4..8bc9c153ff 100644 --- a/resources/lang/en/admin/hardware/general.php +++ b/resources/lang/en/admin/hardware/general.php @@ -45,4 +45,5 @@ return [ 'alert_details' => 'Please see below for details.', 'custom_export' => 'Custom Export', 'mfg_warranty_lookup' => ':manufacturer Warranty Status Lookup', + 'user_department' => 'User Department: ', ]; diff --git a/resources/views/hardware/view.blade.php b/resources/views/hardware/view.blade.php index d3b744f3da..7ae6832b57 100755 --- a/resources/views/hardware/view.blade.php +++ b/resources/views/hardware/view.blade.php @@ -920,7 +920,7 @@ @endif @if((isset($asset->assignedTo)) && ($asset->assignedTo->department!='')) -
  • {{ $asset->assignedTo->department->name}}
  • +
  • {{ trans('admin/hardware/general.user_department') }}{{ $asset->assignedTo->department->name}}
  • @endif @if (isset($asset->location)) From d0212d4bdaf89f78651dab52e1e6ea60d158b695 Mon Sep 17 00:00:00 2001 From: akemidx Date: Thu, 29 Jun 2023 15:39:19 -0400 Subject: [PATCH 4/6] formatting fix --- resources/lang/en/admin/hardware/general.php | 2 +- resources/views/hardware/view.blade.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/lang/en/admin/hardware/general.php b/resources/lang/en/admin/hardware/general.php index 8bc9c153ff..5368208e81 100644 --- a/resources/lang/en/admin/hardware/general.php +++ b/resources/lang/en/admin/hardware/general.php @@ -45,5 +45,5 @@ return [ 'alert_details' => 'Please see below for details.', 'custom_export' => 'Custom Export', 'mfg_warranty_lookup' => ':manufacturer Warranty Status Lookup', - 'user_department' => 'User Department: ', + 'user_department' => 'User Department', ]; diff --git a/resources/views/hardware/view.blade.php b/resources/views/hardware/view.blade.php index 7ae6832b57..df8ffae481 100755 --- a/resources/views/hardware/view.blade.php +++ b/resources/views/hardware/view.blade.php @@ -920,7 +920,7 @@ @endif @if((isset($asset->assignedTo)) && ($asset->assignedTo->department!='')) -
  • {{ trans('admin/hardware/general.user_department') }}{{ $asset->assignedTo->department->name}}
  • +
  • {{ trans('admin/hardware/general.user_department') }}: {{ $asset->assignedTo->department->name}}
  • @endif @if (isset($asset->location)) From 1163af3c10b9cd36ce5e322ca457aee5346f137e Mon Sep 17 00:00:00 2001 From: akemidx Date: Wed, 12 Jul 2023 15:57:44 -0400 Subject: [PATCH 5/6] change to make sure department actually exists --- 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 df8ffae481..f2d0e81884 100755 --- a/resources/views/hardware/view.blade.php +++ b/resources/views/hardware/view.blade.php @@ -919,7 +919,7 @@ @endif - @if((isset($asset->assignedTo)) && ($asset->assignedTo->department!='')) + @if((isset($asset->assignedTo)) && ($asset->assignedTo->department))
  • {{ trans('admin/hardware/general.user_department') }}: {{ $asset->assignedTo->department->name}}
  • @endif From f51dd15893c57dbd28ac44b0fecbba527eb26399 Mon Sep 17 00:00:00 2001 From: snipe Date: Fri, 14 Jul 2023 07:44:19 +0100 Subject: [PATCH 6/6] Moved deleted scope down Signed-off-by: snipe --- app/Http/Controllers/Api/UsersController.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/Http/Controllers/Api/UsersController.php b/app/Http/Controllers/Api/UsersController.php index dc444ec9e9..7b22f3af4b 100644 --- a/app/Http/Controllers/Api/UsersController.php +++ b/app/Http/Controllers/Api/UsersController.php @@ -78,12 +78,6 @@ class UsersController extends Controller $users = Company::scopeCompanyables($users); - if (($request->filled('deleted')) && ($request->input('deleted') == 'true')) { - $users = $users->onlyTrashed(); - } elseif (($request->filled('all')) && ($request->input('all') == 'true')) { - $users = $users->withTrashed(); - } - if ($request->filled('activated')) { $users = $users->where('users.activated', '=', $request->input('activated')); } @@ -272,6 +266,12 @@ class UsersController extends Controller break; } + if (($request->filled('deleted')) && ($request->input('deleted') == 'true')) { + $users = $users->onlyTrashed(); + } elseif (($request->filled('all')) && ($request->input('all') == 'true')) { + $users = $users->withTrashed(); + } + $total = $users->count(); $users = $users->skip($offset)->take($limit)->get();