Skip to content

A free open source IT asset/license management system

Ability to remove user location from users

snipee08327be95df
diff --git a/app/Http/Controllers/Users/BulkUsersController.php b/app/Http/Controllers/Users/BulkUsersController.php
index b12683efaf..67ecae542e 100644
--- a/app/Http/Controllers/Users/BulkUsersController.php
+++ b/app/Http/Controllers/Users/BulkUsersController.php
@@ -123,6 +123,11 @@ class BulkUsersController extends Controller
'warning' => trans('admin/users/message.bulk_manager_warn'),
];
}
+
+ if ($request->input('null_location_id')=='1') {
+ $this->update_array['location_id'] = null;
+ }
+
if (! $manager_conflict) {
$this->conditionallyAddItem('manager_id');
}
diff --git a/resources/lang/en/general.php b/resources/lang/en/general.php
index 48e61d540e..5f1e8d8922 100644
--- a/resources/lang/en/general.php
+++ b/resources/lang/en/general.php
@@ -385,7 +385,8 @@ return [
'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_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 asset|Delete values for all :asset_count assets ',
+ 'set_to_null' => 'Delete values for this asset|Delete values for all :asset_count assets ',
+ 'set_users_field_to_null' => 'Delete :field values for this user|Delete :field values for all :user_count users ',
'na_no_purchase_date' => 'N/A - No purchase date provided',
'assets_by_status' => 'Assets by Status',
'assets_by_status_type' => 'Assets by Status Type',
diff --git a/resources/views/hardware/bulk.blade.php b/resources/views/hardware/bulk.blade.php
index a8515ab817..1cacc4086f 100755
--- a/resources/views/hardware/bulk.blade.php
+++ b/resources/views/hardware/bulk.blade.php
@@ -145,7 +145,7 @@
</div>
<!-- Next audit Date -->
- <div class="form-group {{ $errors->has('expected_checkin') ? ' has-error' : '' }}">
+ <div class="form-group {{ $errors->has('next_audit_date') ? ' has-error' : '' }}">
<label for="next_audit_date" class="col-md-3 control-label">{{ trans('general.next_audit_date') }}</label>
<div class="col-md-3">
<div class="input-group date" data-provide="datepicker" data-date-format="yyyy-mm-dd" data-autoclose="true">
diff --git a/resources/views/users/bulk-edit.blade.php b/resources/views/users/bulk-edit.blade.php
index 302ce66505..2916fd1a85 100644
--- a/resources/views/users/bulk-edit.blade.php
+++ b/resources/views/users/bulk-edit.blade.php
@@ -42,6 +42,15 @@
<!-- Location -->
@include ('partials.forms.edit.location-select', ['translated_name' => trans('general.location'), 'fieldname' => 'location_id'])
+ <div class="form-group">
+ <div class=" col-md-9 col-md-offset-3">
+ <label>
+ {{ Form::checkbox('null_location_id', '1', false, ['class' => 'minimal']) }}
+ {{ trans_choice('general.set_users_field_to_null', count($users), ['field' => trans('general.location'), 'user_count' => count($users)]) }}
+ </label>
+ </div>
+ </div>
+
<!-- Company -->
@if (\App\Models\Company::canManageUsersCompanies())