A free open source IT asset/license management system
Added start_date and end_date to user bulk edit
snipe22bc088f6f9f
diff --git a/app/Http/Controllers/Users/BulkUsersController.php b/app/Http/Controllers/Users/BulkUsersController.phpindex 1a8f84b7a1..12dc14e29f 100644--- a/app/Http/Controllers/Users/BulkUsersController.php+++ b/app/Http/Controllers/Users/BulkUsersController.php@@ -30,7 +30,7 @@ class BulkUsersController extends Controller* @author [A. Gianotto] [<[email protected]>]* @since [v1.7]* @param Request $request- * @return \Illuminate\Contracts\View\View+ * @return \Illuminate\Contracts\View\View | \Illuminate\Http\RedirectResponse* @throws \Illuminate\Auth\Access\AuthorizationException*/public function edit(Request $request)@@ -116,6 +116,8 @@ class BulkUsersController extends Controller->conditionallyAddItem('remote')->conditionallyAddItem('ldap_import')->conditionallyAddItem('activated')+ ->conditionallyAddItem('start_date')+ ->conditionallyAddItem('end_date')->conditionallyAddItem('autoassign_licenses');@@ -146,7 +148,14 @@ class BulkUsersController extends Controller$this->update_array['company_id'] = null;}-+ if ($request->input('null_start_date')=='1') {+ $this->update_array['start_date'] = null;+ }++ if ($request->input('null_end_date')=='1') {+ $this->update_array['end_date'] = null;+ }+if (! $manager_conflict) {$this->conditionallyAddItem('manager_id');}diff --git a/resources/lang/en-US/general.php b/resources/lang/en-US/general.phpindex 4ebf1b8977..3092228674 100644--- a/resources/lang/en-US/general.php+++ b/resources/lang/en-US/general.php@@ -419,7 +419,7 @@ 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 selection|Delete values for all :selection_count selections ','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',diff --git a/resources/views/hardware/bulk.blade.php b/resources/views/hardware/bulk.blade.phpindex d36513e889..644637ff2d 100755--- a/resources/views/hardware/bulk.blade.php+++ b/resources/views/hardware/bulk.blade.php@@ -48,7 +48,7 @@<div class="col-md-5"><label class="form-control">{{ Form::checkbox('null_name', '1', false) }}- {{ trans_choice('general.set_to_null', count($assets), ['asset_count' => count($assets)]) }}+ {{ trans_choice('general.set_to_null', count($assets), ['selection_count' => count($assets)]) }}</label></div></div>@@ -67,11 +67,11 @@<div class="col-md-5"><label class="form-control">{{ Form::checkbox('null_purchase_date', '1', false) }}- {{ trans_choice('general.set_to_null', count($assets),['asset_count' => count($assets)]) }}+ {{ trans_choice('general.set_to_null', count($assets),['selection_count' => count($assets)]) }}</label></div>-</div>+<!-- Expected Checkin Date --><div class="form-group {{ $errors->has('expected_checkin') ? ' has-error' : '' }}"><label for="expected_checkin" class="col-md-3 control-label">{{ trans('admin/hardware/form.expected_checkin') }}</label>@@ -86,7 +86,7 @@<div class="col-md-5"><label class="form-control">{{ Form::checkbox('null_expected_checkin_date', '1', false) }}- {{ trans_choice('general.set_to_null', count($assets), ['asset_count' => count($assets)]) }}+ {{ trans_choice('general.set_to_null', count($assets), ['selection_count' => count($assets)]) }}</label></div></div>@@ -189,7 +189,7 @@<div class="col-md-5"><label class="form-control">{{ Form::checkbox('null_next_audit_date', '1', false) }}- {{ trans_choice('general.set_to_null', count($assets), ['asset_count' => count($assets)]) }}+ {{ trans_choice('general.set_to_null', count($assets), ['selection_count' => count($assets)]) }}</label></div><div class="col-md-8 col-md-offset-3">diff --git a/resources/views/users/bulk-edit.blade.php b/resources/views/users/bulk-edit.blade.phpindex e1d3b4201a..7235035760 100644--- a/resources/views/users/bulk-edit.blade.php+++ b/resources/views/users/bulk-edit.blade.php@@ -218,6 +218,43 @@</div> <!--/controls-->@endif</div> <!--/col-md-5-->+ </div>+++ <!-- Start Date -->+ <div class="form-group {{ $errors->has('start_date') ? ' has-error' : '' }}">+ <label for="start_date" class="col-md-3 control-label">{{ trans('general.start_date') }}</label>+ <div class="col-md-4">+ <div class="input-group date" data-provide="datepicker" data-date-format="yyyy-mm-dd" data-autoclose="true">+ <input type="text" class="form-control" placeholder="{{ trans('general.start_date') }}" name="start_date" id="start_date" value="{{ old('start_date') }}">+ <span class="input-group-addon"><x-icon type="calendar" /></span>+ </div>+ {!! $errors->first('start_date', '<span class="alert-msg"><i class="fas fa-times"></i> :message</span>') !!}+ </div>+ <div class="col-md-5">+ <label class="form-control">+ {{ Form::checkbox('null_start_date', '1', false) }}+ {{ trans_choice('general.set_to_null', count($users),['selection_count' => count($users)]) }}+ </label>+ </div>+ </div>++ <!-- End Date -->+ <div class="form-group {{ $errors->has('end_date') ? ' has-error' : '' }}">+ <label for="end_date" class="col-md-3 control-label">{{ trans('general.end_date') }}</label>+ <div class="col-md-4">+ <div class="input-group date" data-provide="datepicker" data-date-format="yyyy-mm-dd" data-autoclose="true">+ <input type="text" class="form-control" placeholder="{{ trans('general.end_date') }}" name="end_date" id="end_date" value="{{ old('end_date') }}">+ <span class="input-group-addon"><x-icon type="calendar" /></span>+ </div>+ {!! $errors->first('end_date', '<span class="alert-msg"><i class="fas fa-times"></i> :message</span>') !!}+ </div>+ <div class="col-md-5">+ <label class="form-control">+ {{ Form::checkbox('null_end_date', '1', false) }}+ {{ trans_choice('general.set_to_null', count($users),['selection_count' => count($users)]) }}+ </label>+ </div></div>