mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 05:34:06 -08:00
Merge pull request #12406 from akemidx/vip_tag
Added a checkbox to notate VIP status
This commit is contained in:
commit
8e72da42e8
|
@ -246,6 +246,7 @@ class UsersController extends Controller
|
|||
'two_factor_optin',
|
||||
'two_factor_enrolled',
|
||||
'remote',
|
||||
'vip',
|
||||
'start_date',
|
||||
'end_date',
|
||||
];
|
||||
|
|
|
@ -272,6 +272,7 @@ class UsersController extends Controller
|
|||
$user->activated = $request->input('activated', 0);
|
||||
$user->zip = $request->input('zip', null);
|
||||
$user->remote = $request->input('remote', 0);
|
||||
$user->vip = $request->input('vip', 0);
|
||||
$user->website = $request->input('website', null);
|
||||
$user->start_date = $request->input('start_date', null);
|
||||
$user->end_date = $request->input('end_date', null);
|
||||
|
|
|
@ -64,6 +64,7 @@ class User extends SnipeModel implements AuthenticatableContract, AuthorizableCo
|
|||
'scim_externalid',
|
||||
'avatar',
|
||||
'gravatar',
|
||||
'vip',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
|
@ -71,6 +72,7 @@ class User extends SnipeModel implements AuthenticatableContract, AuthorizableCo
|
|||
'manager_id' => 'integer',
|
||||
'location_id' => 'integer',
|
||||
'company_id' => 'integer',
|
||||
'vip' => 'boolean',
|
||||
];
|
||||
|
||||
|
||||
|
|
|
@ -85,6 +85,15 @@ class UserPresenter extends Presenter
|
|||
'visible' => true,
|
||||
'formatter' => 'usersLinkFormatter',
|
||||
],
|
||||
[
|
||||
'field' => 'vip',
|
||||
'searchable' => false,
|
||||
'sortable' => true,
|
||||
'switchable' => true,
|
||||
'title' => trans('admin/users/general.vip_label'),
|
||||
'visible' => false,
|
||||
'formatter' => 'trueFalseFormatter',
|
||||
],
|
||||
[
|
||||
'field' => 'remote',
|
||||
'searchable' => false,
|
||||
|
|
34
database/migrations/2023_01_23_232933_add_vip_to_users.php
Normal file
34
database/migrations/2023_01_23_232933_add_vip_to_users.php
Normal file
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddVipToUsers extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->boolean('vip')->nullable()->default(0);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
if (Schema::hasColumn('users', 'vip')) {
|
||||
$table->dropColumn('vip');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
|
@ -43,6 +43,8 @@ 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',
|
||||
'create_user' => 'Create a user',
|
||||
'create_user_page_explanation' => 'This is the account information you will use to access the site for the first time.',
|
||||
'email_credentials' => 'Email credentials',
|
||||
|
|
|
@ -370,6 +370,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="vip">
|
||||
<input type="checkbox" value="1" name="vip" class="minimal" {{ (old('vip', $user->vip)) == '1' ? ' checked="checked"' : '' }} aria-label="vip">
|
||||
{{ 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">
|
||||
|
|
|
@ -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->vip=='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') }}
|
||||
|
|
Loading…
Reference in a new issue