mirror of
https://github.com/snipe/snipe-it.git
synced 2025-03-05 20:52:15 -08:00
Merge pull request #11908 from snipe/features/nicer_view_assets_ui_for_regular_users
Overhaul of UI for unprivileged users
This commit is contained in:
commit
931d81d825
|
@ -3,7 +3,10 @@
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use App\Http\Requests\ImageUploadRequest;
|
use App\Http\Requests\ImageUploadRequest;
|
||||||
|
use App\Models\Asset;
|
||||||
use App\Models\Setting;
|
use App\Models\Setting;
|
||||||
|
use App\Models\User;
|
||||||
|
use App\Notifications\CurrentInventory;
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
use Gate;
|
use Gate;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
@ -216,4 +219,47 @@ class ProfileController extends Controller
|
||||||
$request->session()->put('menu_state', 'closed');
|
$request->session()->put('menu_state', 'closed');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Print inventory
|
||||||
|
*
|
||||||
|
* @author A. Gianotto
|
||||||
|
* @since [v6.0.12]
|
||||||
|
* @return Illuminate\View\View
|
||||||
|
*/
|
||||||
|
public function printInventory()
|
||||||
|
{
|
||||||
|
$show_user = Auth::user();
|
||||||
|
|
||||||
|
return view('users/print')
|
||||||
|
->with('assets', Auth::user()->assets)
|
||||||
|
->with('licenses', $show_user->licenses()->get())
|
||||||
|
->with('accessories', $show_user->accessories()->get())
|
||||||
|
->with('consumables', $show_user->consumables()->get())
|
||||||
|
->with('show_user', $show_user)
|
||||||
|
->with('settings', Setting::getSettings());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Emails user a list of assigned assets
|
||||||
|
*
|
||||||
|
* @author A. Gianotto
|
||||||
|
* @since [v6.0.12]
|
||||||
|
* @return \Illuminate\Http\RedirectResponse
|
||||||
|
*/
|
||||||
|
public function emailAssetList()
|
||||||
|
{
|
||||||
|
|
||||||
|
if (!$user = User::find(Auth::user()->id)) {
|
||||||
|
return redirect()->back()
|
||||||
|
->with('error', trans('admin/users/message.user_not_found', ['id' => $id]));
|
||||||
|
}
|
||||||
|
if (empty($user->email)) {
|
||||||
|
return redirect()->back()->with('error', trans('admin/users/message.user_has_no_email'));
|
||||||
|
}
|
||||||
|
|
||||||
|
$user->notify((new CurrentInventory($user)));
|
||||||
|
return redirect()->back()->with('success', trans('admin/users/general.user_notified'));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -594,7 +594,7 @@ class UsersController extends Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* LDAP form processing.
|
* Print inventory
|
||||||
*
|
*
|
||||||
* @author Aladin Alaily
|
* @author Aladin Alaily
|
||||||
* @since [v1.8]
|
* @since [v1.8]
|
||||||
|
|
|
@ -376,6 +376,8 @@ return [
|
||||||
'assets_by_status' => 'Assets by Status',
|
'assets_by_status' => 'Assets by Status',
|
||||||
'assets_by_status_type' => 'Assets by Status Type',
|
'assets_by_status_type' => 'Assets by Status Type',
|
||||||
'pie_chart_type' => 'Dashboard Pie Chart Type',
|
'pie_chart_type' => 'Dashboard Pie Chart Type',
|
||||||
|
'hello_name' => 'Hello, :name!',
|
||||||
|
'unaccepted_profile_warning' => 'You have :count items requiring acceptance. Click here to accept or decline them',
|
||||||
|
|
||||||
|
|
||||||
];
|
];
|
|
@ -2,17 +2,370 @@
|
||||||
|
|
||||||
{{-- Page title --}}
|
{{-- Page title --}}
|
||||||
@section('title')
|
@section('title')
|
||||||
{{ trans('general.viewassetsfor', array('name' => $user->present()->fullName())) }}
|
{{ trans('general.hello_name', array('name' => $user->present()->fullName())) }}
|
||||||
@parent
|
@parent
|
||||||
@stop
|
@stop
|
||||||
|
|
||||||
{{-- Account page content --}}
|
{{-- Account page content --}}
|
||||||
@section('content')
|
@section('content')
|
||||||
|
|
||||||
|
@if ($acceptances = \App\Models\CheckoutAcceptance::forUser(Auth::user())->pending()->count())
|
||||||
|
<div class="col-md-12">
|
||||||
|
<div class="alert alert alert-warning fade in">
|
||||||
|
<i class="fas fa-exclamation-triangle faa-pulse animated"></i>
|
||||||
|
|
||||||
|
<strong>
|
||||||
|
<a href="{{ route('account.accept') }}" style="color: white;">
|
||||||
|
{{ trans('general.unaccepted_profile_warning', array('count' => $acceptances)) }}
|
||||||
|
</a>
|
||||||
|
</strong>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<div class="box box-default">
|
<div class="nav-tabs-custom">
|
||||||
|
<ul class="nav nav-tabs hidden-print">
|
||||||
|
|
||||||
|
<li class="active">
|
||||||
|
<a href="#details" data-toggle="tab">
|
||||||
|
<span class="hidden-lg hidden-md">
|
||||||
|
<i class="fas fa-info-circle fa-2x"></i>
|
||||||
|
</span>
|
||||||
|
<span class="hidden-xs hidden-sm">{{ trans('admin/users/general.info') }}</span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="#asset" data-toggle="tab">
|
||||||
|
<span class="hidden-lg hidden-md">
|
||||||
|
<i class="fas fa-barcode fa-2x" aria-hidden="true"></i>
|
||||||
|
</span>
|
||||||
|
<span class="hidden-xs hidden-sm">{{ trans('general.assets') }}
|
||||||
|
{!! ($user->assets()->AssetsForShow()->count() > 0 ) ? '<badge class="badge badge-secondary">'.number_format($user->assets()->AssetsForShow()->count()).'</badge>' : '' !!}
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="#licenses" data-toggle="tab">
|
||||||
|
<span class="hidden-lg hidden-md">
|
||||||
|
<i class="far fa-save fa-2x"></i>
|
||||||
|
</span>
|
||||||
|
<span class="hidden-xs hidden-sm">{{ trans('general.licenses') }}
|
||||||
|
{!! ($user->licenses->count() > 0 ) ? '<badge class="badge badge-secondary">'.number_format($user->licenses->count()).'</badge>' : '' !!}
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="#accessories" data-toggle="tab">
|
||||||
|
<span class="hidden-lg hidden-md">
|
||||||
|
<i class="far fa-keyboard fa-2x"></i>
|
||||||
|
</span>
|
||||||
|
<span class="hidden-xs hidden-sm">{{ trans('general.accessories') }}
|
||||||
|
{!! ($user->accessories->count() > 0 ) ? '<badge class="badge badge-secondary">'.number_format($user->accessories->count()).'</badge>' : '' !!}
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="#consumables" data-toggle="tab">
|
||||||
|
<span class="hidden-lg hidden-md">
|
||||||
|
<i class="fas fa-tint fa-2x"></i>
|
||||||
|
</span>
|
||||||
|
<span class="hidden-xs hidden-sm">{{ trans('general.consumables') }}
|
||||||
|
{!! ($user->consumables->count() > 0 ) ? '<badge class="badge badge-secondary">'.number_format($user->consumables->count()).'</badge>' : '' !!}
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<div class="tab-content">
|
||||||
|
<div class="tab-pane active" id="details">
|
||||||
|
<div class="row">
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Start button column -->
|
||||||
|
<div class="col-md-3 col-xs-12 col-sm-push-9">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col-md-12 text-center">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="col-md-12 text-center">
|
||||||
|
<img src="{{ $user->present()->gravatar() }}" class=" img-thumbnail hidden-print" style="margin-bottom: 20px;" alt="{{ $user->present()->fullName() }}">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-12">
|
||||||
|
<a href="{{ route('profile') }}" style="width: 100%;" class="btn btn-sm btn-primary hidden-print">
|
||||||
|
{{ trans('general.editprofile') }}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-12" style="padding-top: 5px;">
|
||||||
|
<a href="{{ route('account.password.index') }}" style="width: 100%;" class="btn btn-sm btn-primary hidden-print" target="_blank" rel="noopener">
|
||||||
|
{{ trans('general.changepassword') }}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@can('self.api')
|
||||||
|
<div class="col-md-12" style="padding-top: 5px;">
|
||||||
|
<a href="{{ route('user.api') }}" style="width: 100%;" class="btn btn-sm btn-primary hidden-print" target="_blank" rel="noopener">
|
||||||
|
{{ trans('general.manage_api_keys') }}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
@endcan
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col-md-12" style="padding-top: 5px;">
|
||||||
|
<a href="{{ route('profile.print') }}" style="width: 100%;" class="btn btn-sm btn-primary hidden-print" target="_blank" rel="noopener">
|
||||||
|
{{ trans('admin/users/general.print_assigned') }}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col-md-12" style="padding-top: 5px;">
|
||||||
|
@if(!empty($user->email))
|
||||||
|
<form action="{{ route('profile.email_assets') }}" method="POST">
|
||||||
|
{{ csrf_field() }}
|
||||||
|
<button style="width: 100%;" class="btn btn-sm btn-primary hidden-print" rel="noopener">{{ trans('admin/users/general.email_assigned') }}</button>
|
||||||
|
</form>
|
||||||
|
@else
|
||||||
|
<button style="width: 100%;" class="btn btn-sm btn-primary hidden-print" rel="noopener" disabled title="{{ trans('admin/users/message.user_has_no_email') }}">{{ trans('admin/users/general.email_assigned') }}</button>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<br><br>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- End button column -->
|
||||||
|
|
||||||
|
<div class="col-md-9 col-xs-12 col-sm-pull-3">
|
||||||
|
|
||||||
|
<div class="row-new-striped">
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<!-- name -->
|
||||||
|
|
||||||
|
<div class="col-md-3 col-sm-2">
|
||||||
|
{{ trans('admin/users/table.name') }}
|
||||||
|
</div>
|
||||||
|
<div class="col-md-9 col-sm-2">
|
||||||
|
{{ $user->present()->fullName() }}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!-- company -->
|
||||||
|
@if (!is_null($user->company))
|
||||||
|
<div class="row">
|
||||||
|
|
||||||
|
<div class="col-md-3">
|
||||||
|
{{ trans('general.company') }}
|
||||||
|
</div>
|
||||||
|
<div class="col-md-9">
|
||||||
|
{{ $user->company->name }}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@endif
|
||||||
|
|
||||||
|
<!-- username -->
|
||||||
|
<div class="row">
|
||||||
|
|
||||||
|
<div class="col-md-3">
|
||||||
|
{{ trans('admin/users/table.username') }}
|
||||||
|
</div>
|
||||||
|
<div class="col-md-9">
|
||||||
|
|
||||||
|
@if ($user->isSuperUser())
|
||||||
|
<label class="label label-danger"><i class="fas fa-crown" title="superuser"></i></label>
|
||||||
|
@elseif ($user->hasAccess('admin'))
|
||||||
|
<label class="label label-warning"><i class="fas fa-crown" title="admin"></i></label>
|
||||||
|
@endif
|
||||||
|
{{ $user->username }}
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- address -->
|
||||||
|
@if (($user->address) || ($user->city) || ($user->state) || ($user->country))
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-3">
|
||||||
|
{{ trans('general.address') }}
|
||||||
|
</div>
|
||||||
|
<div class="col-md-9">
|
||||||
|
|
||||||
|
@if ($user->address)
|
||||||
|
{{ $user->address }} <br>
|
||||||
|
@endif
|
||||||
|
@if ($user->city)
|
||||||
|
{{ $user->city }}
|
||||||
|
@endif
|
||||||
|
@if ($user->state)
|
||||||
|
{{ $user->state }}
|
||||||
|
@endif
|
||||||
|
@if ($user->country)
|
||||||
|
{{ $user->country }}
|
||||||
|
@endif
|
||||||
|
@if ($user->zip)
|
||||||
|
{{ $user->zip }}
|
||||||
|
@endif
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
@if ($user->jobtitle)
|
||||||
|
<!-- jobtitle -->
|
||||||
|
<div class="row">
|
||||||
|
|
||||||
|
<div class="col-md-3">
|
||||||
|
{{ trans('admin/users/table.job') }}
|
||||||
|
</div>
|
||||||
|
<div class="col-md-9">
|
||||||
|
{{ $user->jobtitle }}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
@if ($user->employee_num)
|
||||||
|
<!-- employee_num -->
|
||||||
|
<div class="row">
|
||||||
|
|
||||||
|
<div class="col-md-3">
|
||||||
|
{{ trans('admin/users/table.employee_num') }}
|
||||||
|
</div>
|
||||||
|
<div class="col-md-9">
|
||||||
|
{{ $user->employee_num }}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
@if ($user->manager)
|
||||||
|
<!-- manager -->
|
||||||
|
<div class="row">
|
||||||
|
|
||||||
|
<div class="col-md-3">
|
||||||
|
{{ trans('admin/users/table.manager') }}
|
||||||
|
</div>
|
||||||
|
<div class="col-md-9">
|
||||||
|
<a href="{{ route('users.show', $user->manager->id) }}">
|
||||||
|
{{ $user->manager->getFullNameAttribute() }}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@endif
|
||||||
|
|
||||||
|
|
||||||
|
@if ($user->email)
|
||||||
|
<!-- email -->
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-3">
|
||||||
|
{{ trans('admin/users/table.email') }}
|
||||||
|
</div>
|
||||||
|
<div class="col-md-9">
|
||||||
|
<a href="mailto:{{ $user->email }}">{{ $user->email }}</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
@if ($user->website)
|
||||||
|
<!-- website -->
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-3">
|
||||||
|
{{ trans('general.website') }}
|
||||||
|
</div>
|
||||||
|
<div class="col-md-9">
|
||||||
|
<a href="{{ $user->website }}" target="_blank">{{ $user->website }}</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
@if ($user->phone)
|
||||||
|
<!-- phone -->
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-3">
|
||||||
|
{{ trans('admin/users/table.phone') }}
|
||||||
|
</div>
|
||||||
|
<div class="col-md-9">
|
||||||
|
<a href="tel:{{ $user->phone }}">{{ $user->phone }}</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
@if ($user->userloc)
|
||||||
|
<!-- location -->
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-3">
|
||||||
|
{{ trans('admin/users/table.location') }}
|
||||||
|
</div>
|
||||||
|
<div class="col-md-9">
|
||||||
|
{{ link_to_route('locations.show', $user->userloc->name, [$user->userloc->id]) }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
<!-- last login -->
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-3">
|
||||||
|
{{ trans('general.last_login') }}
|
||||||
|
</div>
|
||||||
|
<div class="col-md-9">
|
||||||
|
{{ \App\Helpers\Helper::getFormattedDateObject($user->last_login, 'datetime', false) }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
@if ($user->department)
|
||||||
|
<!-- empty -->
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-3">
|
||||||
|
{{ trans('general.department') }}
|
||||||
|
</div>
|
||||||
|
<div class="col-md-9">
|
||||||
|
{{ $user->department->name }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
@if ($user->created_at)
|
||||||
|
<!-- created at -->
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-3">
|
||||||
|
{{ trans('general.created_at') }}
|
||||||
|
</div>
|
||||||
|
<div class="col-md-9">
|
||||||
|
{{ \App\Helpers\Helper::getFormattedDateObject($user->created_at, 'datetime')['formatted']}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
</div> <!--/end striped container-->
|
||||||
|
</div> <!-- end col-md-9 -->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div> <!--/.row-->
|
||||||
|
</div><!-- /.tab-pane -->
|
||||||
|
|
||||||
|
<div class="tab-pane" id="asset">
|
||||||
|
<!-- checked out assets table -->
|
||||||
|
|
||||||
|
|
||||||
|
<div class="table table-responsive">
|
||||||
@if ($user->id)
|
@if ($user->id)
|
||||||
<div class="box-header with-border">
|
<div class="box-header with-border">
|
||||||
<div class="box-heading">
|
<div class="box-heading">
|
||||||
|
@ -45,12 +398,12 @@
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>#</th>
|
<th>#</th>
|
||||||
<th class="col-md-3" data-switchable="true" data-visible="true">{{ trans('general.category') }}</th>
|
<th class="col-md-1">{{ trans('general.image') }}</th>
|
||||||
|
<th class="col-md-2" data-switchable="true" data-visible="true">{{ trans('general.category') }}</th>
|
||||||
<th class="col-md-2" data-switchable="true" data-visible="true">{{ trans('admin/hardware/table.asset_tag') }}</th>
|
<th class="col-md-2" data-switchable="true" data-visible="true">{{ trans('admin/hardware/table.asset_tag') }}</th>
|
||||||
<th class="col-md-3" data-switchable="true" data-visible="true">{{ trans('general.name') }}</th>
|
<th class="col-md-2" data-switchable="true" data-visible="true">{{ trans('general.name') }}</th>
|
||||||
<th class="col-md-4" data-switchable="true" data-visible="true">{{ trans('admin/hardware/table.asset_model') }}</th>
|
<th class="col-md-2" data-switchable="true" data-visible="true">{{ trans('admin/hardware/table.asset_model') }}</th>
|
||||||
<th class="col-md-3" data-switchable="true" data-visible="true">{{ trans('admin/hardware/table.serial') }}</th>
|
<th class="col-md-3" data-switchable="true" data-visible="true">{{ trans('admin/hardware/table.serial') }}</th>
|
||||||
<th>{{ trans('general.image') }}</th>
|
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
</thead>
|
</thead>
|
||||||
|
@ -61,6 +414,13 @@
|
||||||
@foreach ($user->assets as $asset)
|
@foreach ($user->assets as $asset)
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ $counter }}</td>
|
<td>{{ $counter }}</td>
|
||||||
|
<td>
|
||||||
|
@if (($asset->image) && ($asset->image!=''))
|
||||||
|
<img src="{{ Storage::disk('public')->url(app('assets_upload_path').e($asset->image)) }}" style="max-height: 30px; width: auto" class="img-responsive">
|
||||||
|
@elseif (($asset->model) && ($asset->model->image!=''))
|
||||||
|
<img src="{{ Storage::disk('public')->url(app('models_upload_path').e($asset->model->image)) }}" style="max-height: 30px; width: auto" class="img-responsive">
|
||||||
|
@endif
|
||||||
|
</td>
|
||||||
<td>{{ $asset->model->category->name }}</td>
|
<td>{{ $asset->model->category->name }}</td>
|
||||||
<td>{{ $asset->asset_tag }}</td>
|
<td>{{ $asset->asset_tag }}</td>
|
||||||
<td>{{ $asset->name }}</td>
|
<td>{{ $asset->name }}</td>
|
||||||
|
@ -70,14 +430,6 @@
|
||||||
@endif
|
@endif
|
||||||
</td>
|
</td>
|
||||||
<td>{{ $asset->serial }}</td>
|
<td>{{ $asset->serial }}</td>
|
||||||
<td>
|
|
||||||
@if (($asset->image) && ($asset->image!=''))
|
|
||||||
<img src="{{ Storage::disk('public')->url(app('assets_upload_path').e($asset->image)) }}" height="50" width="50">
|
|
||||||
|
|
||||||
@elseif (($asset->model) && ($asset->model->image!=''))
|
|
||||||
<img src="{{ Storage::disk('public')->url(app('models_upload_path').e($asset->model->image)) }}" height="50" width="50">
|
|
||||||
@endif
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
@if($settings->show_assigned_assets)
|
@if($settings->show_assigned_assets)
|
||||||
@php
|
@php
|
||||||
|
@ -115,25 +467,11 @@
|
||||||
@endforeach
|
@endforeach
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div> <!-- .table-responsive-->
|
|
||||||
</div> <!-- .box-body-->
|
|
||||||
</div><!--.box.box-default-->
|
|
||||||
</div> <!-- .col-md-12-->
|
|
||||||
</div> <!-- .row-->
|
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-12">
|
|
||||||
<div class="box box-default">
|
|
||||||
@if ($user->id)
|
|
||||||
<div class="box-header with-border">
|
|
||||||
<div class="box-heading">
|
|
||||||
<h2 class="box-title"> {{ trans('admin/users/general.software_user', array('name' => $user->first_name)) }}</h2>
|
|
||||||
</div>
|
</div>
|
||||||
</div><!-- /.box-header -->
|
</div> <!-- .table-responsive-->
|
||||||
@endif
|
</div>
|
||||||
|
</div><!-- /asset -->
|
||||||
<div class="box-body">
|
<div class="tab-pane" id="licenses">
|
||||||
<!-- checked out licenses table -->
|
|
||||||
|
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
<table
|
<table
|
||||||
|
@ -176,164 +514,110 @@
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div> <!-- .table-responsive-->
|
</div> <!-- .table-responsive-->
|
||||||
</div> <!-- .box-body-->
|
|
||||||
</div><!--.box.box-default-->
|
|
||||||
</div> <!-- .col-md-12-->
|
|
||||||
</div> <!-- .row-->
|
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-12">
|
|
||||||
<div class="box box-default">
|
|
||||||
@if ($user->id)
|
|
||||||
<div class="box-header with-border">
|
|
||||||
<div class="box-heading">
|
|
||||||
<h2 class="box-title"> {{ trans('general.consumables') }} </h2>
|
|
||||||
</div>
|
</div>
|
||||||
</div><!-- /.box-header -->
|
|
||||||
@endif
|
|
||||||
|
|
||||||
<div class="box-body">
|
<div class="tab-pane" id="accessories">
|
||||||
<!-- checked out consumables table -->
|
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
<table
|
<table
|
||||||
data-cookie-id-table="userConsumables"
|
data-cookie-id-table="userAccessoryTable"
|
||||||
data-pagination="true"
|
data-id-table="userAccessoryTable"
|
||||||
data-id-table="userConsumables"
|
id="userAccessoryTable"
|
||||||
data-search="true"
|
data-search="true"
|
||||||
|
data-pagination="true"
|
||||||
data-side-pagination="client"
|
data-side-pagination="client"
|
||||||
data-show-columns="true"
|
data-show-columns="true"
|
||||||
|
data-show-fullscreen="true"
|
||||||
data-show-export="true"
|
data-show-export="true"
|
||||||
|
data-show-footer="true"
|
||||||
data-show-refresh="true"
|
data-show-refresh="true"
|
||||||
data-sort-order="asc"
|
data-sort-order="asc"
|
||||||
id="userConsumables"
|
data-sort-name="name"
|
||||||
class="table table-striped snipe-table"
|
class="table table-striped snipe-table table-hover"
|
||||||
data-export-options='{
|
data-export-options='{
|
||||||
"fileName": "my-consumables-{{ date('Y-m-d') }}",
|
"fileName": "export-accessory-{{ str_slug($user->username) }}-{{ date('Y-m-d') }}",
|
||||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","delete","download","icon"]
|
||||||
}'>
|
}'>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="col-md-8">{{ trans('general.name') }}</th>
|
<th class="col-md-5">{{ trans('general.name') }}</th>
|
||||||
<th class="col-md-4">{{ trans('general.category') }}</th>
|
<th class="col-md-6" data-footer-formatter="sumFormatter" data-fieldname="purchase_cost">{{ trans('general.purchase_cost') }}</th>
|
||||||
</tr>
|
<th class="col-md-1 hidden-print">{{ trans('general.action') }}</th>
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
@foreach ($user->consumables as $consumable)
|
|
||||||
<tr>
|
|
||||||
<td>{{ $consumable->name }}</td>
|
|
||||||
<td>{{ (($consumable->category) ? $consumable->category->name : 'deleted category') }}</td>
|
|
||||||
</tr>
|
|
||||||
@endforeach
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div> <!-- .box-body-->
|
|
||||||
</div><!--.box.box-default-->
|
|
||||||
</div> <!-- .col-md-12-->
|
|
||||||
</div> <!-- .row-->
|
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-12">
|
|
||||||
<div class="box box-default">
|
|
||||||
|
|
||||||
@if ($user->id)
|
|
||||||
<div class="box-header with-border">
|
|
||||||
<div class="box-heading">
|
|
||||||
<h2 class="box-title"> {{ trans('general.accessories') }}</h2>
|
|
||||||
</div>
|
|
||||||
</div><!-- /.box-header -->
|
|
||||||
@endif
|
|
||||||
|
|
||||||
<div class="box-body">
|
|
||||||
<!-- checked out Accessories table -->
|
|
||||||
|
|
||||||
<div class="table-responsive">
|
|
||||||
<table
|
|
||||||
data-cookie-id-table="userAccessories"
|
|
||||||
data-pagination="true"
|
|
||||||
data-id-table="userAccessories"
|
|
||||||
data-search="true"
|
|
||||||
data-side-pagination="client"
|
|
||||||
data-show-columns="true"
|
|
||||||
data-show-export="true"
|
|
||||||
data-show-refresh="true"
|
|
||||||
data-sort-order="asc"
|
|
||||||
id="userAccessories"
|
|
||||||
class="table table-striped snipe-table"
|
|
||||||
data-export-options='{
|
|
||||||
"fileName": "my-accessories-{{ date('Y-m-d') }}",
|
|
||||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
|
||||||
}'>
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th class="col-md-8">{{ trans('general.name') }}</th>
|
|
||||||
<th class="col-md-4">{{ trans('general.category') }}</th>
|
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@foreach ($user->accessories as $accessory)
|
@foreach ($user->accessories as $accessory)
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ $accessory->name }}</td>
|
<td>{!! $accessory->name !!}</td>
|
||||||
<td>{{ $accessory->category->name }}</td>
|
<td>
|
||||||
|
{!! Helper::formatCurrencyOutput($accessory->purchase_cost) !!}
|
||||||
|
</td>
|
||||||
|
<td class="hidden-print">
|
||||||
|
@can('checkin', $accessory)
|
||||||
|
<a href="{{ route('accessories.checkin.show', array('accessoryID'=> $accessory->pivot->id, 'backto'=>'user')) }}" class="btn btn-primary btn-sm hidden-print">{{ trans('general.checkin') }}</a>
|
||||||
|
@endcan
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@endforeach
|
@endforeach
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
</div><!-- /accessories-tab -->
|
||||||
|
|
||||||
</div> <!-- .box-body-->
|
<div class="tab-pane" id="consumables">
|
||||||
</div><!--.box.box-default-->
|
|
||||||
</div> <!-- .col-md-12-->
|
|
||||||
</div> <!-- .row-->
|
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-12">
|
|
||||||
<div class="box box-default">
|
|
||||||
@if ($user->id)
|
|
||||||
<div class="box-header with-border">
|
|
||||||
<div class="box-heading">
|
|
||||||
<h2 class="box-title"> {{ trans('general.history') }}</h2>
|
|
||||||
</div>
|
|
||||||
</div><!-- /.box-header -->
|
|
||||||
@endif
|
|
||||||
|
|
||||||
<div class="box-body">
|
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
<table
|
<table
|
||||||
data-cookie-id-table="userActivityReport"
|
data-cookie-id-table="userConsumableTable"
|
||||||
data-pagination="true"
|
data-id-table="userConsumableTable"
|
||||||
data-id-table="userActivityReport"
|
id="userConsumableTable"
|
||||||
data-search="true"
|
data-search="true"
|
||||||
data-side-pagination="server"
|
data-pagination="true"
|
||||||
|
data-side-pagination="client"
|
||||||
data-show-columns="true"
|
data-show-columns="true"
|
||||||
|
data-show-fullscreen="true"
|
||||||
data-show-export="true"
|
data-show-export="true"
|
||||||
|
data-show-footer="true"
|
||||||
data-show-refresh="true"
|
data-show-refresh="true"
|
||||||
data-sort-order="desc"
|
data-sort-order="asc"
|
||||||
id="userActivityReport"
|
data-sort-name="name"
|
||||||
class="table table-striped snipe-table"
|
class="table table-striped snipe-table table-hover"
|
||||||
data-url="{{route('api.activity.index', ['target_id' => $user->id, 'target_type' => 'User', 'order' => 'desc']) }}"
|
|
||||||
data-export-options='{
|
data-export-options='{
|
||||||
"fileName": "my-history-{{ date('Y-m-d') }}",
|
"fileName": "export-consumable-{{ str_slug($user->username) }}-{{ date('Y-m-d') }}",
|
||||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","delete","download","icon"]
|
||||||
}'>
|
}'>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th data-switchable="true" data-visible="true" data-field="icon" style="width: 40px;" class="hidden-xs" data-formatter="iconFormatter">Icon</th>
|
<th class="col-md-3">{{ trans('general.name') }}</th>
|
||||||
<th data-switchable="true" data-visible="true" class="col-sm-3" data-field="created_at" data-formatter="dateDisplayFormatter">{{ trans('general.date') }}</th>
|
<th class="col-md-2" data-footer-formatter="sumFormatter" data-fieldname="purchase_cost">{{ trans('general.purchase_cost') }}</th>
|
||||||
<th data-switchable="true" data-visible="true" class="col-sm-3" data-field="admin" data-formatter="usersLinkObjFormatter">{{ trans('general.admin') }}</th>
|
<th class="col-md-2">{{ trans('general.date') }}</th>
|
||||||
<th data-switchable="true" data-visible="true" class="col-sm-3" data-field="action_type">{{ trans('general.action') }}</th>
|
<th class="col-md-5">{{ trans('general.notes') }}</th>
|
||||||
<th data-switchable="true" data-visible="true" class="col-sm-3" data-field="item" data-formatter="polymorphicItemFormatter">{{ trans('general.item') }}</th>
|
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
@foreach ($user->consumables as $consumable)
|
||||||
|
<tr>
|
||||||
|
<td>{!! $consumable->name !!}</td>
|
||||||
|
<td>
|
||||||
|
{!! Helper::formatCurrencyOutput($consumable->purchase_cost) !!}
|
||||||
|
</td>
|
||||||
|
<td>{{ Helper::getFormattedDateObject($consumable->pivot->created_at, 'datetime', false) }}</td>
|
||||||
|
<td>{{ $consumable->pivot->note }}</td>
|
||||||
|
</tr>
|
||||||
|
@endforeach
|
||||||
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div> <!--.table-responsive-->
|
</div>
|
||||||
|
</div><!-- /consumables-tab -->
|
||||||
|
|
||||||
|
</div><!-- /.tab-content -->
|
||||||
|
</div><!-- nav-tabs-custom -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div> <!-- .box-body-->
|
|
||||||
</div><!--.box.box-default-->
|
|
||||||
</div> <!-- .col-md-12-->
|
|
||||||
</div> <!-- .row-->
|
|
||||||
|
|
||||||
@stop
|
@stop
|
||||||
|
|
||||||
|
|
|
@ -279,6 +279,23 @@ Route::group(['prefix' => 'account', 'middleware' => ['auth']], function () {
|
||||||
->name('account.accept.item');
|
->name('account.accept.item');
|
||||||
|
|
||||||
Route::post('accept/{id}', [Account\AcceptanceController::class, 'store']);
|
Route::post('accept/{id}', [Account\AcceptanceController::class, 'store']);
|
||||||
|
|
||||||
|
Route::get(
|
||||||
|
'print',
|
||||||
|
[
|
||||||
|
ProfileController::class,
|
||||||
|
'printInventory'
|
||||||
|
]
|
||||||
|
)->name('profile.print');
|
||||||
|
|
||||||
|
Route::post(
|
||||||
|
'email',
|
||||||
|
[
|
||||||
|
ProfileController::class,
|
||||||
|
'emailAssetList'
|
||||||
|
]
|
||||||
|
)->name('profile.email_assets');
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
Route::group(['middleware' => ['auth']], function () {
|
Route::group(['middleware' => ['auth']], function () {
|
||||||
|
|
Loading…
Reference in a new issue