From 137d362369418e30e83f70215fed8e7c834c6e2f Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 9 Dec 2025 15:21:50 +0000 Subject: [PATCH 1/5] Added breadcrumbs --- routes/web/users.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/routes/web/users.php b/routes/web/users.php index a8e252822a..c90c1658c1 100644 --- a/routes/web/users.php +++ b/routes/web/users.php @@ -17,7 +17,7 @@ Route::group(['prefix' => 'users', 'middleware' => ['auth']], function () { )->name('ldap/user') ->breadcrumbs(fn (Trail $trail) => $trail->parent('users.index') - ->push(trans('general.ldap_user_sync'), route('ldap/user')));; + ->push(trans('general.ldap_user_sync'), route('ldap/user'))); Route::post( 'ldap', @@ -97,7 +97,10 @@ Route::group(['prefix' => 'users', 'middleware' => ['auth']], function () { Users\BulkUsersController::class, 'edit' ] - )->name('users/bulkedit'); + )->name('users/bulkedit') + ->breadcrumbs(fn (Trail $trail) => + $trail->parent('users.index') + ->push(trans('general.bulk_checkin_delete'), route('ldap/user'))); Route::post( 'merge', From 53f304d137dd60a8a06563ed8590095ed3cea688 Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 9 Dec 2025 15:23:59 +0000 Subject: [PATCH 2/5] Updated view with tooltip on disabled --- resources/views/users/view.blade.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/resources/views/users/view.blade.php b/resources/views/users/view.blade.php index 56b2e7684f..fe0734eb44 100755 --- a/resources/views/users/view.blade.php +++ b/resources/views/users/view.blade.php @@ -276,26 +276,32 @@ @can('update', $user) @if ($user->deleted_at=='')
- @if ($user->isDeletable()) + @if (($user->isDeletable()) && ($user->id!=auth()->user()->id)) {{ trans('button.delete')}} - @else - + @else + @endif
+
- From 227be798f60cd8800d653cf83dc26e5d6bbfd1f7 Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 9 Dec 2025 15:24:10 +0000 Subject: [PATCH 3/5] Visual tweaks to bulk --- .../views/users/confirm-bulk-delete.blade.php | 81 ++++++++++++------- 1 file changed, 50 insertions(+), 31 deletions(-) diff --git a/resources/views/users/confirm-bulk-delete.blade.php b/resources/views/users/confirm-bulk-delete.blade.php index a8cc531f0e..2c92d386f9 100644 --- a/resources/views/users/confirm-bulk-delete.blade.php +++ b/resources/views/users/confirm-bulk-delete.blade.php @@ -1,7 +1,7 @@ @extends('layouts/default') {{-- Page title --}} @section('title') -{!! trans('general.bulk_checkin_delete') !!} +{{ trans('general.bulk_checkin_delete') }} @parent @stop @@ -33,8 +33,32 @@
- +
+ + + + + + @foreach ($users as $user) - isSuperUser() ? ' class="danger"':'') !!}> + @endforeach - - - - - - - -
+ + +
+ +
@@ -65,7 +89,7 @@
@if (Auth::id()!=$user->id) @@ -75,10 +99,29 @@ - id==$user->id ? ' style="text-decoration: line-through"' : '') !!}> - {{ $user->display_name }} ({{ $user->username }}) - - {{ (Auth::id()==$user->id ? ' (cannot delete yourself)' : '') }} + + @if (auth()->user()->id == $user->id) + + id==$user->id ? ' style="text-decoration: line-through" class="text-danger"' : '') !!}> + {{ $user->display_name }} ({{ $user->username }}) + + @elseif ($user->isSuperUser()) + + {{ $user->display_name }} ({{ $user->username }}) + + @elseif ($user->isAdmin()) + + {{ $user->display_name }} ({{ $user->username }}) + + @else + {{ $user->display_name }} ({{ $user->username }}) + @endif + + + @if (auth()->user()->id == $user->id) + {{ trans('tooltips.disabled_assoc.user_self') }} + @endif + @foreach ($user->groups as $group) @@ -105,31 +148,7 @@
- - -
- -
From 62bf61402ed3e22706b2e787a12412ace5d9580e Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 9 Dec 2025 15:24:16 +0000 Subject: [PATCH 4/5] Updated strings --- resources/lang/en-US/admin/users/general.php | 2 +- resources/lang/en-US/general.php | 3 ++- resources/lang/en-US/tooltips.php | 24 ++++++++++++++++++++ 3 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 resources/lang/en-US/tooltips.php diff --git a/resources/lang/en-US/admin/users/general.php b/resources/lang/en-US/admin/users/general.php index e04d2b7de0..fe7990baf9 100644 --- a/resources/lang/en-US/admin/users/general.php +++ b/resources/lang/en-US/admin/users/general.php @@ -37,7 +37,7 @@ return [ 'superadmin_permission_warning' => 'Only superadmins may grant a user superadmin access.', 'admin_permission_warning' => 'Only users with admins rights or greater may grant a user admin access.', 'remove_group_memberships' => 'Remove Group Memberships', - 'warning_deletion_information' => 'You are about to checkin ALL items from the :count user(s) listed below. Super admin names are highlighted in red.', + 'warning_deletion_information' => 'You are about to checkin ALL items from the :count user(s) listed below.', 'update_user_assets_status' => 'Update all assets for these users to this status', 'checkin_user_properties' => 'Check in all properties associated with these users', 'remote_label' => 'This is a remote user', diff --git a/resources/lang/en-US/general.php b/resources/lang/en-US/general.php index da711677ff..76ef7d96ee 100644 --- a/resources/lang/en-US/general.php +++ b/resources/lang/en-US/general.php @@ -465,7 +465,7 @@ return [ 'backup_delete_not_allowed' => 'Deleting backups has been disabled in the .env file. Contact support or your systems administrator.', 'additional_files' => 'Additional Files', 'shitty_browser' => 'No signature detected. If you are using an older browser, please use a more modern browser to complete your asset acceptance.', - 'bulk_soft_delete' =>'Also soft-delete these users. Their asset history will remain intact unless/until you purge deleted records in the Admin Settings.', + 'bulk_soft_delete' =>'Also soft-delete these users. Their item history will remain intact unless/until you purge deleted records in the Admin Settings.', 'bulk_checkin_delete_success' => 'Your selected users have been deleted and their items have been checked in.', 'bulk_checkin_success' => 'The items for the selected users have been checked in.', 'set_to_null' => 'Delete values for this selection|Delete values for all :selection_count selections ', @@ -649,6 +649,7 @@ return [ 'upload_deleted' => 'Upload Deleted', 'child_locations' => 'Child Locations', 'append' => 'Append', + 'optional' => 'OPTIONAL', // Add form placeholders here 'placeholders' => [ diff --git a/resources/lang/en-US/tooltips.php b/resources/lang/en-US/tooltips.php new file mode 100644 index 0000000000..73817c32be --- /dev/null +++ b/resources/lang/en-US/tooltips.php @@ -0,0 +1,24 @@ + [ + 'accessory' => 'This accessory cannot be deleted because it still has items, users, or locations associated with it', + 'asset' => 'This asset cannot be deleted because it still has items associated with it', + 'category' => 'This category cannot be deleted because it still has items associated with it', + 'company' => 'This company cannot be deleted because it still has items or users associated with it', + 'component' => 'This component cannot be deleted because it still has items associated with it', + 'custom_field' => 'This custom field cannot be deleted because it is still associated with at least one fieldset', + 'department' => 'This department cannot be deleted because it still has users associated with it', + 'location' => 'This location cannot be deleted because it still has items or users associated with it', + 'manufacturer' => 'This manufacturer cannot be deleted because it still has items associated with it', + 'supplier' => 'This supplier cannot be deleted because it still has items associated with it', + 'user' => 'This user cannot be deleted because it still has items associated with it', + 'user_self' => 'You cannot delete yourself', + ], + + 'checkin_all' => [ + 'user' => 'Checkin all items for this user and optionally delete them. You will be able to confirm this on the next page.' + ], + +); From 96da8a5fab99b999173909a91e36396b8bb66858 Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 9 Dec 2025 15:28:22 +0000 Subject: [PATCH 5/5] Updated route --- routes/web/users.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routes/web/users.php b/routes/web/users.php index c90c1658c1..d635562b5c 100644 --- a/routes/web/users.php +++ b/routes/web/users.php @@ -100,7 +100,7 @@ Route::group(['prefix' => 'users', 'middleware' => ['auth']], function () { )->name('users/bulkedit') ->breadcrumbs(fn (Trail $trail) => $trail->parent('users.index') - ->push(trans('general.bulk_checkin_delete'), route('ldap/user'))); + ->push(trans('general.bulk_checkin_delete'), route('users.index'))); Route::post( 'merge',