From 3495652827a92a0580f876b36bb0553d78d40b69 Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 31 Oct 2023 12:52:53 +0000 Subject: [PATCH] Added checkboxes to intentionally remove field values in bulk user edit Signed-off-by: snipe --- .../Controllers/Users/BulkUsersController.php | 16 ++++++++++ resources/views/users/bulk-edit.blade.php | 30 +++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/app/Http/Controllers/Users/BulkUsersController.php b/app/Http/Controllers/Users/BulkUsersController.php index a2d3d496da..ca1e2a4897 100644 --- a/app/Http/Controllers/Users/BulkUsersController.php +++ b/app/Http/Controllers/Users/BulkUsersController.php @@ -125,10 +125,26 @@ class BulkUsersController extends Controller ]; } + /** + * Check to see if the user wants to actually blank out the values vs skip them + */ if ($request->input('null_location_id')=='1') { $this->update_array['location_id'] = null; } + if ($request->input('null_department_id')=='1') { + $this->update_array['department_id'] = null; + } + + if ($request->input('null_manager_id')=='1') { + $this->update_array['manager_id'] = null; + } + + if ($request->input('null_company_id')=='1') { + $this->update_array['company_id'] = null; + } + + if (! $manager_conflict) { $this->conditionallyAddItem('manager_id'); } diff --git a/resources/views/users/bulk-edit.blade.php b/resources/views/users/bulk-edit.blade.php index bdc1ad9289..b28eb602d2 100644 --- a/resources/views/users/bulk-edit.blade.php +++ b/resources/views/users/bulk-edit.blade.php @@ -39,6 +39,16 @@ @include ('partials.forms.edit.department-select', ['translated_name' => trans('general.department'), 'fieldname' => 'department_id']) +
+
+ +
+
+ + @include ('partials.forms.edit.location-select', ['translated_name' => trans('general.location'), 'fieldname' => 'location_id']) @@ -55,11 +65,31 @@ @if (\App\Models\Company::canManageUsersCompanies()) @include ('partials.forms.edit.company-select', ['translated_name' => trans('general.select_company'), 'fieldname' => 'company_id']) + +
+
+ +
+
+ @endif @include ('partials.forms.edit.user-select', ['translated_name' => trans('admin/users/table.manager'), 'fieldname' => 'manager_id']) +
+
+ +
+
+ +