Add VIP Checkbox

This commit is contained in:
akemidx 2023-01-24 15:29:27 -05:00
parent 25996cbe03
commit 596846a94a
7 changed files with 40 additions and 2 deletions

View file

@ -246,6 +246,7 @@ class UsersController extends Controller
'two_factor_optin',
'two_factor_enrolled',
'remote',
'vipuser',
'start_date',
'end_date',
];

View file

@ -271,6 +271,7 @@ class UsersController extends Controller
$user->activated = $request->input('activated', 0);
$user->zip = $request->input('zip', null);
$user->remote = $request->input('remote', 0);
$user->vipuser = $request->input('vipuser', 0);
$user->website = $request->input('website', null);
$user->start_date = $request->input('start_date', null);
$user->end_date = $request->input('end_date', null);

View file

@ -61,7 +61,8 @@ class User extends SnipeModel implements AuthenticatableContract, AuthorizableCo
'remote',
'start_date',
'end_date',
'scim_externalid'
'scim_externalid',
'vipuser',
];
protected $casts = [
@ -69,6 +70,7 @@ class User extends SnipeModel implements AuthenticatableContract, AuthorizableCo
'manager_id' => 'integer',
'location_id' => 'integer',
'company_id' => 'integer',
'vipuser' => 'boolean',
];

View file

@ -85,6 +85,15 @@ class UserPresenter extends Presenter
'visible' => true,
'formatter' => 'usersLinkFormatter',
],
[
'field' => 'vipuser',
'searchable' => false,
'sortable' => true,
'switchable' => true,
'title' => trans('admin/users/general.vip_label'),
'visible' => false,
'formatter' => 'trueFalseFormatter',
],
[
'field' => 'remote',
'searchable' => false,

View file

@ -41,4 +41,6 @@ return [
'remote' => 'Remote',
'remote_help' => 'This can be useful if you need to filter by remote users who never or rarely come into your physical locations.',
'not_remote_label' => 'This is not a remote user',
'vip_label' => 'VIP user',
'vip_help' => 'This can be helpful to mark important people if you would like',
];

View file

@ -362,6 +362,19 @@
@include ('partials.forms.edit.datepicker', ['translated_name' => trans('general.end_date'), 'fieldname' => 'end_date', 'item' => $user])
<!-- VIP checkbox -->
<div class="form-group">
<div class="col-md-7 col-md-offset-3">
<label for="vipuser">
<input type="checkbox" value="1" name="vipuser" class="minimal" {{ (old('vipuser', $user->vipuser)) == '1' ? ' checked="checked"' : '' }} aria-label="vipuser">
{{ trans('admin/users/general.vip_label') }}
</label>
<p class="help-block">{{ trans('admin/users/general.vip_help') }}
</p>
</div>
</div>
<!-- remote checkbox -->
<div class="form-group">

View file

@ -519,7 +519,17 @@
</div>
@endif
<!-- login enabled -->
<!-- login enabled -->
<div class="row">
<div class="col-md-3">
{{ trans('admin/users/general.vip_label') }}
</div>
<div class="col-md-9">
{!! ($user->vipuser=='1') ? '<i class="fas fa-check text-success" aria-hidden="true"></i> '.trans('general.yes') : '<i class="fas fa-times text-danger" aria-hidden="true"></i> '.trans('general.no') !!}
</div>
</div>
<!-- login enabled -->
<div class="row">
<div class="col-md-3">
{{ trans('admin/users/general.remote') }}