ajout app
This commit is contained in:
81
SNIPE-IT/resources/views/accessories/checkin.blade.php
Normal file
81
SNIPE-IT/resources/views/accessories/checkin.blade.php
Normal file
@ -0,0 +1,81 @@
|
||||
@extends('layouts/default')
|
||||
|
||||
{{-- Page title --}}
|
||||
@section('title')
|
||||
{{ trans('admin/accessories/general.checkin') }}
|
||||
@parent
|
||||
@stop
|
||||
|
||||
@section('header_right')
|
||||
<a href="{{ URL::previous() }}" class="btn btn-primary pull-right">
|
||||
{{ trans('general.back') }}</a>
|
||||
@stop
|
||||
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-7">
|
||||
<form class="form-horizontal" method="post" action="" autocomplete="off">
|
||||
<!-- CSRF Token -->
|
||||
<input type="hidden" name="_token" value="{{ csrf_token() }}" />
|
||||
|
||||
<div class="box box-default">
|
||||
@if ($accessory->id)
|
||||
<div class="box-header with-border">
|
||||
<h2 class="box-title">{{ $accessory->name }}</h2>
|
||||
</div><!-- /.box-header -->
|
||||
@endif
|
||||
|
||||
<div class="box-body">
|
||||
<!-- CSRF Token -->
|
||||
<input type="hidden" name="_token" value="{{ csrf_token() }}" />
|
||||
|
||||
@if ($accessory->name)
|
||||
<!-- accessory name -->
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">{{ trans('admin/hardware/form.name') }}</label>
|
||||
<div class="col-md-6">
|
||||
<p class="form-control-static">{{ $accessory->name }}</p>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Note -->
|
||||
<div class="form-group {{ $errors->has('note') ? 'error' : '' }}">
|
||||
<label for="note" class="col-md-3 control-label">{{ trans('admin/hardware/form.notes') }}</label>
|
||||
<div class="col-md-7">
|
||||
<textarea class="col-md-6 form-control" id="note" name="note">{{ old('note', $accessory->note) }}</textarea>
|
||||
{!! $errors->first('note', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
<!-- Checkout/Checkin Date -->
|
||||
<div class="form-group{{ $errors->has('checkin_at') ? ' has-error' : '' }}">
|
||||
{{ Form::label('checkin_at', trans('admin/hardware/form.checkin_date'), array('class' => 'col-md-3 control-label')) }}
|
||||
<div class="col-md-7">
|
||||
<div class="input-group col-md-5 required" style="padding-left: 0px;">
|
||||
<div class="input-group date" data-date-clear-btn="true" data-provide="datepicker" data-date-format="yyyy-mm-dd" data-date-end-date="0d" data-autoclose="true">
|
||||
<input type="text" class="form-control" placeholder="{{ trans('general.select_date') }}" name="checkin_at" id="checkin_at" value="{{ Request::old('checkin_at', date('Y-m-d')) }}">
|
||||
<span class="input-group-addon"><i class="fas fa-calendar"></i></span>
|
||||
</div>
|
||||
{!! $errors->first('checkin_at', '<span class="alert-msg"><i class="fas fa-times"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
<a class="btn btn-link" href="{{ URL::previous() }}">{{ trans('button.cancel') }}</a>
|
||||
<button type="submit" class="btn btn-primary pull-right"><i class="fas fa-check icon-white" aria-hidden="true"></i>
|
||||
{{ trans('general.checkin') }}</button>
|
||||
</div>
|
||||
|
||||
|
||||
</div> <!-- .box.box-default -->
|
||||
</form>
|
||||
</div> <!-- .col-md-9-->
|
||||
</div> <!-- .row -->
|
||||
@stop
|
101
SNIPE-IT/resources/views/accessories/checkout.blade.php
Normal file
101
SNIPE-IT/resources/views/accessories/checkout.blade.php
Normal file
@ -0,0 +1,101 @@
|
||||
@extends('layouts/default')
|
||||
|
||||
{{-- Page title --}}
|
||||
@section('title')
|
||||
{{ trans('admin/accessories/general.checkout') }}
|
||||
@parent
|
||||
@stop
|
||||
@section('header_right')
|
||||
<a href="{{ URL::previous() }}" class="btn btn-primary pull-right">
|
||||
{{ trans('general.back') }}</a>
|
||||
@stop
|
||||
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-9">
|
||||
<form class="form-horizontal" id="checkout_form" method="post" action="" autocomplete="off">
|
||||
<!-- CSRF Token -->
|
||||
<input type="hidden" name="_token" value="{{ csrf_token() }}" />
|
||||
|
||||
<div class="box box-default">
|
||||
@if ($accessory->id)
|
||||
<div class="box-header with-border">
|
||||
<h2 class="box-title">{{ $accessory->name }}</h2>
|
||||
</div><!-- /.box-header -->
|
||||
@endif
|
||||
|
||||
<div class="box-body">
|
||||
@if ($accessory->name)
|
||||
<!-- accessory name -->
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">{{ trans('admin/accessories/general.accessory_name') }}</label>
|
||||
<div class="col-md-6">
|
||||
<p class="form-control-static">{{ $accessory->name }}</p>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if ($accessory->category)
|
||||
<!-- accessory name -->
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">{{ trans('admin/accessories/general.accessory_category') }}</label>
|
||||
<div class="col-md-6">
|
||||
<p class="form-control-static">{{ $accessory->category->name }}</p>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- User -->
|
||||
|
||||
@include ('partials.forms.edit.user-select', ['translated_name' => trans('general.select_user'), 'fieldname' => 'assigned_to'])
|
||||
|
||||
|
||||
@if ($accessory->requireAcceptance() || $accessory->getEula() || ($snipeSettings->webhook_endpoint!=''))
|
||||
<div class="form-group notification-callout">
|
||||
<div class="col-md-8 col-md-offset-3">
|
||||
<div class="callout callout-info">
|
||||
|
||||
@if ($accessory->requireAcceptance())
|
||||
<i class="far fa-envelope"></i>
|
||||
{{ trans('admin/categories/general.required_acceptance') }}
|
||||
<br>
|
||||
@endif
|
||||
|
||||
@if ($accessory->getEula())
|
||||
<i class="far fa-envelope"></i>
|
||||
{{ trans('admin/categories/general.required_eula') }}
|
||||
<br>
|
||||
@endif
|
||||
|
||||
@if ($snipeSettings->webhook_endpoint!='')
|
||||
<i class="fab fa-slack"></i>
|
||||
{{ trans('general.webhook_msg_note') }}
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
<!-- Note -->
|
||||
<div class="form-group {{ $errors->has('note') ? 'error' : '' }}">
|
||||
<label for="note" class="col-md-3 control-label">{{ trans('admin/hardware/form.notes') }}</label>
|
||||
<div class="col-md-7">
|
||||
<textarea class="col-md-6 form-control" id="note" name="note">{{ old('note', $accessory->note) }}</textarea>
|
||||
{!! $errors->first('note', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
<a class="btn btn-link" href="{{ URL::previous() }}">{{ trans('button.cancel') }}</a>
|
||||
<button type="submit" id="submit_button" class="btn btn-primary pull-right"><i class="fas fa-check icon-white" aria-hidden="true"></i> {{ trans('general.checkout') }}</button>
|
||||
</div>
|
||||
</div> <!-- .box.box-default -->
|
||||
</form>
|
||||
</div> <!-- .col-md-9-->
|
||||
</div> <!-- .row -->
|
||||
|
||||
|
||||
@stop
|
28
SNIPE-IT/resources/views/accessories/edit.blade.php
Normal file
28
SNIPE-IT/resources/views/accessories/edit.blade.php
Normal file
@ -0,0 +1,28 @@
|
||||
@extends('layouts/edit-form', [
|
||||
'createText' => trans('admin/accessories/general.create') ,
|
||||
'updateText' => trans('admin/accessories/general.update'),
|
||||
'helpPosition' => 'right',
|
||||
'helpText' => trans('help.accessories'),
|
||||
'formAction' => (isset($item->id)) ? route('accessories.update', ['accessory' => $item->id]) : route('accessories.store'),
|
||||
])
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('inputFields')
|
||||
|
||||
@include ('partials.forms.edit.company-select', ['translated_name' => trans('general.company'), 'fieldname' => 'company_id'])
|
||||
@include ('partials.forms.edit.name', ['translated_name' => trans('admin/accessories/general.accessory_name')])
|
||||
@include ('partials.forms.edit.category-select', ['translated_name' => trans('general.category'), 'fieldname' => 'category_id', 'required' => 'true','category_type' => 'accessory'])
|
||||
@include ('partials.forms.edit.supplier-select', ['translated_name' => trans('general.supplier'), 'fieldname' => 'supplier_id'])
|
||||
@include ('partials.forms.edit.manufacturer-select', ['translated_name' => trans('general.manufacturer'), 'fieldname' => 'manufacturer_id'])
|
||||
@include ('partials.forms.edit.location-select', ['translated_name' => trans('general.location'), 'fieldname' => 'location_id'])
|
||||
@include ('partials.forms.edit.model_number')
|
||||
@include ('partials.forms.edit.order_number')
|
||||
@include ('partials.forms.edit.purchase_date')
|
||||
@include ('partials.forms.edit.purchase_cost')
|
||||
@include ('partials.forms.edit.quantity')
|
||||
@include ('partials.forms.edit.minimum_quantity')
|
||||
@include ('partials.forms.edit.notes')
|
||||
@include ('partials.forms.edit.image-upload', ['image_path' => app('accessories_upload_path')])
|
||||
|
||||
|
||||
@stop
|
56
SNIPE-IT/resources/views/accessories/index.blade.php
Normal file
56
SNIPE-IT/resources/views/accessories/index.blade.php
Normal file
@ -0,0 +1,56 @@
|
||||
@extends('layouts/default')
|
||||
|
||||
{{-- Page title --}}
|
||||
@section('title')
|
||||
{{ trans('general.accessories') }}
|
||||
@parent
|
||||
@stop
|
||||
|
||||
@section('header_right')
|
||||
@can('create', \App\Models\Accessory::class)
|
||||
<a href="{{ route('accessories.create') }}" accesskey="n" class="btn btn-primary pull-right"> {{ trans('general.create') }}</a>
|
||||
@endcan
|
||||
@stop
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<div class="box box-default">
|
||||
<div class="box-body">
|
||||
<div class="table-responsive">
|
||||
|
||||
<table
|
||||
data-columns="{{ \App\Presenters\AccessoryPresenter::dataTableLayout() }}"
|
||||
data-cookie-id-table="accessoriesTable"
|
||||
data-pagination="true"
|
||||
data-id-table="accessoriesTable"
|
||||
data-search="true"
|
||||
data-side-pagination="server"
|
||||
data-show-columns="true"
|
||||
data-show-fullscreen="true"
|
||||
data-show-export="true"
|
||||
data-show-refresh="true"
|
||||
data-show-footer="true"
|
||||
data-sort-order="asc"
|
||||
id="accessoriesTable"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{route('api.accessories.index') }}"
|
||||
data-export-options='{
|
||||
"fileName": "export-accessories-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@stop
|
||||
|
||||
@section('moar_scripts')
|
||||
@include ('partials.bootstrap-table')
|
||||
@stop
|
379
SNIPE-IT/resources/views/accessories/view.blade.php
Normal file
379
SNIPE-IT/resources/views/accessories/view.blade.php
Normal file
@ -0,0 +1,379 @@
|
||||
@extends('layouts/default')
|
||||
|
||||
{{-- Page title --}}
|
||||
@section('title')
|
||||
|
||||
{{ $accessory->name }}
|
||||
{{ trans('general.accessory') }}
|
||||
@if ($accessory->model_number!='')
|
||||
({{ $accessory->model_number }})
|
||||
@endif
|
||||
|
||||
@parent
|
||||
@stop
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
{{-- Page content --}}
|
||||
<div class="row">
|
||||
<div class="col-md-9">
|
||||
|
||||
<!-- Custom Tabs -->
|
||||
<div class="nav-tabs-custom">
|
||||
<ul class="nav nav-tabs hidden-print">
|
||||
|
||||
<li class="active">
|
||||
<a href="#checkedout" data-toggle="tab">
|
||||
<span class="hidden-lg hidden-md">
|
||||
<i class="fas fa-info-circle fa-2x" aria-hidden="true"></i>
|
||||
</span>
|
||||
<span class="hidden-xs hidden-sm">{{ trans('admin/users/general.info') }}</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="#history" data-toggle="tab">
|
||||
<span class="hidden-lg hidden-md">
|
||||
<i class="fas fa-history fa-2x" aria-hidden="true"></i></span>
|
||||
<span class="hidden-xs hidden-sm">{{ trans('general.history') }}</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
@can('accessories.files', $accessory)
|
||||
<li>
|
||||
<a href="#files" data-toggle="tab">
|
||||
<span class="hidden-lg hidden-md">
|
||||
<i class="far fa-file fa-2x" aria-hidden="true"></i></span>
|
||||
<span class="hidden-xs hidden-sm">{{ trans('general.file_uploads') }}
|
||||
{!! ($accessory->uploads->count() > 0 ) ? '<badge class="badge badge-secondary">'.number_format($accessory->uploads->count()).'</badge>' : '' !!}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
@endcan
|
||||
|
||||
@can('update', $accessory)
|
||||
<li class="pull-right">
|
||||
<a href="#" data-toggle="modal" data-target="#uploadFileModal">
|
||||
<i class="fas fa-paperclip" aria-hidden="true"></i> {{ trans('button.upload') }}
|
||||
</a>
|
||||
</li>
|
||||
@endcan
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
|
||||
<div class="tab-pane active" id="checkedout">
|
||||
<div class="table table-responsive">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<table
|
||||
data-cookie-id-table="usersTable"
|
||||
data-pagination="true"
|
||||
data-id-table="usersTable"
|
||||
data-search="true"
|
||||
data-side-pagination="server"
|
||||
data-show-columns="true"
|
||||
data-show-fullscreen="true"
|
||||
data-show-export="true"
|
||||
data-show-refresh="true"
|
||||
data-sort-order="asc"
|
||||
id="usersTable"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{ route('api.accessories.checkedout', $accessory->id) }}"
|
||||
data-export-options='{
|
||||
"fileName": "export-accessories-{{ str_slug($accessory->name) }}-users-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-searchable="false" data-formatter="usersLinkFormatter" data-sortable="false" data-field="name">{{ trans('general.user') }}</th>
|
||||
<th data-searchable="false" data-sortable="false" data-field="checkout_notes">{{ trans('general.notes') }}</th>
|
||||
<th data-searchable="false" data-formatter="dateDisplayFormatter" data-sortable="false" data-field="last_checkout">{{ trans('admin/hardware/table.checkout_date') }}</th>
|
||||
<th data-searchable="false" data-sortable="false" data-field="actions" data-formatter="accessoriesInOutFormatter">{{ trans('table.actions') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div><!--col-md-9-->
|
||||
</div> <!-- close tab-pane div -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- history tab pane -->
|
||||
<div class="tab-pane fade" id="history">
|
||||
<div class="table table-responsive">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<table
|
||||
class="table table-striped snipe-table"
|
||||
data-cookie-id-table="AccessoryHistoryTable"
|
||||
data-id-table="AccessoryHistoryTable"
|
||||
id="AccessoryHistoryTable"
|
||||
data-pagination="true"
|
||||
data-show-columns="true"
|
||||
data-side-pagination="server"
|
||||
data-show-refresh="true"
|
||||
data-show-export="true"
|
||||
data-sort-order="desc"
|
||||
data-export-options='{
|
||||
"fileName": "export-{{ str_slug($accessory->name) }}-history-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'
|
||||
data-url="{{ route('api.activity.index', ['item_id' => $accessory->id, 'item_type' => 'accessory']) }}">
|
||||
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="col-sm-2" data-visible="false" data-sortable="true" data-field="created_at" data-formatter="dateDisplayFormatter">{{ trans('general.record_created') }}</th>
|
||||
<th class="col-sm-2"data-visible="true" data-sortable="true" data-field="admin" data-formatter="usersLinkObjFormatter">{{ trans('general.admin') }}</th>
|
||||
<th class="col-sm-2" data-sortable="true" data-visible="true" data-field="action_type">{{ trans('general.action') }}</th>
|
||||
<th class="col-sm-2" data-field="file" data-visible="false" data-formatter="fileUploadNameFormatter">{{ trans('general.file_name') }}</th>
|
||||
<th class="col-sm-2" data-sortable="true" data-visible="true" data-field="item" data-formatter="polymorphicItemFormatter">{{ trans('general.item') }}</th>
|
||||
<th class="col-sm-2" data-visible="true" data-field="target" data-formatter="polymorphicItemFormatter">{{ trans('general.target') }}</th>
|
||||
<th class="col-sm-2" data-sortable="true" data-visible="true" data-field="note">{{ trans('general.notes') }}</th>
|
||||
<th class="col-sm-2" data-visible="true" data-field="action_date" data-formatter="dateDisplayFormatter">{{ trans('general.date') }}</th>
|
||||
@if ($snipeSettings->require_accept_signature=='1')
|
||||
<th class="col-md-3" data-field="signature_file" data-visible="false" data-formatter="imageFormatter">{{ trans('general.signature') }}</th>
|
||||
@endif
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div> <!-- /.col-md-12-->
|
||||
</div> <!-- /.row-->
|
||||
</div><!--tab history-->
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@can('accessories.files', $accessory)
|
||||
<div class="tab-pane" id="files">
|
||||
|
||||
<div class="table table-responsive">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<table
|
||||
data-cookie-id-table="accessoryUploadsTable"
|
||||
data-id-table="accessoryUploadsTable"
|
||||
id="accessoryUploadsTable"
|
||||
data-search="true"
|
||||
data-pagination="true"
|
||||
data-side-pagination="client"
|
||||
data-show-columns="true"
|
||||
data-show-export="true"
|
||||
data-show-footer="true"
|
||||
data-toolbar="#upload-toolbar"
|
||||
data-show-refresh="true"
|
||||
data-sort-order="asc"
|
||||
data-sort-name="name"
|
||||
class="table table-striped snipe-table"
|
||||
data-export-options='{
|
||||
"fileName": "export-accessories-uploads-{{ str_slug($accessory->name) }}-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","delete","download","icon"]
|
||||
}'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-visible="true" data-field="icon" data-sortable="true">{{trans('general.file_type')}}</th>
|
||||
<th class="col-md-2" data-searchable="true" data-visible="true" data-field="image">{{ trans('general.image') }}</th>
|
||||
<th class="col-md-2" data-searchable="true" data-visible="true" data-field="filename" data-sortable="true">{{ trans('general.file_name') }}</th>
|
||||
<th class="col-md-1" data-searchable="true" data-visible="true" data-field="filesize">{{ trans('general.filesize') }}</th>
|
||||
<th class="col-md-2" data-searchable="true" data-visible="true" data-field="notes" data-sortable="true">{{ trans('general.notes') }}</th>
|
||||
<th class="col-md-1" data-searchable="true" data-visible="true" data-field="download">{{ trans('general.download') }}</th>
|
||||
<th class="col-md-2" data-searchable="true" data-visible="true" data-field="created_at" data-sortable="true">{{ trans('general.created_at') }}</th>
|
||||
<th class="col-md-1" data-searchable="true" data-visible="true" data-field="actions">{{ trans('table.actions') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if ($accessory->uploads->count() > 0)
|
||||
@foreach ($accessory->uploads as $file)
|
||||
<tr>
|
||||
<td>
|
||||
<i class="{{ Helper::filetype_icon($file->filename) }} icon-med" aria-hidden="true"></i>
|
||||
<span class="sr-only">{{ Helper::filetype_icon($file->filename) }}</span>
|
||||
|
||||
</td>
|
||||
<td>
|
||||
@if ($file->filename)
|
||||
@if ( Helper::checkUploadIsImage($file->get_src('accessories')))
|
||||
<a href="{{ route('show.accessoryfile', ['accessoryId' => $accessory->id, 'fileId' => $file->id, 'download' => 'false']) }}" data-toggle="lightbox" data-type="image"><img src="{{ route('show.accessoryfile', ['accessoryId' => $accessory->id, 'fileId' => $file->id]) }}" class="img-thumbnail" style="max-width: 50px;"></a>
|
||||
@endif
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
{{ $file->filename }}
|
||||
</td>
|
||||
<td data-value="{{ (Storage::exists('private_uploads/accessories/'.$file->filename) ? Storage::size('private_uploads/accessories/'.$file->filename) : '') }}">
|
||||
{{ @Helper::formatFilesizeUnits(Storage::exists('private_uploads/accessories/'.$file->filename) ? Storage::size('private_uploads/accessories/'.$file->filename) : '') }}
|
||||
</td>
|
||||
|
||||
<td>
|
||||
@if ($file->note)
|
||||
{{ $file->note }}
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if ($file->filename)
|
||||
<a href="{{ route('show.accessoryfile', [$accessory->id, $file->id]) }}" class="btn btn-sm btn-default">
|
||||
<i class="fas fa-download" aria-hidden="true"></i>
|
||||
<span class="sr-only">{{ trans('general.download') }}</span>
|
||||
</a>
|
||||
|
||||
<a href="{{ route('show.accessoryfile', [$accessory->id, $file->id, 'inline' => 'true']) }}" class="btn btn-sm btn-default" target="_blank">
|
||||
<i class="fa fa-external-link" aria-hidden="true"></i>
|
||||
</a>
|
||||
|
||||
@endif
|
||||
</td>
|
||||
<td>{{ $file->created_at }}</td>
|
||||
<td>
|
||||
<a class="btn delete-asset btn-danger btn-sm" href="{{ route('delete/accessoryfile', [$accessory->id, $file->id]) }}" data-content="{{ trans('general.delete_confirm', ['item' => $file->filename]) }}" data-title="{{ trans('general.delete') }}">
|
||||
<i class="fas fa-trash icon-white" aria-hidden="true"></i>
|
||||
<span class="sr-only">{{ trans('general.delete') }}</span>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@else
|
||||
<tr>
|
||||
<td colspan="8">{{ trans('general.no_results') }}</td>
|
||||
</tr>
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- /.tab-pane -->
|
||||
@endcan
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<!-- side address column -->
|
||||
|
||||
<div class="col-md-3">
|
||||
|
||||
@if ($accessory->image!='')
|
||||
<div class="row">
|
||||
<div class="col-md-12 text-center" style="padding-bottom: 15px;">
|
||||
<a href="{{ Storage::disk('public')->url('accessories/'.e($accessory->image)) }}" data-toggle="lightbox"><img src="{{ Storage::disk('public')->url('accessories/'.e($accessory->image)) }}" class="img-responsive img-thumbnail" alt="{{ $accessory->name }}"></a>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if ($accessory->company)
|
||||
<div class="row">
|
||||
<div class="col-md-3" style="padding-bottom: 15px;">
|
||||
<strong> {{ trans('general.company')}}</strong>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
<a href="{{ route('companies.show', $accessory->company->id) }}">{{ $accessory->company->name }} </a>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
|
||||
@if ($accessory->category)
|
||||
<div class="row">
|
||||
<div class="col-md-3" style="padding-bottom: 10px;">
|
||||
<strong>{{ trans('general.category')}}</strong>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
<a href="{{ route('categories.show', $accessory->category->id) }}">{{ $accessory->category->name }} </a>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
|
||||
@if ($accessory->notes)
|
||||
<div class="row">
|
||||
<div class="col-md-3" style="padding-bottom: 10px;">
|
||||
<strong>
|
||||
{{ trans('general.notes') }}
|
||||
</strong>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
{!! nl2br(Helper::parseEscapedMarkedownInline($accessory->notes)) !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endif
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-3" style="padding-bottom: 10px;">
|
||||
<strong>{{ trans('admin/accessories/general.remaining') }}</strong>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
{{ $accessory->numRemaining() }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-3" style="padding-bottom: 10px;">
|
||||
<strong>{{ trans('general.checked_out') }}</strong>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
{{ $accessory->users_count }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3 pull-right">
|
||||
@can('checkout', \App\Models\Accessory::class)
|
||||
<div class="text-center" style="padding-top:5px;">
|
||||
<a href="{{ route('accessories.checkout.show', $accessory->id) }}" style="margin-right:5px; width:100%" class="btn btn-primary btn-sm" {{ (($accessory->numRemaining() > 0 ) ? '' : ' disabled') }}>{{ trans('general.checkout') }}</a>
|
||||
</div>
|
||||
@endcan
|
||||
@can('update', \App\Models\Accessory::class)
|
||||
<div class="text-center" style="padding-top:5px;">
|
||||
<a href="{{ route('accessories.edit', $accessory->id) }}" style="margin-right:5px; width:100%" class="btn btn-primary btn-sm">{{ trans('admin/accessories/general.edit') }}</a>
|
||||
</div>
|
||||
@endcan
|
||||
@can('update', \App\Models\Accessory::class)
|
||||
<div class="text-center" style="padding-top:5px;">
|
||||
<a href="{{ route('clone/accessories', $accessory->id) }}" style="margin-right:5px; width:100%" class="btn btn-primary btn-sm">{{ trans('admin/accessories/general.clone') }}</a>
|
||||
</div>
|
||||
@endcan
|
||||
|
||||
@can('delete', $accessory)
|
||||
@if ($accessory->users_count == 0)
|
||||
<div class="text-center" style="padding-top:5px;">
|
||||
<button class="btn btn-block btn-danger delete-asset" style="padding-top:5px;" data-toggle="modal" data-title="{{ trans('general.delete') }}" data-content="{{ trans('general.delete_confirm_no_undo', ['item' => $accessory->name]) }}" data-target="#dataConfirmModal">
|
||||
{{ trans('general.delete') }}
|
||||
</button>
|
||||
</div>
|
||||
@else
|
||||
<div class="text-center" style="padding-top:5px;">
|
||||
<span data-tooltip="true" title=" {{ trans('admin/accessories/general.delete_disabled') }}">
|
||||
<a href="#" class="btn btn-block btn-danger disabled">
|
||||
{{ trans('general.delete') }}
|
||||
</a>
|
||||
</span>
|
||||
</div>
|
||||
@endif
|
||||
@endcan
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@can('accessories.files', Accessory::class)
|
||||
@include ('modals.upload-file', ['item_type' => 'accessory', 'item_id' => $accessory->id])
|
||||
@endcan
|
||||
@stop
|
||||
|
||||
|
||||
|
||||
|
||||
@section('moar_scripts')
|
||||
<script>
|
||||
$('#dataConfirmModal').on('show.bs.modal', function (event) {
|
||||
var content = $(event.relatedTarget).data('content');
|
||||
var title = $(event.relatedTarget).data('title');
|
||||
$(this).find(".modal-body").text(content);
|
||||
$(this).find(".modal-header").text(title);
|
||||
});
|
||||
</script>
|
||||
@include ('partials.bootstrap-table')
|
||||
@stop
|
@ -0,0 +1,47 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<style>
|
||||
body {
|
||||
font-family:'Dejavu Sans', Arial, Helvetica, sans-serif;
|
||||
font-size: 11px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@if ($logo)
|
||||
<center>
|
||||
<img src="{{ $logo }}">
|
||||
<p>{{$company_name}}</p>
|
||||
</center>
|
||||
@endif
|
||||
<br>
|
||||
|
||||
<p>
|
||||
{{ trans('general.date') }}: {{ date($date_settings) }} <br>
|
||||
{{ trans('general.asset_model') }}: {{ $item_model }}<br>
|
||||
</p>
|
||||
|
||||
@if ($eula)
|
||||
<hr>
|
||||
{!! $eula !!}
|
||||
<hr>
|
||||
@endif
|
||||
|
||||
|
||||
<p>
|
||||
{{ trans('general.assigned_date') }}: {{$check_out_date}}<br>
|
||||
{{ trans('general.assignee') }}: {{$assigned_to}}<br>
|
||||
{{ trans('general.accepted_date') }}: {{$accepted_date}}
|
||||
</p>
|
||||
|
||||
|
||||
@if ($signature!='')
|
||||
<img src="{{ $signature }}" style="max-width: 600px; border-bottom: black solid 1px;">
|
||||
@endif
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,50 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<style>
|
||||
body {
|
||||
font-family:'Dejavu Sans', Arial, Helvetica, sans-serif;
|
||||
font-size: 11px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@if ($logo)
|
||||
<center>
|
||||
<img src="{{ $logo }}">
|
||||
<p>{{$company_name}}</p>
|
||||
</center>
|
||||
@endif
|
||||
<br>
|
||||
|
||||
<p>
|
||||
{{ trans('general.date') }}: {{ date($date_settings) }} <br>
|
||||
{{ trans('general.asset_tag') }}: {{ $item_tag }}<br>
|
||||
{{ trans('general.asset_model') }}: {{ $item_model }}<br>
|
||||
{{ trans('admin/hardware/form.serial') }}: {{ $item_serial }}
|
||||
</p>
|
||||
|
||||
|
||||
@if ($eula)
|
||||
<hr>
|
||||
{!! $eula !!}
|
||||
<hr>
|
||||
@endif
|
||||
|
||||
|
||||
<p>
|
||||
{{ trans('general.assigned_date') }}: {{$check_out_date}}<br>
|
||||
{{ trans('general.assignee') }}: {{$assigned_to}}<br>
|
||||
{{ trans('general.accepted_date') }}: {{$accepted_date}}
|
||||
</p>
|
||||
|
||||
|
||||
@if ($signature!='')
|
||||
<img src="{{ $signature }}" style="max-width: 600px; border-bottom: black solid 1px;">
|
||||
@endif
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,47 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<style>
|
||||
body {
|
||||
font-family:'Dejavu Sans', Arial, Helvetica, sans-serif;
|
||||
font-size: 11px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@if ($logo)
|
||||
<center>
|
||||
<img src="{{ $logo }}">
|
||||
<p>{{$company_name}}</p>
|
||||
</center>
|
||||
@endif
|
||||
<br>
|
||||
|
||||
<p>
|
||||
{{ trans('general.date') }}: {{ date($date_settings) }} <br>
|
||||
{{ trans('general.component') }}: {{ $item_model }}<br>
|
||||
</p>
|
||||
|
||||
@if ($eula)
|
||||
<hr>
|
||||
{!! $eula !!}
|
||||
<hr>
|
||||
@endif
|
||||
|
||||
|
||||
<p>
|
||||
{{ trans('general.assigned_date') }}: {{$check_out_date}}<br>
|
||||
{{ trans('general.assignee') }}: {{$assigned_to}}<br>
|
||||
{{ trans('general.accepted_date') }}: {{$accepted_date}}
|
||||
</p>
|
||||
|
||||
|
||||
@if ($signature!='')
|
||||
<img src="{{ $signature }}" style="max-width: 600px; border-bottom: black solid 1px;">
|
||||
@endif
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,47 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<style>
|
||||
body {
|
||||
font-family:'Dejavu Sans', Arial, Helvetica, sans-serif;
|
||||
font-size: 11px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@if ($logo)
|
||||
<center>
|
||||
<img src="{{ $logo }}">
|
||||
<p>{{$company_name}}</p>
|
||||
</center>
|
||||
@endif
|
||||
<br>
|
||||
|
||||
<p>
|
||||
{{ trans('general.date') }}: {{ date($date_settings) }} <br>
|
||||
{{ trans('general.consumable') }}: {{ $item_model }}<br>
|
||||
</p>
|
||||
|
||||
@if ($eula)
|
||||
<hr>
|
||||
{!! $eula !!}
|
||||
<hr>
|
||||
@endif
|
||||
|
||||
|
||||
<p>
|
||||
{{ trans('general.assigned_date') }}: {{$check_out_date}}<br>
|
||||
{{ trans('general.assignee') }}: {{$assigned_to}}<br>
|
||||
{{ trans('general.accepted_date') }}: {{$accepted_date}}
|
||||
</p>
|
||||
|
||||
|
||||
@if ($signature!='')
|
||||
<img src="{{ $signature }}" style="max-width: 600px; border-bottom: black solid 1px;">
|
||||
@endif
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,47 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<style>
|
||||
body {
|
||||
font-family:'Dejavu Sans', Arial, Helvetica, sans-serif;
|
||||
font-size: 11px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@if ($logo)
|
||||
<center>
|
||||
<img src="{{ $logo }}">
|
||||
<p>{{$company_name}}</p>
|
||||
</center>
|
||||
@endif
|
||||
<br>
|
||||
|
||||
<p>
|
||||
{{ trans('general.date') }}: {{ date($date_settings) }} <br>
|
||||
{{ trans('general.license') }}: {{ $item_model }}<br>
|
||||
</p>
|
||||
|
||||
@if ($eula)
|
||||
<hr>
|
||||
{!! $eula !!}
|
||||
<hr>
|
||||
@endif
|
||||
|
||||
|
||||
<p>
|
||||
{{ trans('general.assigned_date') }}: {{$check_out_date}}<br>
|
||||
{{ trans('general.assignee') }}: {{$assigned_to}}<br>
|
||||
{{ trans('general.accepted_date') }}: {{$accepted_date}}
|
||||
</p>
|
||||
|
||||
|
||||
@if ($signature!='')
|
||||
<img src="{{ $signature }}" style="max-width: 600px; border-bottom: black solid 1px;">
|
||||
@endif
|
||||
</body>
|
||||
</html>
|
137
SNIPE-IT/resources/views/account/accept/create.blade.php
Normal file
137
SNIPE-IT/resources/views/account/accept/create.blade.php
Normal file
@ -0,0 +1,137 @@
|
||||
@extends('layouts/default')
|
||||
|
||||
{{-- Page title --}}
|
||||
@section('title')
|
||||
{{trans('general.accept', ['asset' => $acceptance->checkoutable->present()->name()])}}
|
||||
@parent
|
||||
@stop
|
||||
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
|
||||
|
||||
<link rel="stylesheet" href="{{ url('css/signature-pad.min.css') }}">
|
||||
|
||||
<style>
|
||||
.form-horizontal .control-label, .form-horizontal .radio, .form-horizontal .checkbox, .form-horizontal .radio-inline, .form-horizontal .checkbox-inline {
|
||||
padding-top: 17px;
|
||||
padding-right: 10px;
|
||||
}
|
||||
|
||||
#eula_div {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.m-signature-pad--body {
|
||||
border-style: solid;
|
||||
border-color: grey;
|
||||
border-width: thin;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
<form class="form-horizontal" method="post" action="" autocomplete="off">
|
||||
<!-- CSRF Token -->
|
||||
<input type="hidden" name="_token" value="{{ csrf_token() }}" />
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-sm-offset-1 col-md-10 col-md-offset-1">
|
||||
<div class="panel box box-default">
|
||||
<div class="box-body">
|
||||
<div class="col-md-12">
|
||||
@if ($acceptance->checkoutable->getEula())
|
||||
<div id="eula_div" style="padding-bottom: 20px">
|
||||
{!! $acceptance->checkoutable->getEula() !!}
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<h3>{{$acceptance->checkoutable->present()->name()}}</h3>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<label class="form-control">
|
||||
<input type="radio" name="asset_acceptance" id="accepted" value="accepted">
|
||||
{{trans('general.i_accept')}}
|
||||
</label>
|
||||
<label class="form-control">
|
||||
<input type="radio" name="asset_acceptance" id="declined" value="declined">
|
||||
{{trans('general.i_decline')}}
|
||||
</label>
|
||||
|
||||
</div>
|
||||
|
||||
@if ($snipeSettings->require_accept_signature=='1')
|
||||
<div class="col-md-12">
|
||||
<h3 style="padding-top: 20px">{{trans('general.sign_tos')}}</h3>
|
||||
<div id="signature-pad" class="m-signature-pad">
|
||||
<div class="m-signature-pad--body col-md-12 col-sm-12 col-lg-12 col-xs-12">
|
||||
<canvas style="width:100%;"></canvas>
|
||||
<input type="hidden" name="signature_output" id="signature_output">
|
||||
</div>
|
||||
<div class="col-md-12 col-sm-12 col-lg-12 col-xs-12 text-center">
|
||||
<button type="button" class="btn btn-sm btn-default clear" data-action="clear" id="clear_button">{{trans('general.clear_signature')}}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
</div> <!-- / box-body -->
|
||||
<div class="box-footer text-right">
|
||||
<button type="submit" class="btn btn-success" id="submit-button"><i class="fa fa-check icon-white" aria-hidden="true"></i> {{ trans('general.submit') }}</button>
|
||||
</div><!-- /.box-footer -->
|
||||
</div> <!-- / box-default -->
|
||||
</div> <!-- / col -->
|
||||
</div> <!-- / row -->
|
||||
</form>
|
||||
|
||||
@stop
|
||||
|
||||
@section('moar_scripts')
|
||||
|
||||
<script nonce="{{ csrf_token() }}">
|
||||
|
||||
var wrapper = document.getElementById("signature-pad"),
|
||||
clearButton = wrapper.querySelector("[data-action=clear]"),
|
||||
saveButton = wrapper.querySelector("[data-action=save]"),
|
||||
canvas = wrapper.querySelector("canvas"),
|
||||
signaturePad;
|
||||
|
||||
// Adjust canvas coordinate space taking into account pixel ratio,
|
||||
// to make it look crisp on mobile devices.
|
||||
// This also causes canvas to be cleared.
|
||||
if (window.matchMedia("(min-width: 768px)").matches) {
|
||||
function resizeCanvas() {
|
||||
// When zoomed out to less than 100%, for some very strange reason,
|
||||
// some browsers report devicePixelRatio as less than 1
|
||||
// and only part of the canvas is cleared then.
|
||||
var ratio = Math.max(window.devicePixelRatio || 1, 1);
|
||||
canvas.width = canvas.offsetWidth * ratio;
|
||||
canvas.height = canvas.offsetHeight * ratio;
|
||||
canvas.getContext("2d").scale(ratio, ratio);
|
||||
}
|
||||
window.onresize = resizeCanvas;
|
||||
resizeCanvas();
|
||||
}
|
||||
|
||||
signaturePad = new SignaturePad(canvas);
|
||||
|
||||
$('#clear_button').on("click", function (event) {
|
||||
signaturePad.clear();
|
||||
});
|
||||
|
||||
$('#submit-button').on("click", function (event) {
|
||||
if (signaturePad.isEmpty()) {
|
||||
alert("Please provide signature first.");
|
||||
return false;
|
||||
} else {
|
||||
$('#signature_output').val(signaturePad.toDataURL());
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
@stop
|
66
SNIPE-IT/resources/views/account/accept/index.blade.php
Normal file
66
SNIPE-IT/resources/views/account/accept/index.blade.php
Normal file
@ -0,0 +1,66 @@
|
||||
@extends('layouts/default')
|
||||
|
||||
{{-- Page title --}}
|
||||
@section('title')
|
||||
{{ trans('general.accept_assets', array('name' => empty($user) ? '' : $user->present()->full_name)) }}
|
||||
@parent
|
||||
@stop
|
||||
|
||||
{{-- Account page content --}}
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box box-default">
|
||||
|
||||
<div class="box-body">
|
||||
<!-- checked out Accessories table -->
|
||||
|
||||
<div class="table-responsive">
|
||||
<table
|
||||
data-cookie-id-table="pendingAcceptances"
|
||||
data-pagination="true"
|
||||
data-id-table="pendingAcceptances"
|
||||
data-search="true"
|
||||
data-side-pagination="client"
|
||||
data-show-columns="true"
|
||||
data-show-export="true"
|
||||
data-show-refresh="false"
|
||||
data-sort-order="asc"
|
||||
id="pendingAcceptances"
|
||||
class="table table-striped snipe-table"
|
||||
data-export-options='{
|
||||
"fileName": "my-pending-acceptances-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ trans('general.name')}}</th>
|
||||
<th>{{ trans('table.actions')}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($acceptances as $acceptance)
|
||||
<tr>
|
||||
@if ($acceptance->checkoutable)
|
||||
<td>{{ ($acceptance->checkoutable) ? $acceptance->checkoutable->present()->name : '' }}</td>
|
||||
<td><a href="{{ route('account.accept.item', $acceptance) }}" class="btn btn-default btn-sm">{{ trans('general.accept_decline') }}</a></td>
|
||||
@else
|
||||
<td> ----- </td>
|
||||
<td> {{ trans('general.error_user_company_accept_view') }} </td>
|
||||
@endif
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div> <!-- .box-body-->
|
||||
</div><!--.box.box-default-->
|
||||
</div> <!-- .col-md-12-->
|
||||
</div> <!-- .row-->
|
||||
|
||||
@stop
|
||||
|
||||
@section('moar_scripts')
|
||||
@include ('partials.bootstrap-table')
|
||||
@stop
|
49
SNIPE-IT/resources/views/account/api.blade.php
Normal file
49
SNIPE-IT/resources/views/account/api.blade.php
Normal file
@ -0,0 +1,49 @@
|
||||
@extends('layouts/default')
|
||||
|
||||
{{-- Page title --}}
|
||||
@section('title')
|
||||
{{ trans('account/general.personal_api_keys') }}
|
||||
@parent
|
||||
@stop
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
|
||||
@if (!config('app.lock_passwords'))
|
||||
<passport-personal-access-tokens
|
||||
token-url="{{ url('oauth/personal-access-tokens') }}"
|
||||
scopes-url="{{ url('oauth/scopes') }}">
|
||||
</passport-personal-access-tokens>
|
||||
@else
|
||||
<p class="help-block">{{ trans('general.feature_disabled') }}</p>
|
||||
@endif
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="alert alert-warning"><i class="fas fa-exclamation-triangle faa-pulse animated"></i>
|
||||
{{ trans('account/general.api_key_warning') }}
|
||||
</div>
|
||||
|
||||
<p>{{ trans('account/general.api_base_url') }}<br>
|
||||
<code>{{ url('/api/v1') }}{!! trans('account/general.api_base_url_endpoint') !!}</code></p>
|
||||
|
||||
<p>{{ trans('account/general.api_token_expiration_time') }}
|
||||
<strong>{{ config('passport.expiration_years') }} {{ trans('general.years') }} </strong>.</p>
|
||||
|
||||
|
||||
<p>{!! trans('account/general.api_reference') !!}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@stop
|
||||
|
||||
@section('moar_scripts')
|
||||
<script nonce="{{ csrf_token() }}">
|
||||
new Vue({
|
||||
el: "#app",
|
||||
});
|
||||
</script>
|
||||
@endsection
|
69
SNIPE-IT/resources/views/account/change-password.blade.php
Normal file
69
SNIPE-IT/resources/views/account/change-password.blade.php
Normal file
@ -0,0 +1,69 @@
|
||||
@extends('layouts/default')
|
||||
|
||||
{{-- Page title --}}
|
||||
@section('title')
|
||||
{{ trans('general.changepassword') }}
|
||||
@stop
|
||||
|
||||
{{-- Account page content --}}
|
||||
@section('content')
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-9">
|
||||
{{ Form::open(['method' => 'POST', 'files' => true, 'class' => 'form-horizontal', 'autocomplete' => 'off']) }}
|
||||
<!-- CSRF Token -->
|
||||
<input type="hidden" name="_token" value="{{ csrf_token() }}" />
|
||||
<div class="box box-default">
|
||||
<div class="box-body">
|
||||
|
||||
|
||||
<!-- Old Password -->
|
||||
<div class="form-group {{ $errors->has('current_password') ? ' has-error' : '' }}">
|
||||
<label for="current_password" class="col-md-3 control-label"> {{ trans('general.current_password') }} </label>
|
||||
</label>
|
||||
<div class="col-md-5 required">
|
||||
<input class="form-control" type="password" name="current_password" id="current_password" {{ (config('app.lock_passwords') ? ' disabled' : '') }}>
|
||||
{!! $errors->first('current_password', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
@if (config('app.lock_passwords')===true)
|
||||
<p class="text-warning"><i class="fas fa-lock"></i> {{ trans('general.feature_disabled') }}</p>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group {{ $errors->has('password') ? ' has-error' : '' }}">
|
||||
<label for="password" class="col-md-3 control-label">{{ trans('general.new_password') }}</label>
|
||||
<div class="col-md-5 required">
|
||||
<input class="form-control" type="password" name="password" id="password" {{ (config('app.lock_passwords') ? ' disabled' : '') }}>
|
||||
{!! $errors->first('password', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
@if (config('app.lock_passwords')===true)
|
||||
<p class="text-warning"><i class="fas fa-lock"></i> {{ trans('general.feature_disabled') }}</p>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group {{ $errors->has('password_confirmation') ? ' has-error' : '' }}">
|
||||
<label for="password_confirmation" class="col-md-3 control-label">{{ trans('general.new_password') }}</label>
|
||||
<div class="col-md-5 required">
|
||||
<input class="form-control" type="password" name="password_confirmation" id="password_confirmation" {{ (config('app.lock_passwords') ? ' disabled' : '') }} aria-label="password_confirmation">
|
||||
{!! $errors->first('password_confirmation', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
@if (config('app.lock_passwords')===true)
|
||||
<p class="text-warning"><i class="fas fa-lock"></i> {{ trans('general.feature_disabled') }}</p>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div> <!-- .box-body -->
|
||||
<div class="box-footer text-right">
|
||||
<a class="btn btn-link" href="{{ URL::previous() }}">{{ trans('button.cancel') }}</a>
|
||||
<button type="submit" class="btn btn-primary"><i class="fas fa-check icon-white" aria-hidden="true"></i> {{ trans('general.save') }}</button>
|
||||
</div>
|
||||
|
||||
</div> <!-- .box-default -->
|
||||
{{ Form::close() }}
|
||||
</div> <!-- .col-md-9 -->
|
||||
</div> <!-- .row-->
|
||||
@stop
|
163
SNIPE-IT/resources/views/account/profile.blade.php
Normal file
163
SNIPE-IT/resources/views/account/profile.blade.php
Normal file
@ -0,0 +1,163 @@
|
||||
@extends('layouts/default')
|
||||
|
||||
{{-- Page title --}}
|
||||
@section('title')
|
||||
{{ trans('general.editprofile') }}
|
||||
@stop
|
||||
|
||||
{{-- Account page content --}}
|
||||
@section('content')
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-9">
|
||||
{{ Form::open(['method' => 'POST', 'files' => true, 'class' => 'form-horizontal', 'autocomplete' => 'off']) }}
|
||||
<!-- CSRF Token -->
|
||||
<input type="hidden" name="_token" value="{{ csrf_token() }}" />
|
||||
<div class="box box-default">
|
||||
<div class="box-body">
|
||||
<!-- First Name -->
|
||||
<div class="form-group {{ $errors->has('first_name') ? ' has-error' : '' }}">
|
||||
<label for="first_name" class="col-md-3 control-label">{{ trans('general.first_name') }}
|
||||
</label>
|
||||
<div class="col-md-8 required">
|
||||
<input class="form-control" type="text" name="first_name" id="first_name" value="{{ old('first_name', $user->first_name) }}" />
|
||||
{!! $errors->first('first_name', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Last Name -->
|
||||
<div class="form-group {{ $errors->has('last_name') ? ' has-error' : '' }}">
|
||||
<label for="last_name" class="col-md-3 control-label">
|
||||
{{ trans('general.last_name') }}
|
||||
</label>
|
||||
<div class="col-md-8 required">
|
||||
<input class="form-control" type="text" name="last_name" id="last_name" value="{{ old('last_name', $user->last_name) }}" />
|
||||
{!! $errors->first('last_name', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@can('self.edit_location')
|
||||
<!-- Location -->
|
||||
@include ('partials.forms.edit.location-profile-select', ['translated_name' => trans('general.location')])
|
||||
@endcan
|
||||
|
||||
|
||||
<!-- Language -->
|
||||
<div class="form-group {{ $errors->has('locale') ? 'has-error' : '' }}">
|
||||
<label class="col-md-3 control-label" for="locale">{{ trans('general.language') }}</label>
|
||||
<div class="col-md-7">
|
||||
|
||||
@if (!config('app.lock_passwords'))
|
||||
{!! Form::locales('locale', old('locale', $user->locale), 'select2') !!}
|
||||
{!! $errors->first('locale', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
||||
@else
|
||||
<p class="help-block">{{ trans('general.feature_disabled') }}</p>
|
||||
@endif
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if ($snipeSettings->allow_user_skin=='1')
|
||||
<!-- Skin -->
|
||||
<div class="form-group {{ $errors->has('skin') ? 'error' : '' }}">
|
||||
<label for="website" class="col-md-3 control-label">{{ Form::label('skin', trans('general.skin')) }}</label>
|
||||
<div class="col-md-8">
|
||||
{!! Form::user_skin('skin', old('skin', $user->skin), 'select2') !!}
|
||||
{!! $errors->first('skin', '<span class="alert-msg">:message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Phone -->
|
||||
<div class="form-group {{ $errors->has('phone') ? 'has-error' : '' }}">
|
||||
<label class="col-md-3 control-label" for="phone">{{ trans('admin/users/table.phone') }}</label>
|
||||
<div class="col-md-4">
|
||||
<input class="form-control" type="text" name="phone" id="phone" value="{{ old('phone', $user->phone) }}" />
|
||||
{!! $errors->first('phone', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Website URL -->
|
||||
<div class="form-group {{ $errors->has('website') ? ' has-error' : '' }}">
|
||||
<label for="website" class="col-md-3 control-label">{{ trans('general.website') }}</label>
|
||||
<div class="col-md-8">
|
||||
<input class="form-control" type="text" name="website" id="website" value="{{ old('website', $user->website) }}" />
|
||||
{!! $errors->first('website', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Gravatar Email -->
|
||||
<div class="form-group {{ $errors->has('gravatar') ? ' has-error' : '' }}">
|
||||
<label for="gravatar" class="col-md-3 control-label">{{ trans('general.gravatar_email') }}
|
||||
<small>(Private)</small>
|
||||
</label>
|
||||
<div class="col-md-8">
|
||||
<input class="form-control" type="text" name="gravatar" id="gravatar" value="{{ old('gravatar', $user->gravatar) }}" />
|
||||
{!! $errors->first('gravatar', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
<p>
|
||||
<img src="//secure.gravatar.com/avatar/{{ md5(strtolower(trim($user->gravatar))) }}" width="30" height="30" alt="{{ $user->present()->fullName() }} avatar image">
|
||||
{!! trans('general.gravatar_url') !!}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Avatar -->
|
||||
|
||||
@if (($user->avatar) && ($user->avatar!=''))
|
||||
<div class="form-group{{ $errors->has('image_delete') ? ' has-error' : '' }}">
|
||||
<div class="col-md-9 col-md-offset-3">
|
||||
<label for="image_delete" class="form-control">
|
||||
{{ Form::checkbox('image_delete', '1', old('image_delete'), ['id' => 'image_delete', 'aria-label'=>'image_delete']) }}
|
||||
{{ trans('general.image_delete') }}
|
||||
</label>
|
||||
{!! $errors->first('image_delete', '<span class="alert-msg">:message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-9 col-md-offset-3">
|
||||
<img src="{{ Storage::disk('public')->url(app('users_upload_path').e($user->avatar)) }}" class="img-responsive">
|
||||
{!! $errors->first('image_delete', '<span class="alert-msg">:message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
|
||||
@include ('partials.forms.edit.image-upload', ['fieldname' => 'avatar', 'image_path' => app('users_upload_path')])
|
||||
|
||||
|
||||
<!-- Two factor opt in -->
|
||||
@if ($snipeSettings->two_factor_enabled=='1')
|
||||
<div class="form-group {{ $errors->has('two_factor_optin') ? 'has-error' : '' }}">
|
||||
<div class="col-md-7 col-md-offset-3">
|
||||
@can('self.two_factor')
|
||||
<label class="form-control">{{ Form::checkbox('two_factor_optin', '1', old('two_factor_optin', $user->two_factor_optin)) }}
|
||||
@else
|
||||
<label class="form-control form-control--disabled">{{ Form::checkbox('two_factor_optin', '1', old('two_factor_optin', $user->two_factor_optin),['disabled' => 'disabled']) }}
|
||||
@endcan
|
||||
|
||||
{{ trans('admin/settings/general.two_factor_enabled_text') }}</label>
|
||||
@can('self.two_factor')
|
||||
<p class="help-block">{{ trans('admin/settings/general.two_factor_enabled_warning') }}</p>
|
||||
@else
|
||||
<p class="help-block">{{ trans('admin/settings/general.two_factor_enabled_edit_not_allowed') }}</p>
|
||||
@endcan
|
||||
@if (config('app.lock_passwords'))
|
||||
<p class="help-block">{{ trans('general.feature_disabled') }}</p>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
|
||||
</div> <!-- .box-body -->
|
||||
<div class="text-right box-footer">
|
||||
<a class="btn btn-link" href="{{ URL::previous() }}">{{ trans('button.cancel') }}</a>
|
||||
<button type="submit" class="btn btn-primary"><i class="fas fa-check icon-white" aria-hidden="true"></i> {{ trans('general.save') }}</button>
|
||||
</div>
|
||||
</div> <!-- .box-default -->
|
||||
{{ Form::close() }}
|
||||
</div> <!-- .col-md-9 -->
|
||||
</div> <!-- .row-->
|
||||
|
||||
@stop
|
198
SNIPE-IT/resources/views/account/requestable-assets.blade.php
Normal file
198
SNIPE-IT/resources/views/account/requestable-assets.blade.php
Normal file
@ -0,0 +1,198 @@
|
||||
@extends('layouts/default')
|
||||
|
||||
@section('title0')
|
||||
{{ trans('admin/hardware/general.requestable') }}
|
||||
{{ trans('general.assets') }}
|
||||
@stop
|
||||
|
||||
{{-- Page title --}}
|
||||
@section('title')
|
||||
@yield('title0') @parent
|
||||
@stop
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
|
||||
@if (($assets->count() < 1) && ($models->count() < 1))
|
||||
|
||||
<div class="col-md-12">
|
||||
<div class="alert alert-info fade in">
|
||||
<i class="fas fa-info-circle faa-pulse animated"></i>
|
||||
<strong>{{ trans('general.notification_info') }}: </strong>
|
||||
{{ trans('general.no_requestable') }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@else
|
||||
<div class="nav-tabs-custom">
|
||||
<ul class="nav nav-tabs">
|
||||
@if ($assets->count() > 0)
|
||||
<li class="active">
|
||||
<a href="#assets" data-toggle="tab" title="{{ trans('general.assets') }}">{{ trans('general.assets') }}
|
||||
<badge class="badge badge-secondary"> {{ $assets->count()}}</badge>
|
||||
</a>
|
||||
</li>
|
||||
@endif
|
||||
@if ($models->count() > 0)
|
||||
<li>
|
||||
<a href="#models" data-toggle="tab" title="{{ trans('general.asset_models') }}">{{ trans('general.asset_models') }}
|
||||
<badge class="badge badge-secondary"> {{ $models->count()}}</badge>
|
||||
</a>
|
||||
</li>
|
||||
@endif
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
@if ($assets->count() > 0)
|
||||
<div class="tab-pane fade in active" id="assets">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="table-responsive">
|
||||
<table
|
||||
data-click-to-select="true"
|
||||
data-cookie-id-table="requestableAssetsListingTable"
|
||||
data-pagination="true"
|
||||
data-id-table="requestableAssetsListingTable"
|
||||
data-search="true"
|
||||
data-side-pagination="server"
|
||||
data-show-columns="true"
|
||||
data-show-export="false"
|
||||
data-show-footer="false"
|
||||
data-show-refresh="true"
|
||||
data-sort-order="asc"
|
||||
data-sort-name="name"
|
||||
data-toolbar="#assetsBulkEditToolbar"
|
||||
data-bulk-button-id="#bulkAssetEditButton"
|
||||
data-bulk-form-id="#assetsBulkForm"
|
||||
id="assetsListingTable"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{ route('api.assets.requestable', ['requestable' => true]) }}">
|
||||
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="col-md-1" data-field="image" data-formatter="imageFormatter" data-sortable="true">{{ trans('general.image') }}</th>
|
||||
<th class="col-md-2" data-field="asset_tag" data-sortable="true" >{{ trans('general.asset_tag') }}</th>
|
||||
<th class="col-md-2" data-field="model" data-sortable="true">{{ trans('admin/hardware/table.asset_model') }}</th>
|
||||
<th class="col-md-2" data-field="model_number" data-sortable="true">{{ trans('admin/models/table.modelnumber') }}</th>
|
||||
<th class="col-md-2" data-field="name" data-sortable="true">{{ trans('admin/hardware/form.name') }}</th>
|
||||
<th class="col-md-3" data-field="serial" data-sortable="true">{{ trans('admin/hardware/table.serial') }}</th>
|
||||
<th class="col-md-2" data-field="location" data-sortable="true">{{ trans('admin/hardware/table.location') }}</th>
|
||||
<th class="col-md-2" data-field="status" data-sortable="true">{{ trans('admin/hardware/table.status') }}</th>
|
||||
<th class="col-md-2" data-field="expected_checkin" data-formatter="dateDisplayFormatter" data-sortable="true">{{ trans('admin/hardware/form.expected_checkin') }}</th>
|
||||
|
||||
@foreach(\App\Models\CustomField::get() as $field)
|
||||
@if (($field->field_encrypted=='0') && ($field->show_in_requestable_list=='1'))
|
||||
<th class="col-md-2" data-field="custom_fields.{{ $field->db_column }}" data-sortable="true">{{ $field->name }}</th>
|
||||
@endif
|
||||
@endforeach
|
||||
<th class="col-md-1" data-formatter="assetRequestActionsFormatter" data-field="actions" data-sortable="false">{{ trans('table.actions') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if ($models->count() > 0)
|
||||
<div class="tab-pane fade in {{ ($assets->count() == 0) ? 'active' : '' }}" id="models">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<table
|
||||
name="requested-assets"
|
||||
data-toolbar="#toolbar"
|
||||
class="table table-striped snipe-table"
|
||||
id="table"
|
||||
data-advanced-search="true"
|
||||
data-id-table="advancedTable"
|
||||
data-cookie-id-table="requestableAssets">
|
||||
<thead>
|
||||
<tr role="row">
|
||||
<th class="col-md-1" data-sortable="true">{{ trans('general.image') }}</th>
|
||||
<th class="col-md-6" data-sortable="true">{{ trans('admin/hardware/table.asset_model') }}</th>
|
||||
<th class="col-md-3" data-sortable="true">{{ trans('admin/accessories/general.remaining') }}</th>
|
||||
|
||||
<th class="col-md-2 actions" data-sortable="false">{{ trans('table.actions') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
@foreach($models as $requestableModel)
|
||||
<tr>
|
||||
|
||||
<td>
|
||||
|
||||
@if ($requestableModel->image)
|
||||
<a href="{{ config('app.url') }}/uploads/models/{{ $requestableModel->image }}" data-toggle="lightbox" data-type="image">
|
||||
<img src="{{ config('app.url') }}/uploads/models/{{ $requestableModel->image }}" style="max-height: {{ $snipeSettings->thumbnail_max_h }}px; width: auto;" class="img-responsive">
|
||||
</a>
|
||||
@endif
|
||||
|
||||
</td>
|
||||
|
||||
<td>
|
||||
@can('view', \App\Models\AssetModel::class)
|
||||
<a href="{{ route('models.show', ['model' => $requestableModel->id]) }}">{{ $requestableModel->name }}</a>
|
||||
@else
|
||||
{{ $requestableModel->name }}
|
||||
@endcan
|
||||
</td>
|
||||
|
||||
<td>{{$requestableModel->assets->where('requestable', '1')->count()}}</td>
|
||||
|
||||
<td>
|
||||
<form action="{{ route('account/request-item', ['itemType' => 'asset_model', 'itemId' => $requestableModel->id])}}" method="POST" accept-charset="utf-8">
|
||||
{{ csrf_field() }}
|
||||
<input type="text" style="width: 70px; margin-right: 10px;" class="form-control pull-left" name="request-quantity" value="" placeholder="{{ trans('general.qty') }}">
|
||||
@if ($requestableModel->isRequestedBy(Auth::user()))
|
||||
{{ Form::submit(trans('button.cancel'), ['class' => 'btn btn-danger btn-sm'])}}
|
||||
@else
|
||||
{{ Form::submit(trans('button.request'), ['class' => 'btn btn-primary btn-sm'])}}
|
||||
@endif
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
</div> <!-- .tab-content-->
|
||||
</div> <!-- .nav-tabs-custom -->
|
||||
|
||||
@endif
|
||||
</div> <!-- .col-md-12> -->
|
||||
</div> <!-- .row -->
|
||||
@stop
|
||||
|
||||
|
||||
@section('moar_scripts')
|
||||
@include ('partials.bootstrap-table', [
|
||||
'exportFile' => 'requested-export',
|
||||
'search' => true,
|
||||
'clientSearch' => true,
|
||||
])
|
||||
|
||||
|
||||
<script nonce="{{ csrf_token() }}">
|
||||
|
||||
$( "a[name='Request']").click(function(event) {
|
||||
// event.preventDefault();
|
||||
quantity = $(this).closest('td').siblings().find('input').val();
|
||||
currentUrl = $(this).attr('href');
|
||||
// $(this).attr('href', currentUrl + '?quantity=' + quantity);
|
||||
// alert($(this).attr('href'));
|
||||
});
|
||||
</script>
|
||||
@stop
|
||||
|
||||
|
60
SNIPE-IT/resources/views/account/requested.blade.php
Normal file
60
SNIPE-IT/resources/views/account/requested.blade.php
Normal file
@ -0,0 +1,60 @@
|
||||
@extends('layouts/default')
|
||||
|
||||
{{-- Page title --}}
|
||||
@section('title')
|
||||
{{ trans('general.requested_assets')}}
|
||||
@stop
|
||||
|
||||
{{-- Account page content --}}
|
||||
@section('content')
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<div class="box box-default">
|
||||
<div class="box-body">
|
||||
|
||||
<table
|
||||
data-cookie-id-table="userRequests"
|
||||
data-pagination="true"
|
||||
data-id-table="userRequests"
|
||||
data-side-pagination="server"
|
||||
data-show-columns="true"
|
||||
data-show-export="true"
|
||||
data-show-refresh="true"
|
||||
data-sort-order="desc"
|
||||
id="userRequests"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{ route('api.assets.requested') }}"
|
||||
data-export-options='{
|
||||
"fileName": "my-requested-assets-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-field="image" data-formatter="imageFormatter">{{ trans('general.image') }}</th>
|
||||
<th data-field="name">{{ trans('general.item_name') }}</th>
|
||||
<th data-field="type">{{ trans('general.type') }}</th>
|
||||
<th data-field="qty">{{ trans('general.qty') }}</th>
|
||||
<th data-field="location">{{ trans('admin/hardware/table.location') }}</th>
|
||||
<th data-field="expected_checkin" data-formatter="dateDisplayFormatter"> {{ trans('admin/hardware/form.expected_checkin') }}</th>
|
||||
<th data-field="request_date" data-formatter="dateDisplayFormatter"> {{ trans('general.requested_date') }}</th>
|
||||
|
||||
@foreach(\App\Models\CustomField::get() as $field)
|
||||
@if (($field->field_encrypted=='0') && ($field->show_in_requestable_list=='1'))
|
||||
<th data-field="custom_fields.{{ $field->db_column }}">{{ $field->name }}</th>
|
||||
@endif
|
||||
@endforeach
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
</div> <!-- .box-body -->
|
||||
</div> <!-- .box-default -->
|
||||
</div> <!-- .col-md-9 -->
|
||||
</div> <!-- .row-->
|
||||
|
||||
@stop
|
||||
@section('moar_scripts')
|
||||
@include ('partials.bootstrap-table')
|
||||
@stop
|
647
SNIPE-IT/resources/views/account/view-assets.blade.php
Normal file
647
SNIPE-IT/resources/views/account/view-assets.blade.php
Normal file
@ -0,0 +1,647 @@
|
||||
@extends('layouts/default')
|
||||
|
||||
{{-- Page title --}}
|
||||
@section('title')
|
||||
{{ trans('general.hello_name', array('name' => $user->present()->getFullNameAttribute())) }}
|
||||
@parent
|
||||
@stop
|
||||
|
||||
{{-- Account page content --}}
|
||||
@section('content')
|
||||
|
||||
@if ($acceptances = \App\Models\CheckoutAcceptance::forUser(Auth::user())->pending()->count())
|
||||
<div class="row">
|
||||
<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>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<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)
|
||||
<div class="box-header with-border">
|
||||
<div class="box-heading">
|
||||
<h2 class="box-title"> {{ trans('admin/users/general.assets_user', array('name' => $user->first_name)) }}</h2>
|
||||
</div>
|
||||
</div><!-- /.box-header -->
|
||||
@endif
|
||||
|
||||
<div class="box-body">
|
||||
<!-- checked out assets table -->
|
||||
<div class="table-responsive">
|
||||
|
||||
<table
|
||||
data-cookie="true"
|
||||
data-cookie-id-table="userAssets"
|
||||
data-pagination="true"
|
||||
data-id-table="userAssets"
|
||||
data-search="true"
|
||||
data-side-pagination="client"
|
||||
data-show-columns="true"
|
||||
data-show-export="true"
|
||||
data-show-footer="true"
|
||||
data-sort-order="asc"
|
||||
id="userAssets"
|
||||
class="table table-striped snipe-table"
|
||||
data-export-options='{
|
||||
"fileName": "my-assets-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="col-md-1">#</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('general.name') }}</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-2" data-switchable="true" data-visible="false">{{ trans('admin/hardware/form.default_location') }}</th>
|
||||
@can('self.view_purchase_cost')
|
||||
<th class="col-md-6" data-footer-formatter="sumFormatter" data-fieldname="purchase_cost">{{ trans('general.purchase_cost') }}</th>
|
||||
@endcan
|
||||
@foreach ($field_array as $db_column => $field_name)
|
||||
<th class="col-md-1" data-switchable="true" data-visible="true">{{ $field_name }}</th>
|
||||
@endforeach
|
||||
|
||||
</tr>
|
||||
|
||||
</thead>
|
||||
<tbody>
|
||||
@php
|
||||
$counter = 1
|
||||
@endphp
|
||||
@foreach ($user->assets as $asset)
|
||||
<tr>
|
||||
<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>
|
||||
@if (($asset->model) && ($asset->model->category))
|
||||
{{ $asset->model->category->name }}
|
||||
@endif
|
||||
</td>
|
||||
<td>{{ $asset->asset_tag }}</td>
|
||||
<td>{{ $asset->name }}</td>
|
||||
<td>
|
||||
@if ($asset->physical=='1')
|
||||
{{ $asset->model->name }}
|
||||
@endif
|
||||
</td>
|
||||
<td>{{ $asset->serial }}</td>
|
||||
<td>{{ ($asset->defaultLoc) ? $asset->defaultLoc->name : '' }}</td>
|
||||
@can('self.view_purchase_cost')
|
||||
<td>
|
||||
{!! Helper::formatCurrencyOutput($asset->purchase_cost) !!}
|
||||
</td>
|
||||
@endcan
|
||||
|
||||
@foreach ($field_array as $db_column => $field_value)
|
||||
<td>
|
||||
{{ $asset->{$db_column} }}
|
||||
</td>
|
||||
@endforeach
|
||||
|
||||
</tr>
|
||||
|
||||
@php
|
||||
$counter++
|
||||
@endphp
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div> <!-- .table-responsive-->
|
||||
</div>
|
||||
</div><!-- /asset -->
|
||||
<div class="tab-pane" id="licenses">
|
||||
|
||||
<div class="table-responsive">
|
||||
<table
|
||||
data-cookie-id-table="userLicenses"
|
||||
data-pagination="true"
|
||||
data-id-table="userLicenses"
|
||||
data-search="true"
|
||||
data-side-pagination="client"
|
||||
data-show-columns="true"
|
||||
data-show-export="true"
|
||||
data-show-refresh="false"
|
||||
data-sort-order="asc"
|
||||
id="userLicenses"
|
||||
class="table table-striped snipe-table"
|
||||
data-export-options='{
|
||||
"fileName": "my-licenses-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ trans('general.name') }}</th>
|
||||
<th>{{ trans('admin/licenses/form.license_key') }}</th>
|
||||
<th>{{ trans('admin/licenses/form.to_name') }}</th>
|
||||
<th>{{ trans('admin/licenses/form.to_email') }}</th>
|
||||
<th>{{ trans('general.category') }}</th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($user->licenses as $license)
|
||||
<tr>
|
||||
<td>{{ $license->name }}</td>
|
||||
<td>
|
||||
@can('viewKeys', $license)
|
||||
{{ $license->serial }}
|
||||
@else
|
||||
------------
|
||||
@endcan
|
||||
</td>
|
||||
<td>
|
||||
@can('viewKeys', $license)
|
||||
{{ $license->license_name }}
|
||||
@else
|
||||
------------
|
||||
@endcan
|
||||
</td>
|
||||
@can('viewKeys', $license)
|
||||
<td>{{$license->license_email}}</td>
|
||||
@else
|
||||
------------
|
||||
@endcan
|
||||
<td>{{ ($license->category) ? $license->category->name : trans('general.deleted') }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div> <!-- .table-responsive-->
|
||||
</div>
|
||||
|
||||
<div class="tab-pane" id="accessories">
|
||||
<div class="table-responsive">
|
||||
<table
|
||||
data-cookie-id-table="userAccessoryTable"
|
||||
data-id-table="userAccessoryTable"
|
||||
id="userAccessoryTable"
|
||||
data-search="true"
|
||||
data-pagination="true"
|
||||
data-side-pagination="client"
|
||||
data-show-columns="true"
|
||||
data-show-fullscreen="true"
|
||||
data-show-export="true"
|
||||
data-show-footer="true"
|
||||
data-show-refresh="false"
|
||||
data-sort-order="asc"
|
||||
data-sort-name="name"
|
||||
class="table table-striped snipe-table table-hover"
|
||||
data-export-options='{
|
||||
"fileName": "export-accessory-{{ str_slug($user->username) }}-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","delete","download","icon"]
|
||||
}'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="col-md-5">{{ trans('general.name') }}</th>
|
||||
@can('self.view_purchase_cost')
|
||||
<th class="col-md-6" data-footer-formatter="sumFormatter" data-fieldname="purchase_cost">{{ trans('general.purchase_cost') }}</th>
|
||||
@endcan
|
||||
<th class="col-md-1 hidden-print">{{ trans('general.action') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($user->accessories as $accessory)
|
||||
<tr>
|
||||
<td>{{ $accessory->name }}</td>
|
||||
@can('self.view_purchase_cost')
|
||||
<td>
|
||||
{!! Helper::formatCurrencyOutput($accessory->purchase_cost) !!}
|
||||
</td>
|
||||
@endcan
|
||||
<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>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div><!-- /accessories-tab -->
|
||||
|
||||
<div class="tab-pane" id="consumables">
|
||||
<div class="table-responsive">
|
||||
<table
|
||||
data-cookie-id-table="userConsumableTable"
|
||||
data-id-table="userConsumableTable"
|
||||
id="userConsumableTable"
|
||||
data-search="true"
|
||||
data-pagination="true"
|
||||
data-side-pagination="client"
|
||||
data-show-columns="true"
|
||||
data-show-fullscreen="true"
|
||||
data-show-export="true"
|
||||
data-show-footer="true"
|
||||
data-show-refresh="false"
|
||||
data-sort-order="asc"
|
||||
data-sort-name="name"
|
||||
class="table table-striped snipe-table table-hover"
|
||||
data-export-options='{
|
||||
"fileName": "export-consumable-{{ str_slug($user->username) }}-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","delete","download","icon"]
|
||||
}'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="col-md-3">{{ trans('general.name') }}</th>
|
||||
@can('self.view_purchase_cost')
|
||||
<th class="col-md-2" data-footer-formatter="sumFormatter" data-fieldname="purchase_cost">{{ trans('general.purchase_cost') }}</th>
|
||||
@endcan
|
||||
<th class="col-md-2">{{ trans('general.date') }}</th>
|
||||
<th class="col-md-5">{{ trans('general.notes') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($user->consumables as $consumable)
|
||||
<tr>
|
||||
<td>{{ $consumable->name }}</td>
|
||||
@can('self.view_purchase_cost')
|
||||
<td>
|
||||
{!! Helper::formatCurrencyOutput($consumable->purchase_cost) !!}
|
||||
</td>
|
||||
@endcan
|
||||
<td>{{ Helper::getFormattedDateObject($consumable->pivot->created_at, 'datetime', false) }}</td>
|
||||
<td>{{ $consumable->pivot->note }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div><!-- /consumables-tab -->
|
||||
|
||||
</div><!-- /.tab-content -->
|
||||
</div><!-- nav-tabs-custom -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@stop
|
||||
|
||||
@section('moar_scripts')
|
||||
@include ('partials.bootstrap-table')
|
||||
@stop
|
133
SNIPE-IT/resources/views/asset_maintenances/edit.blade.php
Normal file
133
SNIPE-IT/resources/views/asset_maintenances/edit.blade.php
Normal file
@ -0,0 +1,133 @@
|
||||
@extends('layouts/default')
|
||||
|
||||
{{-- Page title --}}
|
||||
@section('title')
|
||||
@if ($item->id)
|
||||
{{ trans('admin/asset_maintenances/form.update') }}
|
||||
@else
|
||||
{{ trans('admin/asset_maintenances/form.create') }}
|
||||
@endif
|
||||
@parent
|
||||
@stop
|
||||
|
||||
|
||||
@section('header_right')
|
||||
<a href="{{ URL::previous() }}" class="btn btn-primary pull-right">
|
||||
{{ trans('general.back') }}</a>
|
||||
@stop
|
||||
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-9">
|
||||
@if ($item->id)
|
||||
<form class="form-horizontal" method="post" action="{{ route('maintenances.update', $item->id) }}" autocomplete="off">
|
||||
{{ method_field('PUT') }}
|
||||
@else
|
||||
<form class="form-horizontal" method="post" action="{{ route('maintenances.store') }}" autocomplete="off">
|
||||
@endif
|
||||
<!-- CSRF Token -->
|
||||
{{ csrf_field() }}
|
||||
|
||||
<div class="box box-default">
|
||||
<div class="box-header with-border">
|
||||
<h2 class="box-title">
|
||||
@if ($item)
|
||||
{{ $item->name }}
|
||||
@endif
|
||||
</h2>
|
||||
</div><!-- /.box-header -->
|
||||
|
||||
<div class="box-body">
|
||||
@include ('partials.forms.edit.asset-select', ['translated_name' => trans('admin/hardware/table.asset_tag'), 'fieldname' => 'asset_id', 'required' => 'true'])
|
||||
@include ('partials.forms.edit.supplier-select', ['translated_name' => trans('general.supplier'), 'fieldname' => 'supplier_id', 'required' => 'true'])
|
||||
@include ('partials.forms.edit.maintenance_type')
|
||||
|
||||
<!-- Title -->
|
||||
<div class="form-group {{ $errors->has('title') ? ' has-error' : '' }}">
|
||||
<label for="title" class="col-md-3 control-label">
|
||||
{{ trans('admin/asset_maintenances/form.title') }}
|
||||
</label>
|
||||
<div class="col-md-7{{ (Helper::checkIfRequired($item, 'title')) ? ' required' : '' }}">
|
||||
<input class="form-control" type="text" name="title" id="title" value="{{ old('title', $item->title) }}" />
|
||||
{!! $errors->first('title', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Start Date -->
|
||||
<div class="form-group {{ $errors->has('start_date') ? ' has-error' : '' }}">
|
||||
<label for="start_date" class="col-md-3 control-label">{{ trans('admin/asset_maintenances/form.start_date') }}</label>
|
||||
|
||||
<div class="input-group col-md-3{{ (Helper::checkIfRequired($item, 'start_date')) ? ' required' : '' }}">
|
||||
<div class="input-group date" data-provide="datepicker" data-date-format="yyyy-mm-dd" data-autoclose="true" data-date-clear-btn="true">
|
||||
<input type="text" class="form-control" placeholder="{{ trans('general.select_date') }}" name="start_date" id="start_date" value="{{ old('start_date', $item->start_date) }}">
|
||||
<span class="input-group-addon"><i class="fas fa-calendar" aria-hidden="true"></i></span>
|
||||
</div>
|
||||
{!! $errors->first('start_date', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<!-- Completion Date -->
|
||||
<div class="form-group {{ $errors->has('completion_date') ? ' has-error' : '' }}">
|
||||
<label for="start_date" class="col-md-3 control-label">{{ trans('admin/asset_maintenances/form.completion_date') }}</label>
|
||||
|
||||
<div class="input-group col-md-3{{ (Helper::checkIfRequired($item, 'completion_date')) ? ' required' : '' }}">
|
||||
<div class="input-group date" data-date-clear-btn="true" data-provide="datepicker" data-date-format="yyyy-mm-dd" data-autoclose="true">
|
||||
<input type="text" class="form-control" placeholder="{{ trans('general.select_date') }}" name="completion_date" id="completion_date" value="{{ old('completion_date', $item->completion_date) }}">
|
||||
<span class="input-group-addon"><i class="fas fa-calendar" aria-hidden="true"></i></span>
|
||||
</div>
|
||||
{!! $errors->first('completion_date', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Warranty -->
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-3 col-sm-9">
|
||||
<label class="form-control">
|
||||
<input type="checkbox" value="1" name="is_warranty" id="is_warranty" {{ old('is_warranty', $item->is_warranty) == '1' ? ' checked="checked"' : '' }}>
|
||||
{{ trans('admin/asset_maintenances/form.is_warranty') }}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Asset Maintenance Cost -->
|
||||
<div class="form-group {{ $errors->has('cost') ? ' has-error' : '' }}">
|
||||
<label for="cost" class="col-md-3 control-label">{{ trans('admin/asset_maintenances/form.cost') }}</label>
|
||||
<div class="col-md-2">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">
|
||||
@if (($item->asset) && ($item->asset->location) && ($item->asset->location->currency!=''))
|
||||
{{ $item->asset->location->currency }}
|
||||
@else
|
||||
{{ $snipeSettings->default_currency }}
|
||||
@endif
|
||||
</span>
|
||||
<input class="col-md-2 form-control" type="text" name="cost" id="cost" value="{{ old('cost', Helper::formatCurrencyOutput($item->cost)) }}" />
|
||||
{!! $errors->first('cost', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Notes -->
|
||||
<div class="form-group {{ $errors->has('notes') ? ' has-error' : '' }}">
|
||||
<label for="notes" class="col-md-3 control-label">{{ trans('admin/asset_maintenances/form.notes') }}</label>
|
||||
<div class="col-md-7">
|
||||
<textarea class="col-md-6 form-control" id="notes" name="notes">{{ old('notes', $item->notes) }}</textarea>
|
||||
{!! $errors->first('notes', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- .box-body -->
|
||||
|
||||
<div class="box-footer text-right">
|
||||
<button type="submit" class="btn btn-success"><i class="fas fa-check icon-white" aria-hidden="true"></i> {{ trans('general.save') }}</button>
|
||||
</div>
|
||||
</div> <!-- .box-default -->
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@stop
|
73
SNIPE-IT/resources/views/asset_maintenances/index.blade.php
Normal file
73
SNIPE-IT/resources/views/asset_maintenances/index.blade.php
Normal file
@ -0,0 +1,73 @@
|
||||
@extends('layouts/default')
|
||||
|
||||
{{-- Page title --}}
|
||||
@section('title')
|
||||
{{ trans('admin/asset_maintenances/general.asset_maintenances') }}
|
||||
@parent
|
||||
@stop
|
||||
|
||||
|
||||
@section('header_right')
|
||||
@can('update', \App\Models\Asset::class)
|
||||
<a href="{{ route('maintenances.create') }}" class="btn btn-primary pull-right"> {{ trans('general.create') }}</a>
|
||||
@endcan
|
||||
@stop
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box box-default">
|
||||
<div class="box-body">
|
||||
|
||||
<table
|
||||
data-columns="{{ \App\Presenters\AssetMaintenancesPresenter::dataTableLayout() }}"
|
||||
data-cookie-id-table="maintenancesTable"
|
||||
data-pagination="true"
|
||||
data-search="true"
|
||||
data-side-pagination="server"
|
||||
data-show-columns="true"
|
||||
data-show-fullscreen="true"
|
||||
data-show-footer="true"
|
||||
data-show-export="true"
|
||||
data-show-refresh="true"
|
||||
id="maintenancesTable"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{route('api.maintenances.index') }}"
|
||||
data-export-options='{
|
||||
"fileName": "export-maintenances-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'>
|
||||
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
||||
|
||||
@section('moar_scripts')
|
||||
@include ('partials.bootstrap-table', ['exportFile' => 'maintenances-export', 'search' => true])
|
||||
<script nonce="{{ csrf_token() }}">
|
||||
function maintenanceActions(value, row) {
|
||||
var actions = '<nobr>';
|
||||
if ((row) && (row.available_actions.update === true)) {
|
||||
actions += '<a href="{{ config('app.url') }}/hardware/maintenances/' + row.id + '/edit" class="btn btn-sm btn-warning" data-tooltip="true" title="Update"><i class="fas fa-pencil-alt"></i></a> ';
|
||||
}
|
||||
actions += '</nobr>'
|
||||
if ((row) && (row.available_actions.delete === true)) {
|
||||
actions += '<a href="{{ config('app.url') }}/hardware/maintenances/' + row.id + '" '
|
||||
+ ' class="btn btn-danger btn-sm delete-asset" data-tooltip="true" '
|
||||
+ ' data-toggle="modal" '
|
||||
+ ' data-content="{{ trans('general.sure_to_delete') }} ' + row.name + '?" '
|
||||
+ ' data-title="{{ trans('general.delete') }}" onClick="return false;">'
|
||||
+ '<i class="fas fa-trash"></i></a></nobr>';
|
||||
}
|
||||
|
||||
return actions;
|
||||
}
|
||||
|
||||
</script>
|
||||
@stop
|
103
SNIPE-IT/resources/views/asset_maintenances/view.blade.php
Normal file
103
SNIPE-IT/resources/views/asset_maintenances/view.blade.php
Normal file
@ -0,0 +1,103 @@
|
||||
<?php
|
||||
use Carbon\Carbon;
|
||||
?>
|
||||
@extends('layouts/default')
|
||||
|
||||
{{-- Page title --}}
|
||||
@section('title')
|
||||
{{ trans('admin/asset_maintenances/general.view') }} {{ $assetMaintenance->title }}
|
||||
@parent
|
||||
@stop
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
<div class="row header">
|
||||
<div class="col-md-12">
|
||||
<h2 class="title">
|
||||
{{ trans('admin/asset_maintenances/general.view') }}
|
||||
{{ " - " . $assetMaintenance->title }}
|
||||
</h2>
|
||||
|
||||
<div class="btn-group pull-right">
|
||||
<div class="dropdown">
|
||||
<button class="btn btn-default dropdown-toggle" data-toggle="dropdown">{{ trans('button.actions') }}
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu pull-right" role="menu" aria-labelledby="dropdownMenu1">
|
||||
<li role="presentation"><a href="{{ route('maintenances.update', $assetMaintenance->id) }}">{{ trans('admin/asset_maintenances/general.edit') }}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="user-profile ">
|
||||
<div class="row profile">
|
||||
<div class="col-md-9 bio">
|
||||
<!-- 1st Row Begin -->
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-sm-12" style="padding-bottom: 10px; margin-left: 15px; word-wrap: break-word;">
|
||||
<strong>{{ trans('admin/asset_maintenances/form.asset_maintenance_type') }}: </strong>
|
||||
{{ $assetMaintenance->asset_maintenance_type }}
|
||||
</div>
|
||||
</div>
|
||||
<!-- 1st Row End -->
|
||||
|
||||
<!-- 2nd Row Begin -->
|
||||
<div class="row">
|
||||
<div class="col-md-3 col-sm-3" style="padding-bottom: 10px; margin-left: 15px; word-wrap: break-word;">
|
||||
<strong>{{ trans('admin/asset_maintenances/table.asset_name') }}: </strong>
|
||||
<a href="{{ route('hardware.show', $assetMaintenance->asset_id) }}">
|
||||
{{ $assetMaintenance->asset->name }}
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-md-3 col-sm-3" style="padding-bottom: 10px; margin-left: 15px; word-wrap: break-word;">
|
||||
<strong>{{ trans('general.supplier') }}: </strong>
|
||||
<a href="{{ route('suppliers.show', $assetMaintenance->supplier_id) }}">
|
||||
{{ $assetMaintenance->supplier->name }}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 2nd Row End -->
|
||||
<!-- 3rd Row Begin -->
|
||||
<div class="row">
|
||||
<div class="col-md-3 col-sm-3" style="padding-bottom: 10px; margin-left: 15px; word-wrap: break-word;">
|
||||
<strong>{{ trans('admin/asset_maintenances/form.start_date') }}: </strong>
|
||||
<?php $startDate = Carbon::parse($assetMaintenance->start_date); ?>
|
||||
{{ $startDate->toDateString() }}
|
||||
</div>
|
||||
<div class="col-md-3 col-sm-3" style="padding-bottom: 10px; margin-left: 15px; word-wrap: break-word;">
|
||||
<strong>{{ trans('admin/asset_maintenances/form.completion_date') }}: </strong>
|
||||
{{ $completionDate = $assetMaintenance->completion_date }}
|
||||
{{ $completionDate ? $completionDate : trans('admin/asset_maintenances/message.asset_maintenance_incomplete') }}
|
||||
</div>
|
||||
<div class="col-md-3 col-sm-3" style="padding-bottom: 10px; margin-left: 15px; word-wrap: break-word;">
|
||||
<strong>{{ trans('admin/asset_maintenances/form.asset_maintenance_time') }}: </strong>
|
||||
{{ $assetMaintenance->asset_maintenance_time }}
|
||||
</div>
|
||||
</div>
|
||||
<!-- 3rd Row End -->
|
||||
<!-- 4th Row Begin -->
|
||||
<div class="row">
|
||||
<div class="col-md-3 col-sm-3" style="padding-bottom: 10px; margin-left: 15px; word-wrap: break-word;">
|
||||
<strong>{{ trans('admin/asset_maintenances/form.cost') }}: </strong>
|
||||
{{ trans( 'general.currency' ) . Helper::formatCurrencyOutput($assetMaintenance->cost) }}
|
||||
</div>
|
||||
<div class="col-md-3 col-sm-3" style="padding-bottom: 10px; margin-left: 15px; word-wrap: break-word;">
|
||||
<strong>{{ trans('admin/asset_maintenances/form.is_warranty') }}: </strong>
|
||||
{{ $assetMaintenance->is_warranty ? trans('admin/asset_maintenances/message.warranty') : trans('admin/asset_maintenances/message.not_warranty') }}
|
||||
</div>
|
||||
</div>
|
||||
<!-- 4th Row End -->
|
||||
<!-- 5th Row Begin -->
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-sm-12" style="padding-bottom: 10px; margin-left: 15px; word-wrap: break-word;">
|
||||
<strong>{{ trans('admin/asset_maintenances/form.notes') }}: </strong>
|
||||
{!! nl2br(Helper::parseEscapedMarkedownInline($assetMaintenance->notes)) !!}
|
||||
</div>
|
||||
</div>
|
||||
<!-- 5th Row End -->
|
||||
</div> <!-- col-md-9 bio end -->
|
||||
</div> <!-- row profile end -->
|
||||
</div> <!-- user-profile end -->
|
||||
@stop
|
1
SNIPE-IT/resources/views/auth/emails/password.blade.php
Normal file
1
SNIPE-IT/resources/views/auth/emails/password.blade.php
Normal file
@ -0,0 +1 @@
|
||||
{{ trans('mail.reset_password') }} <a href="{{ $link = url('password/reset', $token).'?email='.urlencode($user->getEmailForPasswordReset()) }}"> {{ $link }} </a>
|
115
SNIPE-IT/resources/views/auth/login.blade.php
Normal file
115
SNIPE-IT/resources/views/auth/login.blade.php
Normal file
@ -0,0 +1,115 @@
|
||||
@extends('layouts/basic')
|
||||
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
|
||||
<form role="form" action="{{ url('/login') }}" method="POST" autocomplete="{{ (config('auth.login_autocomplete') === true) ? 'on' : 'off' }}">
|
||||
<input type="hidden" name="_token" value="{{ csrf_token() }}" />
|
||||
|
||||
|
||||
<!-- this is a hack to prevent Chrome from trying to autocomplete fields -->
|
||||
<input type="text" name="prevent_autofill" id="prevent_autofill" value="" style="display:none;" aria-hidden="true">
|
||||
<input type="password" name="password_fake" id="password_fake" value="" style="display:none;" aria-hidden="true">
|
||||
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-4 col-md-offset-4">
|
||||
|
||||
@if (($snipeSettings->google_login=='1') && ($snipeSettings->google_client_id!='') && ($snipeSettings->google_client_secret!=''))
|
||||
|
||||
<br><br>
|
||||
<a href="{{ route('google.redirect') }}" class="btn btn-block btn-social btn-google btn-lg">
|
||||
<i class="fa-brands fa-google"></i>
|
||||
{{ trans('auth/general.google_login') }}
|
||||
</a>
|
||||
|
||||
<div class="separator">{{ strtoupper(trans('general.or')) }}</div>
|
||||
@endif
|
||||
|
||||
|
||||
<div class="box login-box">
|
||||
<div class="box-header with-border">
|
||||
<h1 class="box-title"> {{ trans('auth/general.login_prompt') }}</h1>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="login-box-body">
|
||||
<div class="row">
|
||||
|
||||
@if ($snipeSettings->login_note)
|
||||
<div class="col-md-12">
|
||||
<div class="alert alert-info">
|
||||
{!! Helper::parseEscapedMarkedown($snipeSettings->login_note) !!}
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Notifications -->
|
||||
@include('notifications')
|
||||
|
||||
@if (!config('app.require_saml'))
|
||||
<div class="col-md-12">
|
||||
<!-- CSRF Token -->
|
||||
|
||||
|
||||
<fieldset>
|
||||
|
||||
<div class="form-group{{ $errors->has('username') ? ' has-error' : '' }}">
|
||||
<label for="username"><i class="fas fa-user" aria-hidden="true"></i> {{ trans('admin/users/table.username') }}</label>
|
||||
<input class="form-control" placeholder="{{ trans('admin/users/table.username') }}" name="username" type="text" id="username" autocomplete="{{ (config('auth.login_autocomplete') === true) ? 'on' : 'off' }}" autofocus>
|
||||
{!! $errors->first('username', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
<div class="form-group{{ $errors->has('password') ? ' has-error' : '' }}">
|
||||
<label for="password"><i class="fa fa-key" aria-hidden="true"></i> {{ trans('admin/users/table.password') }}</label>
|
||||
<input class="form-control" placeholder="{{ trans('admin/users/table.password') }}" name="password" type="password" id="password" autocomplete="{{ (config('auth.login_autocomplete') === true) ? 'on' : 'off' }}">
|
||||
{!! $errors->first('password', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
<div class="form-group{{ $errors->has('password') ? ' has-error' : '' }}">
|
||||
<label class="form-control">
|
||||
<input name="remember" type="checkbox" value="1"> {{ trans('auth/general.remember_me') }}
|
||||
</label>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div> <!-- end col-md-12 -->
|
||||
@endif
|
||||
</div> <!-- end row -->
|
||||
|
||||
@if (!config('app.require_saml') && $snipeSettings->saml_enabled)
|
||||
<div class="row">
|
||||
<div class="text-right col-md-12">
|
||||
<a href="{{ route('saml.login') }}">{{ trans('auth/general.saml_login') }}</a>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
@if (config('app.require_saml'))
|
||||
<a class="btn btn-primary btn-block" href="{{ route('saml.login') }}">{{ trans('auth/general.saml_login') }}</a>
|
||||
@else
|
||||
<button class="btn btn-primary btn-block">{{ trans('auth/general.login') }}</button>
|
||||
@endif
|
||||
|
||||
@if ($snipeSettings->custom_forgot_pass_url)
|
||||
<div class="col-md-12 text-right" style="padding-top: 15px;">
|
||||
<a href="{{ $snipeSettings->custom_forgot_pass_url }}" rel="noopener">{{ trans('auth/general.forgot_password') }}</a>
|
||||
</div>
|
||||
@elseif (!config('app.require_saml'))
|
||||
<div class="col-md-12 text-right" style="padding-top: 15px;">
|
||||
<a href="{{ route('password.request') }}">{{ trans('auth/general.forgot_password') }}</a>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
</div>
|
||||
|
||||
</div> <!-- end login box -->
|
||||
|
||||
|
||||
</div> <!-- col-md-4 -->
|
||||
|
||||
</div> <!-- end row -->
|
||||
</div> <!-- end container -->
|
||||
</form>
|
||||
|
||||
@stop
|
122
SNIPE-IT/resources/views/auth/passwords/email.blade.php
Normal file
122
SNIPE-IT/resources/views/auth/passwords/email.blade.php
Normal file
@ -0,0 +1,122 @@
|
||||
@extends('layouts/basic')
|
||||
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
|
||||
|
||||
@if ($snipeSettings->custom_forgot_pass_url)
|
||||
<!-- The admin settings specify an LDAP password reset URL to let's send them there -->
|
||||
<div class="col-md-4 col-md-offset-4" style="margin-top: 20px;">
|
||||
<div class="box box-header text-center">
|
||||
<h3 class="box-title">
|
||||
<a href="{{ $snipeSettings->custom_forgot_pass_url }}" rel="noopener">
|
||||
{{ trans('auth/general.ldap_reset_password') }}
|
||||
</a>
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@else
|
||||
|
||||
|
||||
<form class="form" role="form" method="POST" action="{{ url('/password/email') }}">
|
||||
{!! csrf_field() !!}
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-4 col-md-offset-4">
|
||||
|
||||
<div class="box login-box" style="width: 100%">
|
||||
<div class="box-header with-border">
|
||||
<h2 class="box-title"> {{ trans('auth/general.send_password_link') }}</h2>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="login-box-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="alert alert-info">
|
||||
<i class="fas fa-info-circle" aria-hidden="true"></i>
|
||||
{!! trans('auth/general.username_help_top') !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="row">
|
||||
|
||||
|
||||
<!-- Notifications -->
|
||||
@include('notifications')
|
||||
|
||||
|
||||
|
||||
<div class="form-group{{ $errors->has('username') ? ' has-error' : '' }}">
|
||||
|
||||
<div class="col-md-12">
|
||||
<label for="username"><i class="fas fa-user" aria-hidden="true"></i> {{ trans('admin/users/table.username') }} </label>
|
||||
<input type="text" class="form-control" name="username" value="{{ old('username') }}" placeholder="{{ trans('admin/users/table.username') }}" aria-label="username">
|
||||
{!! $errors->first('username', '<span class="alert-msg"><i class="fas fa-times"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<br>
|
||||
<!-- show help text toggle -->
|
||||
<a href="#" id="show">
|
||||
<i class="fa fa-caret-right"></i>
|
||||
{{ trans('general.show_help') }}
|
||||
</a>
|
||||
|
||||
<!-- hide help text toggle -->
|
||||
<a href="#" id="hide" style="display:none">
|
||||
<i class="fa fa-caret-up"></i>
|
||||
{{ trans('general.hide_help') }}
|
||||
</a>
|
||||
|
||||
<!-- help text -->
|
||||
<p class="help-block" id="help-text" style="display:none">
|
||||
{!! trans('auth/general.username_help_bottom') !!}
|
||||
</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box-footer">
|
||||
<button type="submit" class="btn btn-lg btn-primary btn-block">
|
||||
{{ trans('auth/general.email_reset_password') }}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
@endif
|
||||
@stop
|
||||
|
||||
@push('js')
|
||||
<script nonce="{{ csrf_token() }}">
|
||||
$(document).ready(function () {
|
||||
$("#show").click(function(){
|
||||
$("#help-text").fadeIn(500);
|
||||
$("#show").hide();
|
||||
$("#hide").show();
|
||||
});
|
||||
|
||||
$("#hide").click(function(){
|
||||
$("#help-text").fadeOut(300);
|
||||
$("#show").show();
|
||||
$("#hide").hide();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
79
SNIPE-IT/resources/views/auth/passwords/reset.blade.php
Normal file
79
SNIPE-IT/resources/views/auth/passwords/reset.blade.php
Normal file
@ -0,0 +1,79 @@
|
||||
@extends('layouts/basic')
|
||||
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
|
||||
|
||||
<form class="form-horizontal" role="form" method="POST" action="{{ url('/password/reset') }}">
|
||||
{!! csrf_field() !!}
|
||||
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
|
||||
|
||||
|
||||
<div class="col-md-6 col-md-offset-3">
|
||||
|
||||
<div class="box login-box" style="width: 100%">
|
||||
<div class="box-header with-border">
|
||||
<h2 class="box-title"> {{ trans('auth/general.reset_password') }}</h2>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="login-box-body">
|
||||
<div class="row">
|
||||
|
||||
<!-- Notifications -->
|
||||
@include('notifications')
|
||||
|
||||
|
||||
|
||||
<input type="hidden" name="token" value="{{ $token }}">
|
||||
|
||||
<div class="form-group{{ $errors->has('username') ? ' has-error' : '' }}">
|
||||
<label class="col-md-4 control-label"><i class="fas fa-user" aria-hidden="true"></i> {{ trans('admin/users/table.username') }}</label>
|
||||
|
||||
<div class="col-md-6">
|
||||
<input type="text" class="form-control" name="username" value="{{ old('username', $username) }}">
|
||||
{!! $errors->first('username', '<span class="alert-msg"><i class="fas fa-times"></i> :message</span>') !!}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group{{ $errors->has('password') ? ' has-error' : '' }}">
|
||||
<label class="col-md-4 control-label" for="password"><i class="fa fa-key" aria-hidden="true"></i> {{ trans('admin/users/table.password') }}</label>
|
||||
|
||||
<div class="col-md-6">
|
||||
<input type="password" class="form-control" name="password" aria-label="password">
|
||||
{!! $errors->first('password', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group{{ $errors->has('password_confirmation') ? ' has-error' : '' }}">
|
||||
<label class="col-md-4 control-label" for="password_confirmation"><i class="fa fa-key" aria-hidden="true"></i> {{ trans('admin/users/table.password_confirm') }}</label>
|
||||
<div class="col-md-6">
|
||||
<input type="password" class="form-control" name="password_confirmation" aria-label="password_confirmation">
|
||||
{!! $errors->first('password_confirmation', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
<button type="submit" class="btn btn-lg btn-primary btn-block">
|
||||
{{ trans('auth/general.reset_password') }}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@stop
|
||||
|
||||
|
59
SNIPE-IT/resources/views/auth/two_factor.blade.php
Normal file
59
SNIPE-IT/resources/views/auth/two_factor.blade.php
Normal file
@ -0,0 +1,59 @@
|
||||
@extends('layouts/basic')
|
||||
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
|
||||
|
||||
|
||||
<div class="col-md-4 col-md-offset-4">
|
||||
<form role="form" action="{{ 'two-factor' }}" method="POST">
|
||||
|
||||
<div class="box login-box">
|
||||
<div class="box-header">
|
||||
<h2 class="box-title"> {{ trans('admin/settings/general.two_factor') }}</h2>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="login-box-body">
|
||||
<div class="row">
|
||||
|
||||
|
||||
<!-- Notifications -->
|
||||
@include('notifications')
|
||||
|
||||
<div class="col-md-12">
|
||||
<!-- CSRF Token -->
|
||||
<input type="hidden" name="_token" value="{{ csrf_token() }}" />
|
||||
|
||||
<fieldset>
|
||||
<div class="form-group{{ $errors->has('secret') ? ' has-error' : '' }}">
|
||||
<input class="form-control" placeholder="{{ trans('admin/settings/general.two_factor_secret') }}" name="two_factor_secret" type="text" aria-label="two_factor_secret" autofocus>
|
||||
{!! $errors->first('two_factor_secret', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
<button class="btn btn-lg btn-primary btn-block">{{ trans('general.submit') }}</button>
|
||||
</div>
|
||||
<div class="col-md-12 col-sm-12 col-xs-12 text-right" style="padding-top: 10px;">
|
||||
<a href="{{ route('logout.get') }}" onclick="document.getElementById('logout-form').submit(); return false;">
|
||||
{{ trans('general.cancel') }}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<form id="logout-form" action="{{ route('logout.post') }}" method="POST" style="display: none;">
|
||||
{{ csrf_field() }}
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@stop
|
64
SNIPE-IT/resources/views/auth/two_factor_enroll.blade.php
Normal file
64
SNIPE-IT/resources/views/auth/two_factor_enroll.blade.php
Normal file
@ -0,0 +1,64 @@
|
||||
@extends('layouts/basic')
|
||||
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
|
||||
|
||||
|
||||
<div class="col-md-4 col-md-offset-4">
|
||||
<form role="form" action="{{ route('two-factor') }}" method="POST">
|
||||
|
||||
<div class="box login-box">
|
||||
<div class="box-header">
|
||||
<h2 class="box-title"> {{ trans('admin/settings/general.two_factor_enrollment') }}</h2>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="login-box-body">
|
||||
<div class="row">
|
||||
|
||||
<!-- Notifications -->
|
||||
@include('notifications')
|
||||
|
||||
<div class="col-md-12">
|
||||
{{ trans('admin/settings/general.two_factor_enrollment_text') }}
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 text-center">
|
||||
{!! $barcode_obj->getHtmlDiv() !!}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-12">
|
||||
<!-- CSRF Token -->
|
||||
<input type="hidden" name="_token" value="{{ csrf_token() }}" />
|
||||
|
||||
<fieldset>
|
||||
<div class="form-group{{ $errors->has('secret') ? ' has-error' : '' }}">
|
||||
<input class="form-control" placeholder="{{ trans('admin/settings/general.two_factor_secret') }}" name="two_factor_secret" type="text" aria-label="two_factor_secret" autofocus>
|
||||
{!! $errors->first('two_factor_secret', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
<button class="btn btn-lg btn-primary btn-block">{{ trans('admin/settings/general.two_factor_config_complete') }}</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@stop
|
65
SNIPE-IT/resources/views/categories/edit.blade.php
Normal file
65
SNIPE-IT/resources/views/categories/edit.blade.php
Normal file
@ -0,0 +1,65 @@
|
||||
@extends('layouts/edit-form', [
|
||||
'createText' => trans('admin/categories/general.create') ,
|
||||
'updateText' => trans('admin/categories/general.update'),
|
||||
'helpPosition' => 'right',
|
||||
'helpText' => trans('help.categories'),
|
||||
'topSubmit' => 'true',
|
||||
'formAction' => (isset($item->id)) ? route('categories.update', ['category' => $item->id]) : route('categories.store'),
|
||||
])
|
||||
|
||||
@section('inputFields')
|
||||
|
||||
@include ('partials.forms.edit.name', ['translated_name' => trans('admin/categories/general.name')])
|
||||
|
||||
<!-- Type -->
|
||||
<div class="form-group {{ $errors->has('category_type') ? ' has-error' : '' }}">
|
||||
<label for="category_type" class="col-md-3 control-label">{{ trans('general.type') }}</label>
|
||||
<div class="col-md-7 required">
|
||||
{{ Form::select('category_type', $category_types , old('category_type', $item->category_type), array('class'=>'select2', 'style'=>'min-width:350px', 'aria-label'=>'category_type', ($item->category_type!='') || ($item->itemCount() > 0) ? 'disabled' : '')) }}
|
||||
{!! $errors->first('category_type', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
<div class="col-md-7 col-md-offset-3">
|
||||
<p class="help-block">{!! trans('admin/categories/message.update.cannot_change_category_type') !!} </p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<livewire:category-edit-form
|
||||
:default-eula-text="$snipeSettings->default_eula_text"
|
||||
:eula-text="old('eula_text', $item->eula_text)"
|
||||
:require-acceptance="old('require_acceptance', $item->require_acceptance)"
|
||||
:send-check-in-email="old('checkin_email', $item->checkin_email)"
|
||||
:use-default-eula="old('use_default_eula', $item->use_default_eula)"
|
||||
/>
|
||||
|
||||
@include ('partials.forms.edit.image-upload', ['image_path' => app('categories_upload_path')])
|
||||
|
||||
|
||||
@stop
|
||||
|
||||
@section('content')
|
||||
@parent
|
||||
|
||||
|
||||
@if ($snipeSettings->default_eula_text!='')
|
||||
<!-- Modal -->
|
||||
<div class="modal fade" id="eulaModal" tabindex="-1" role="dialog" aria-labelledby="eulaModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h2 class="modal-title" id="eulaModalLabel">{{ trans('admin/settings/general.default_eula_text') }}</h2>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
{{ \App\Models\Setting::getDefaultEula() }}
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">{{ trans('button.cancel') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
|
||||
|
||||
@stop
|
59
SNIPE-IT/resources/views/categories/index.blade.php
Normal file
59
SNIPE-IT/resources/views/categories/index.blade.php
Normal file
@ -0,0 +1,59 @@
|
||||
@extends('layouts/default')
|
||||
|
||||
{{-- Page title --}}
|
||||
@section('title')
|
||||
{{ trans('general.categories') }}
|
||||
@parent
|
||||
@stop
|
||||
|
||||
|
||||
@section('header_right')
|
||||
<a href="{{ route('categories.create') }}" class="btn btn-primary pull-right">
|
||||
{{ trans('general.create') }}</a>
|
||||
@stop
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box box-default">
|
||||
<div class="box-body">
|
||||
<div class="table-responsive">
|
||||
|
||||
<table
|
||||
data-columns="{{ \App\Presenters\CategoryPresenter::dataTableLayout() }}"
|
||||
data-cookie-id-table="categoryTable"
|
||||
data-pagination="true"
|
||||
data-id-table="categoryTable"
|
||||
data-search="true"
|
||||
data-side-pagination="server"
|
||||
data-show-columns="true"
|
||||
data-show-fullscreen="true"
|
||||
data-show-export="true"
|
||||
data-show-refresh="true"
|
||||
data-sort-order="asc"
|
||||
id="categoryTable"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{ route('api.categories.index') }}"
|
||||
data-export-options='{
|
||||
"fileName": "export-categories-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'>
|
||||
</table>
|
||||
</div>
|
||||
</div><!-- /.box-body -->
|
||||
</div><!-- /.box -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@stop
|
||||
|
||||
@section('moar_scripts')
|
||||
@include ('partials.bootstrap-table',
|
||||
['exportFile' => 'category-export',
|
||||
'search' => true,
|
||||
'columns' => \App\Presenters\CategoryPresenter::dataTableLayout()
|
||||
])
|
||||
@stop
|
||||
|
186
SNIPE-IT/resources/views/categories/view.blade.php
Normal file
186
SNIPE-IT/resources/views/categories/view.blade.php
Normal file
@ -0,0 +1,186 @@
|
||||
@extends('layouts/default')
|
||||
|
||||
{{-- Page title --}}
|
||||
@section('title')
|
||||
|
||||
{{ $category->name }}
|
||||
{{ ucwords($category_type_route) }}
|
||||
|
||||
@parent
|
||||
@stop
|
||||
|
||||
@section('header_right')
|
||||
|
||||
<a href="{{ URL::previous() }}" class="btn btn-primary" style="margin-right: 10px;">
|
||||
{{ trans('general.back') }}</a>
|
||||
|
||||
<div class="btn-group pull-right">
|
||||
<button class="btn btn-default dropdown-toggle" data-toggle="dropdown">{{ trans('button.actions') }}
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="{{ route('categories.edit', ['category' => $category->id]) }}">{{ trans('admin/categories/general.edit') }}</a></li>
|
||||
<li><a href="{{ route('categories.create') }}">{{ trans('general.create') }}</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
@stop
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<div class="nav-tabs-custom">
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="active">
|
||||
<a href="#items" data-toggle="tab" title="{{ trans('general.items') }}"> {{ ucwords($category_type_route) }}
|
||||
@if ($category->category_type=='asset')
|
||||
<badge class="badge badge-secondary"> {{ $category->showableAssets()->count() }}</badge>
|
||||
@endif
|
||||
</a>
|
||||
</li>
|
||||
@if ($category->category_type=='asset')
|
||||
<li>
|
||||
<a href="#models" data-toggle="tab" title="{{ trans('general.asset_models') }}">{{ trans('general.asset_models') }}
|
||||
<badge class="badge badge-secondary"> {{ $category->models->count()}}</badge>
|
||||
</a>
|
||||
</li>
|
||||
@endif
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane fade in active" id="items">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="table-responsive">
|
||||
@if ($category->category_type=='asset')
|
||||
@include('partials.asset-bulk-actions')
|
||||
@endif
|
||||
|
||||
<table
|
||||
|
||||
@if ($category->category_type=='asset')
|
||||
|
||||
data-columns="{{ \App\Presenters\AssetPresenter::dataTableLayout() }}"
|
||||
data-cookie-id-table="categoryAssetsTable"
|
||||
id="categoryAssetsTable"
|
||||
data-id-table="categoryAssetsTable"
|
||||
data-toolbar="#assetsBulkEditToolbar"
|
||||
data-bulk-button-id="#bulkAssetEditButton"
|
||||
data-bulk-form-id="#assetsBulkForm"
|
||||
data-click-to-select="true"
|
||||
data-export-options='{
|
||||
"fileName": "export-{{ str_slug($category->name) }}-assets-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'
|
||||
@elseif ($category->category_type=='accessory')
|
||||
data-columns="{{ \App\Presenters\AccessoryPresenter::dataTableLayout() }}"
|
||||
data-cookie-id-table="categoryAccessoryTable"
|
||||
id="categoryAccessoryTable"
|
||||
data-id-table="categoryAccessoryTable"
|
||||
data-export-options='{
|
||||
"fileName": "export-{{ str_slug($category->name) }}-accessories-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'
|
||||
@elseif ($category->category_type=='consumable')
|
||||
data-columns="{{ \App\Presenters\ConsumablePresenter::dataTableLayout() }}"
|
||||
data-cookie-id-table="categoryConsumableTable"
|
||||
id="categoryConsumableTable"
|
||||
data-id-table="categoryConsumableTable"
|
||||
data-export-options='{
|
||||
"fileName": "export-{{ str_slug($category->name) }}-consumables-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'
|
||||
@elseif ($category->category_type=='component')
|
||||
data-columns="{{ \App\Presenters\ComponentPresenter::dataTableLayout() }}"
|
||||
data-cookie-id-table="categoryCompomnentTable"
|
||||
id="categoryCompomnentTable"
|
||||
data-id-table="categoryCompomnentTable"
|
||||
data-export-options='{
|
||||
"fileName": "export-{{ str_slug($category->name) }}-components-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'
|
||||
@elseif ($category->category_type=='license')
|
||||
data-columns="{{ \App\Presenters\LicensePresenter::dataTableLayout() }}"
|
||||
data-cookie-id-table="categoryLicenseTable"
|
||||
id="categoryLicenseTable"
|
||||
data-id-table="categoryLicenseTable"
|
||||
data-export-options='{
|
||||
"fileName": "export-{{ str_slug($category->name) }}-licenses-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'
|
||||
@endif
|
||||
|
||||
data-pagination="true"
|
||||
data-search="true"
|
||||
data-show-footer="true"
|
||||
data-side-pagination="server"
|
||||
data-show-columns="true"
|
||||
data-show-export="true"
|
||||
data-show-refresh="true"
|
||||
data-sort-order="asc"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{ route('api.'.$category_type_route.'.index',['category_id'=> $category->id]) }}">
|
||||
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="models">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
@can('update', \App\Models\AssetModel::class)
|
||||
@if ($category->models->count() > 0)
|
||||
@if ($category->category_type=='asset')
|
||||
@include('partials.models-bulk-actions')
|
||||
@endif
|
||||
@endif
|
||||
@endcan
|
||||
|
||||
<table
|
||||
data-columns="{{ \App\Presenters\AssetModelPresenter::dataTableLayout() }}"
|
||||
data-cookie-id-table="asssetModelsTable"
|
||||
data-pagination="true"
|
||||
data-id-table="asssetModelsTable"
|
||||
data-search="true"
|
||||
data-show-footer="true"
|
||||
data-side-pagination="server"
|
||||
data-show-columns="true"
|
||||
data-toolbar="#modelsBulkEditToolbar"
|
||||
data-bulk-button-id="#bulkModelsEditButton"
|
||||
data-bulk-form-id="#modelsBulkForm"
|
||||
data-show-export="true"
|
||||
data-show-refresh="true"
|
||||
data-sort-order="asc"
|
||||
id="asssetModelsTable"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{ route('api.models.index', ['status' => request('status'), 'category_id' => $category->id]) }}"
|
||||
data-export-options='{
|
||||
"fileName": "export-models-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div> <!-- .tab-content-->
|
||||
</div> <!-- .nav-tabs-custom -->
|
||||
</div> <!-- .col-md-12> -->
|
||||
</div> <!-- .row -->
|
||||
@stop
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@section('moar_scripts')
|
||||
@include ('partials.bootstrap-table')
|
||||
@stop
|
17
SNIPE-IT/resources/views/companies/edit.blade.php
Normal file
17
SNIPE-IT/resources/views/companies/edit.blade.php
Normal file
@ -0,0 +1,17 @@
|
||||
@extends('layouts/edit-form', [
|
||||
'createText' => trans('admin/companies/table.create') ,
|
||||
'updateText' => trans('admin/companies/table.update'),
|
||||
'helpPosition' => 'right',
|
||||
'helpText' => trans('help.companies'),
|
||||
'formAction' => (isset($item->id)) ? route('companies.update', ['company' => $item->id]) : route('companies.store'),
|
||||
])
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('inputFields')
|
||||
@include ('partials.forms.edit.name', ['translated_name' => trans('admin/companies/table.name')])
|
||||
@include ('partials.forms.edit.phone')
|
||||
@include ('partials.forms.edit.fax')
|
||||
@include ('partials.forms.edit.email')
|
||||
@include ('partials.forms.edit.image-upload', ['image_path' => app('companies_upload_path')])
|
||||
|
||||
@stop
|
56
SNIPE-IT/resources/views/companies/index.blade.php
Normal file
56
SNIPE-IT/resources/views/companies/index.blade.php
Normal file
@ -0,0 +1,56 @@
|
||||
@extends('layouts/default')
|
||||
|
||||
{{-- Page title --}}
|
||||
@section('title')
|
||||
{{ trans('general.companies') }}
|
||||
@parent
|
||||
@stop
|
||||
|
||||
@section('header_right')
|
||||
<a href="{{ route('companies.create') }}" class="btn btn-primary pull-right">
|
||||
{{ trans('general.create') }}</a>
|
||||
@stop
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col-md-9">
|
||||
<div class="box box-default">
|
||||
<div class="box-body">
|
||||
<div class="table-responsive">
|
||||
|
||||
<table
|
||||
data-columns="{{ \App\Presenters\CompanyPresenter::dataTableLayout() }}"
|
||||
data-cookie-id-table="companiesTable"
|
||||
data-pagination="true"
|
||||
data-id-table="companiesTable"
|
||||
data-search="true"
|
||||
data-side-pagination="server"
|
||||
data-show-columns="true"
|
||||
data-show-export="true"
|
||||
data-show-refresh="true"
|
||||
data-show-fullscreen="true"
|
||||
data-sort-order="asc"
|
||||
id="companiesTable"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{ route('api.companies.index') }}"
|
||||
data-export-options='{
|
||||
"fileName": "export-companies-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- side address column -->
|
||||
<div class="col-md-3">
|
||||
<h2>{{ trans('admin/companies/general.about_companies') }}</h2>
|
||||
<p>{{ trans('admin/companies/general.about_companies_description') }}</p>
|
||||
</div>
|
||||
|
||||
@stop
|
||||
|
||||
@section('moar_scripts')
|
||||
@include ('partials.bootstrap-table')
|
||||
@stop
|
261
SNIPE-IT/resources/views/companies/view.blade.php
Normal file
261
SNIPE-IT/resources/views/companies/view.blade.php
Normal file
@ -0,0 +1,261 @@
|
||||
@extends('layouts/default')
|
||||
|
||||
{{-- Page title --}}
|
||||
@section('title')
|
||||
{{ $company->name }}
|
||||
@parent
|
||||
@stop
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="nav-tabs-custom">
|
||||
<ul class="nav nav-tabs">
|
||||
|
||||
|
||||
<li class="active">
|
||||
<a href="#asset_tab" data-toggle="tab">
|
||||
<span class="hidden-lg hidden-md">
|
||||
<i class="fas fa-barcode" aria-hidden="true"></i>
|
||||
</span>
|
||||
<span class="hidden-xs hidden-sm">{{ trans('general.assets') }}
|
||||
{!! ($company->assets()->AssetsForShow()->count() > 0 ) ? '<badge class="badge badge-secondary">'.number_format($company->assets()->AssetsForShow()->count()).'</badge>' : '' !!}
|
||||
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="#licenses_tab" data-toggle="tab">
|
||||
<span class="hidden-lg hidden-md">
|
||||
<i class="far fa-save"></i>
|
||||
</span>
|
||||
<span class="hidden-xs hidden-sm">{{ trans('general.licenses') }}
|
||||
{!! ($company->licenses->count() > 0 ) ? '<badge class="badge badge-secondary">'.number_format($company->licenses->count()).'</badge>' : '' !!}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="#accessories_tab" data-toggle="tab">
|
||||
<span class="hidden-lg hidden-md">
|
||||
<i class="far fa-keyboard"></i>
|
||||
</span> <span class="hidden-xs hidden-sm">{{ trans('general.accessories') }}
|
||||
{!! ($company->accessories->count() > 0 ) ? '<badge class="badge badge-secondary">'.number_format($company->accessories->count()).'</badge>' : '' !!}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="#consumables_tab" data-toggle="tab">
|
||||
<span class="hidden-lg hidden-md">
|
||||
<i class="fas fa-tint"></i></span>
|
||||
<span class="hidden-xs hidden-sm">{{ trans('general.consumables') }}
|
||||
{!! ($company->consumables->count() > 0 ) ? '<badge class="badge badge-secondary">'.number_format($company->consumables->count()).'</badge>' : '' !!}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="#components_tab" data-toggle="tab">
|
||||
<span class="hidden-lg hidden-md">
|
||||
<i class="far fa-hdd"></i></span>
|
||||
<span class="hidden-xs hidden-sm">{{ trans('general.components') }}
|
||||
{!! (($company->components) && ($company->components->count() > 0 )) ? '<badge class="badge badge-secondary">'.number_format($company->components->count()).'</badge>' : '' !!}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="#users_tab" data-toggle="tab">
|
||||
<span class="hidden-lg hidden-md">
|
||||
<i class="fas fa-users"></i></span>
|
||||
<span class="hidden-xs hidden-sm">{{ trans('general.people') }}
|
||||
{!! (($company->users) && ($company->users->count() > 0 )) ? '<badge class="badge badge-secondary">'.number_format($company->users->count()).'</badge>' : '' !!}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
|
||||
<div class="tab-pane fade in active" id="asset_tab">
|
||||
<!-- checked out assets table -->
|
||||
<div class="table table-responsive">
|
||||
@include('partials.asset-bulk-actions')
|
||||
|
||||
<table
|
||||
data-columns="{{ \App\Presenters\AssetPresenter::dataTableLayout() }}"
|
||||
data-cookie-id-table="assetsListingTable"
|
||||
data-pagination="true"
|
||||
data-id-table="assetsListingTable"
|
||||
data-search="true"
|
||||
data-side-pagination="server"
|
||||
data-show-columns="true"
|
||||
data-show-export="true"
|
||||
data-show-refresh="true"
|
||||
data-sort-order="asc"
|
||||
data-toolbar="#assetsBulkEditToolbar"
|
||||
data-bulk-button-id="#bulkAssetEditButton"
|
||||
data-bulk-form-id="#assetsBulkForm"
|
||||
data-click-to-select="true"
|
||||
id="assetsListingTable"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{route('api.assets.index',['company_id' => $company->id]) }}"
|
||||
data-export-options='{
|
||||
"fileName": "export-companies-{{ str_slug($company->name) }}-assets-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'>
|
||||
</table>
|
||||
</div>
|
||||
</div><!-- /asset_tab -->
|
||||
|
||||
<div class="tab-pane" id="licenses_tab">
|
||||
<div class="table-responsive">
|
||||
|
||||
<table
|
||||
data-columns="{{ \App\Presenters\LicensePresenter::dataTableLayout() }}"
|
||||
data-cookie-id-table="licensesTable"
|
||||
data-pagination="true"
|
||||
data-id-table="licensesTable"
|
||||
data-search="true"
|
||||
data-side-pagination="server"
|
||||
data-show-columns="true"
|
||||
data-show-export="true"
|
||||
data-show-refresh="true"
|
||||
data-sort-order="asc"
|
||||
id="licensesTable"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{route('api.licenses.index',['company_id' => $company->id]) }}"
|
||||
data-export-options='{
|
||||
"fileName": "export-companies-{{ str_slug($company->name) }}-licenses-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div><!-- /licenses-tab -->
|
||||
|
||||
<div class="tab-pane" id="accessories_tab">
|
||||
<div class="table-responsive">
|
||||
|
||||
<table
|
||||
data-columns="{{ \App\Presenters\AccessoryPresenter::dataTableLayout() }}"
|
||||
data-cookie-id-table="accessoriesTable"
|
||||
data-pagination="true"
|
||||
data-id-table="accessoriesTable"
|
||||
data-search="true"
|
||||
data-side-pagination="server"
|
||||
data-show-columns="true"
|
||||
data-show-export="true"
|
||||
data-show-refresh="true"
|
||||
data-sort-order="asc"
|
||||
id="accessoriesTable"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{route('api.accessories.index',['company_id' => $company->id]) }}"
|
||||
data-export-options='{
|
||||
"fileName": "export-companies-{{ str_slug($company->name) }}-accessories-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div><!-- /accessories-tab -->
|
||||
|
||||
<div class="tab-pane" id="consumables_tab">
|
||||
<div class="table-responsive">
|
||||
|
||||
<table
|
||||
data-columns="{{ \App\Presenters\ConsumablePresenter::dataTableLayout() }}"
|
||||
data-cookie-id-table="consumablesTable"
|
||||
data-pagination="true"
|
||||
data-id-table="consumablesTable"
|
||||
data-search="true"
|
||||
data-side-pagination="server"
|
||||
data-show-columns="true"
|
||||
data-show-export="true"
|
||||
data-show-refresh="true"
|
||||
data-sort-order="asc"
|
||||
id="consumablesTable"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{route('api.consumables.index',['company_id' => $company->id]) }}"
|
||||
data-export-options='{
|
||||
"fileName": "export-companies-{{ str_slug($company->name) }}-consumables-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div><!-- /consumables-tab -->
|
||||
|
||||
<div class="tab-pane" id="components_tab">
|
||||
<div class="table-responsive">
|
||||
|
||||
<table
|
||||
data-columns="{{ \App\Presenters\ComponentPresenter::dataTableLayout() }}"
|
||||
data-cookie-id-table="componentsTable"
|
||||
data-pagination="true"
|
||||
data-id-table="componentsTable"
|
||||
data-search="true"
|
||||
data-side-pagination="server"
|
||||
data-show-columns="true"
|
||||
data-show-export="true"
|
||||
data-show-refresh="true"
|
||||
data-sort-order="asc"
|
||||
id="componentsTable"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{route('api.components.index',['company_id' => $company->id]) }}"
|
||||
data-export-options='{
|
||||
"fileName": "export-companies-{{ str_slug($company->name) }}-components-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
</div><!-- /consumables-tab -->
|
||||
|
||||
<div class="tab-pane" id="users_tab">
|
||||
<div class="table-responsive">
|
||||
|
||||
<table
|
||||
data-columns="{{ \App\Presenters\UserPresenter::dataTableLayout() }}"
|
||||
data-cookie-id-table="usersTable"
|
||||
data-pagination="true"
|
||||
data-id-table="usersTable"
|
||||
data-search="true"
|
||||
data-side-pagination="server"
|
||||
data-show-columns="true"
|
||||
data-show-export="true"
|
||||
data-show-refresh="true"
|
||||
data-sort-order="asc"
|
||||
id="usersTable"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{route('api.users.index',['company_id' => $company->id]) }}"
|
||||
data-export-options='{
|
||||
"fileName": "export-companies-{{ str_slug($company->name) }}-users-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
</div><!-- /consumables-tab -->
|
||||
|
||||
|
||||
|
||||
|
||||
</div><!-- /.tab-content -->
|
||||
</div><!-- nav-tabs-custom -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@stop
|
||||
@section('moar_scripts')
|
||||
@include ('partials.bootstrap-table')
|
||||
|
||||
@stop
|
||||
|
69
SNIPE-IT/resources/views/components/checkin.blade.php
Normal file
69
SNIPE-IT/resources/views/components/checkin.blade.php
Normal file
@ -0,0 +1,69 @@
|
||||
@extends('layouts/default')
|
||||
|
||||
{{-- Page title --}}
|
||||
@section('title')
|
||||
{{ trans('admin/components/general.checkin') }}
|
||||
@parent
|
||||
@stop
|
||||
|
||||
|
||||
@section('header_right')
|
||||
<a href="{{ URL::previous() }}" class="btn btn-primary pull-right">
|
||||
{{ trans('general.back') }}</a>
|
||||
@stop
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<!-- left column -->
|
||||
<div class="col-md-7">
|
||||
<form class="form-horizontal" method="post" action="{{ route('components.checkin.store', [$component_assets->id, 'backto' => 'asset']) }}" autocomplete="off">
|
||||
{{csrf_field()}}
|
||||
|
||||
<div class="box box-default">
|
||||
<div class="box-header with-border">
|
||||
<h2 class="box-title"> {{ $component->name }}</h2>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
|
||||
<!-- Checked out to -->
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">{{ trans('general.checkin_from') }}</label>
|
||||
<div class="col-md-6">
|
||||
<p class="form-control-static">{{ $asset->present()->fullName }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Qty -->
|
||||
<div class="form-group {{ $errors->has('checkin_qty') ? 'error' : '' }}">
|
||||
<label for="checkin_qty" class="col-md-2 control-label">{{ trans('general.qty') }}</label>
|
||||
<div class="col-md-3">
|
||||
<input type="text" class="form-control" name="checkin_qty" aria-label="checkin_qty" value="{{ old('assigned_qty', $component_assets->assigned_qty) }}">
|
||||
</div>
|
||||
<div class="col-md-9 col-md-offset-2">
|
||||
<p class="help-block">{{ trans('admin/components/general.checkin_limit', ['assigned_qty' => $component_assets->assigned_qty]) }}</p>
|
||||
{!! $errors->first('checkin_qty', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i>
|
||||
:message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Note -->
|
||||
<div class="form-group {{ $errors->has('note') ? 'error' : '' }}">
|
||||
<label for="note" class="col-md-2 control-label">{{ trans('admin/hardware/form.notes') }}</label>
|
||||
<div class="col-md-7">
|
||||
<textarea class="col-md-6 form-control" id="note" name="note">{{ old('note', $component->note) }}</textarea>
|
||||
{!! $errors->first('note', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
<a class="btn btn-link" href="{{ route('components.index') }}">{{ trans('button.cancel') }}</a>
|
||||
<button type="submit" class="btn btn-primary pull-right"><i class="fas fa-check icon-white" aria-hidden="true"></i> {{ trans('general.checkin') }}</button>
|
||||
</div>
|
||||
</div> <!-- /.box-->
|
||||
</form>
|
||||
</div> <!-- /.col-md-7-->
|
||||
</div>
|
||||
|
||||
|
||||
@stop
|
66
SNIPE-IT/resources/views/components/checkout.blade.php
Normal file
66
SNIPE-IT/resources/views/components/checkout.blade.php
Normal file
@ -0,0 +1,66 @@
|
||||
@extends('layouts/default')
|
||||
|
||||
{{-- Page title --}}
|
||||
@section('title')
|
||||
{{ trans('admin/components/general.checkout') }}
|
||||
@parent
|
||||
@stop
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<form class="form-horizontal" id="checkout_form" method="post" action="" autocomplete="off">
|
||||
<!-- CSRF Token -->
|
||||
{{ csrf_field() }}
|
||||
|
||||
<div class="box box-default">
|
||||
@if ($component->id)
|
||||
<div class="box-header with-border">
|
||||
<div class="box-heading">
|
||||
<h2 class="box-title">{{ $component->name }} ({{ $component->numRemaining() }} {{ trans('admin/components/general.remaining') }})</h2>
|
||||
</div>
|
||||
</div><!-- /.box-header -->
|
||||
@endif
|
||||
|
||||
<div class="box-body">
|
||||
<!-- Asset -->
|
||||
@include ('partials.forms.edit.asset-select', ['translated_name' => trans('general.select_asset'), 'fieldname' => 'asset_id'])
|
||||
|
||||
<div class="form-group {{ $errors->has('assigned_qty') ? ' has-error' : '' }}">
|
||||
<label for="assigned_qty" class="col-md-3 control-label">
|
||||
{{ trans('general.qty') }}
|
||||
</label>
|
||||
<div class="col-md-2 col-sm-5 col-xs-5">
|
||||
<input class="form-control required col-md-12" type="text" name="assigned_qty" id="assigned_qty" value="{{ old('assigned_qty') ?? 1 }}" />
|
||||
</div>
|
||||
@if ($errors->first('assigned_qty'))
|
||||
<div class="col-md-9 col-md-offset-3">
|
||||
{!! $errors->first('assigned_qty', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Note -->
|
||||
<div class="form-group{{ $errors->has('note') ? ' error' : '' }}">
|
||||
<label for="note" class="col-md-3 control-label">{{ trans('admin/hardware/form.notes') }}</label>
|
||||
<div class="col-md-7">
|
||||
<textarea class="col-md-6 form-control" id="note" name="note">{{ old('note', $component->note) }}</textarea>
|
||||
{!! $errors->first('note', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div> <!-- .BOX-BODY-->
|
||||
<div class="box-footer">
|
||||
<a class="btn btn-link" href="{{ URL::previous() }}">{{ trans('button.cancel') }}</a>
|
||||
<button type="submit" id="submit_button" class="btn btn-primary pull-right"><i class="fas fa-check icon-white" aria-hidden="true"></i> {{ trans('general.checkout') }}</button>
|
||||
</div>
|
||||
</div> <!-- .box-default-->
|
||||
</form>
|
||||
</div> <!-- .col-md-9-->
|
||||
</div> <!-- .row -->
|
||||
|
||||
@stop
|
28
SNIPE-IT/resources/views/components/edit.blade.php
Normal file
28
SNIPE-IT/resources/views/components/edit.blade.php
Normal file
@ -0,0 +1,28 @@
|
||||
@extends('layouts/edit-form', [
|
||||
'createText' => trans('admin/components/general.create') ,
|
||||
'updateText' => trans('admin/components/general.update'),
|
||||
'helpPosition' => 'right',
|
||||
'helpText' => trans('help.components'),
|
||||
'formAction' => (isset($item->id)) ? route('components.update', ['component' => $item->id]) : route('components.store'),
|
||||
|
||||
])
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('inputFields')
|
||||
|
||||
@include ('partials.forms.edit.name', ['translated_name' => trans('admin/components/table.title')])
|
||||
@include ('partials.forms.edit.category-select', ['translated_name' => trans('general.category'), 'fieldname' => 'category_id','category_type' => 'component'])
|
||||
@include ('partials.forms.edit.quantity')
|
||||
@include ('partials.forms.edit.minimum_quantity')
|
||||
@include ('partials.forms.edit.serial', ['fieldname' => 'serial'])
|
||||
@include ('partials.forms.edit.company-select', ['translated_name' => trans('general.company'), 'fieldname' => 'company_id'])
|
||||
@include ('partials.forms.edit.location-select', ['translated_name' => trans('general.location'), 'fieldname' => 'location_id'])
|
||||
@include ('partials.forms.edit.supplier-select', ['translated_name' => trans('general.supplier'), 'fieldname' => 'supplier_id'])
|
||||
@include ('partials.forms.edit.order_number')
|
||||
@include ('partials.forms.edit.purchase_date')
|
||||
@include ('partials.forms.edit.purchase_cost')
|
||||
@include ('partials.forms.edit.notes')
|
||||
@include ('partials.forms.edit.image-upload', ['image_path' => app('components_upload_path')])
|
||||
|
||||
|
||||
@stop
|
55
SNIPE-IT/resources/views/components/index.blade.php
Normal file
55
SNIPE-IT/resources/views/components/index.blade.php
Normal file
@ -0,0 +1,55 @@
|
||||
@extends('layouts/default')
|
||||
|
||||
{{-- Page title --}}
|
||||
@section('title')
|
||||
{{ trans('general.components') }}
|
||||
@parent
|
||||
@stop
|
||||
|
||||
@section('header_right')
|
||||
@can('create', \App\Models\Component::class)
|
||||
<a href="{{ route('components.create') }}" accesskey="n" class="btn btn-primary pull-right"> {{ trans('general.create') }}</a>
|
||||
@endcan
|
||||
@stop
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box box-default">
|
||||
<div class="box-body">
|
||||
<table
|
||||
data-columns="{{ \App\Presenters\ComponentPresenter::dataTableLayout() }}"
|
||||
data-cookie-id-table="componentsTable"
|
||||
data-pagination="true"
|
||||
data-id-table="componentsTable"
|
||||
data-search="true"
|
||||
data-side-pagination="server"
|
||||
data-show-columns="true"
|
||||
data-show-fullscreen="true"
|
||||
data-show-export="true"
|
||||
data-show-footer="true"
|
||||
data-show-refresh="true"
|
||||
data-sort-order="asc"
|
||||
data-sort-name="name"
|
||||
id="componentsTable"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{ route('api.components.index') }}"
|
||||
data-export-options='{
|
||||
"fileName": "export-components-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'>
|
||||
</table>
|
||||
</div><!-- /.box-body -->
|
||||
</div><!-- /.box -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@stop
|
||||
|
||||
@section('moar_scripts')
|
||||
@include ('partials.bootstrap-table', ['exportFile' => 'components-export', 'search' => true, 'showFooter' => true, 'columns' => \App\Presenters\ComponentPresenter::dataTableLayout()])
|
||||
|
||||
|
||||
|
||||
@stop
|
297
SNIPE-IT/resources/views/components/view.blade.php
Normal file
297
SNIPE-IT/resources/views/components/view.blade.php
Normal file
@ -0,0 +1,297 @@
|
||||
@extends('layouts/default')
|
||||
|
||||
{{-- Page title --}}
|
||||
@section('title')
|
||||
|
||||
{{ $component->name }}
|
||||
{{ trans('general.component') }}
|
||||
@parent
|
||||
@stop
|
||||
|
||||
{{-- Right header --}}
|
||||
@section('header_right')
|
||||
@can('manage', $component)
|
||||
<div class="dropdown pull-right">
|
||||
<button class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
{{ trans('button.actions') }}
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
|
||||
<ul class="dropdown-menu pull-right" role="menu22">
|
||||
@if ($component->assigned_to != '')
|
||||
@can('checkin', $component)
|
||||
<li role="menuitem">
|
||||
<a href="{{ route('components.checkin.show', $component->id) }}">
|
||||
{{ trans('admin/components/general.checkin') }}
|
||||
</a>
|
||||
</li>
|
||||
@endcan
|
||||
@else
|
||||
@can('checkout', $component)
|
||||
<li role="menuitem">
|
||||
<a href="{{ route('components.checkout.show', $component->id) }}">
|
||||
{{ trans('admin/components/general.checkout') }}
|
||||
</a>
|
||||
</li>
|
||||
@endcan
|
||||
@endif
|
||||
|
||||
@can('update', $component)
|
||||
<li role="menuitem">
|
||||
<a href="{{ route('components.edit', $component->id) }}">
|
||||
{{ trans('admin/components/general.edit') }}
|
||||
</a>
|
||||
</li>
|
||||
@endcan
|
||||
</ul>
|
||||
</div>
|
||||
@endcan
|
||||
@stop
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
{{-- Page content --}}
|
||||
<div class="row">
|
||||
<div class="col-md-9">
|
||||
|
||||
<!-- Custom Tabs -->
|
||||
<div class="nav-tabs-custom">
|
||||
<ul class="nav nav-tabs hidden-print">
|
||||
|
||||
<li class="active">
|
||||
<a href="#checkedout" data-toggle="tab">
|
||||
<span class="hidden-lg hidden-md">
|
||||
<i class="fas fa-info-circle fa-2x" aria-hidden="true"></i>
|
||||
</span>
|
||||
<span class="hidden-xs hidden-sm">{{ trans('admin/users/general.info') }}</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
@can('components.files', $component)
|
||||
<li>
|
||||
<a href="#files" data-toggle="tab">
|
||||
<span class="hidden-lg hidden-md">
|
||||
<i class="far fa-file fa-2x" aria-hidden="true"></i></span>
|
||||
<span class="hidden-xs hidden-sm">{{ trans('general.file_uploads') }}
|
||||
{!! ($component->uploads->count() > 0 ) ? '<badge class="badge badge-secondary">'.number_format($component->uploads->count()).'</badge>' : '' !!}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
@endcan
|
||||
|
||||
@can('components.files', $component)
|
||||
<li class="pull-right">
|
||||
<a href="#" data-toggle="modal" data-target="#uploadFileModal">
|
||||
<i class="fas fa-paperclip" aria-hidden="true"></i> {{ trans('button.upload') }}
|
||||
</a>
|
||||
</li>
|
||||
@endcan
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
|
||||
<div class="tab-pane active" id="checkedout">
|
||||
<div class="table table-responsive">
|
||||
|
||||
<table
|
||||
data-cookie-id-table="componentsCheckedoutTable"
|
||||
data-pagination="true"
|
||||
data-id-table="componentsCheckedoutTable"
|
||||
data-search="true"
|
||||
data-side-pagination="server"
|
||||
data-show-columns="true"
|
||||
data-show-export="true"
|
||||
data-show-footer="true"
|
||||
data-show-refresh="true"
|
||||
data-sort-order="asc"
|
||||
data-sort-name="name"
|
||||
id="componentsCheckedoutTable"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{ route('api.components.assets', $component->id)}}"
|
||||
data-export-options='{
|
||||
"fileName": "export-components-{{ str_slug($component->name) }}-checkedout-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-searchable="false" data-sortable="false" data-field="name" data-formatter="hardwareLinkFormatter">
|
||||
{{ trans('general.asset') }}
|
||||
</th>
|
||||
<th data-searchable="false" data-sortable="false" data-field="qty">
|
||||
{{ trans('general.qty') }}
|
||||
</th>
|
||||
<th data-searchable="false" data-sortable="false" data-field="note">
|
||||
{{ trans('general.notes') }}
|
||||
</th>
|
||||
<th data-searchable="false" data-sortable="false" data-field="created_at" data-formatter="dateDisplayFormatter">
|
||||
{{ trans('general.date') }}
|
||||
</th>
|
||||
<th data-switchable="false" data-searchable="false" data-sortable="false" data-field="checkincheckout" data-formatter="componentsInOutFormatter">
|
||||
{{ trans('general.checkin') }}/{{ trans('general.checkout') }}
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div> <!-- close tab-pane div -->
|
||||
|
||||
|
||||
@can('components.files', $component)
|
||||
<div class="tab-pane" id="files">
|
||||
|
||||
<div class="table-responsive">
|
||||
<table
|
||||
data-cookie-id-table="componentUploadsTable"
|
||||
data-id-table="componentUploadsTable"
|
||||
id="componentUploadsTable"
|
||||
data-search="true"
|
||||
data-pagination="true"
|
||||
data-side-pagination="client"
|
||||
data-show-columns="true"
|
||||
data-show-export="true"
|
||||
data-show-footer="true"
|
||||
data-toolbar="#upload-toolbar"
|
||||
data-show-refresh="true"
|
||||
data-sort-order="asc"
|
||||
data-sort-name="name"
|
||||
class="table table-striped snipe-table"
|
||||
data-export-options='{
|
||||
"fileName": "export-components-uploads-{{ str_slug($component->name) }}-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","delete","download","icon"]
|
||||
}'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-visible="true" data-field="icon" data-sortable="true">{{trans('general.file_type')}}</th>
|
||||
<th class="col-md-2" data-searchable="true" data-visible="true" data-field="image">{{ trans('general.image') }}</th>
|
||||
<th class="col-md-2" data-searchable="true" data-visible="true" data-field="filename" data-sortable="true">{{ trans('general.file_name') }}</th>
|
||||
<th class="col-md-1" data-searchable="true" data-visible="true" data-field="filesize">{{ trans('general.filesize') }}</th>
|
||||
<th class="col-md-2" data-searchable="true" data-visible="true" data-field="notes" data-sortable="true">{{ trans('general.notes') }}</th>
|
||||
<th class="col-md-1" data-searchable="true" data-visible="true" data-field="download">{{ trans('general.download') }}</th>
|
||||
<th class="col-md-2" data-searchable="true" data-visible="true" data-field="created_at" data-sortable="true">{{ trans('general.created_at') }}</th>
|
||||
<th class="col-md-1" data-searchable="true" data-visible="true" data-field="actions">{{ trans('table.actions') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if ($component->uploads->count() > 0)
|
||||
@foreach ($component->uploads as $file)
|
||||
<tr>
|
||||
<td>
|
||||
<i class="{{ Helper::filetype_icon($file->filename) }} icon-med" aria-hidden="true"></i>
|
||||
<span class="sr-only">{{ Helper::filetype_icon($file->filename) }}</span>
|
||||
|
||||
</td>
|
||||
<td>
|
||||
@if ($file->filename)
|
||||
@if ( Helper::checkUploadIsImage($file->get_src('components')))
|
||||
<a href="{{ route('show.componentfile', ['componentId' => $component->id, 'fileId' => $file->id, 'download' => 'false']) }}" data-toggle="lightbox" data-type="image"><img src="{{ route('show.componentfile', ['componentId' => $component->id, 'fileId' => $file->id]) }}" class="img-thumbnail" style="max-width: 50px;"></a>
|
||||
@endif
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
{{ $file->filename }}
|
||||
</td>
|
||||
<td data-value="{{ (Storage::exists('private_uploads/components/'.$file->filename) ? Storage::size('private_uploads/components/'.$file->filename) : '') }}">
|
||||
{{ @Helper::formatFilesizeUnits(Storage::exists('private_uploads/components/'.$file->filename) ? Storage::size('private_uploads/components/'.$file->filename) : '') }}
|
||||
</td>
|
||||
|
||||
<td>
|
||||
@if ($file->note)
|
||||
{{ $file->note }}
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if ($file->filename)
|
||||
<a href="{{ route('show.componentfile', [$component->id, $file->id]) }}" class="btn btn-sm btn-default">
|
||||
<i class="fas fa-download" aria-hidden="true"></i>
|
||||
<span class="sr-only">{{ trans('general.download') }}</span>
|
||||
</a>
|
||||
|
||||
<a href="{{ route('show.componentfile', [$component->id, $file->id, 'inline' => 'true']) }}" class="btn btn-sm btn-default" target="_blank">
|
||||
<i class="fa fa-external-link" aria-hidden="true"></i>
|
||||
</a>
|
||||
|
||||
@endif
|
||||
</td>
|
||||
<td>{{ $file->created_at }}</td>
|
||||
<td>
|
||||
<a class="btn delete-asset btn-danger btn-sm" href="{{ route('delete/componentfile', [$component->id, $file->id]) }}" data-content="{{ trans('general.delete_confirm', ['item' => $file->filename]) }}" data-title="{{ trans('general.delete') }}">
|
||||
<i class="fas fa-trash icon-white" aria-hidden="true"></i>
|
||||
<span class="sr-only">{{ trans('general.delete') }}</span>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@else
|
||||
<tr>
|
||||
<td colspan="8">{{ trans('general.no_results') }}</td>
|
||||
</tr>
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div> <!-- /.tab-pane -->
|
||||
@endcan
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- .col-md-9-->
|
||||
|
||||
|
||||
<!-- side address column -->
|
||||
<div class="col-md-3">
|
||||
@if ($component->image!='')
|
||||
<div class="col-md-12 text-center" style="padding-bottom: 15px;">
|
||||
<a href="{{ Storage::disk('public')->url('components/'.e($component->image)) }}" data-toggle="lightbox">
|
||||
<img src="{{ Storage::disk('public')->url('components/'.e($component->image)) }}" class="img-responsive img-thumbnail" alt="{{ $component->name }}"></a>
|
||||
</div>
|
||||
|
||||
@endif
|
||||
|
||||
@if ($component->serial!='')
|
||||
<div class="col-md-12" style="padding-bottom: 5px;"><strong>{{ trans('admin/hardware/form.serial') }}: </strong>
|
||||
{{ $component->serial }} </div>
|
||||
@endif
|
||||
|
||||
@if ($component->purchase_date)
|
||||
<div class="col-md-12" style="padding-bottom: 5px;"><strong>{{ trans('admin/components/general.date') }}: </strong>
|
||||
{{ $component->purchase_date }} </div>
|
||||
@endif
|
||||
|
||||
@if ($component->purchase_cost)
|
||||
<div class="col-md-12" style="padding-bottom: 5px;"><strong>{{ trans('admin/components/general.cost') }}:</strong>
|
||||
{{ $snipeSettings->default_currency }}
|
||||
|
||||
{{ Helper::formatCurrencyOutput($component->purchase_cost) }} </div>
|
||||
@endif
|
||||
|
||||
@if ($component->order_number)
|
||||
<div class="col-md-12" style="padding-bottom: 5px;"><strong>{{ trans('general.order_number') }}:</strong>
|
||||
{{ $component->order_number }} </div>
|
||||
@endif
|
||||
|
||||
@if ($component->notes)
|
||||
|
||||
<div class="col-md-12">
|
||||
<strong>
|
||||
{{ trans('general.notes') }}
|
||||
</strong>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
{!! nl2br(Helper::parseEscapedMarkedownInline($component->notes)) !!}
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
</div>
|
||||
</div> <!-- .row-->
|
||||
|
||||
@can('components.files', Component::class)
|
||||
@include ('modals.upload-file', ['item_type' => 'component', 'item_id' => $component->id])
|
||||
@endcan
|
||||
@stop
|
||||
|
||||
@section('moar_scripts')
|
||||
@include ('partials.bootstrap-table', ['exportFile' => 'component' . $component->name . '-export', 'search' => false])
|
||||
@stop
|
87
SNIPE-IT/resources/views/consumables/checkout.blade.php
Normal file
87
SNIPE-IT/resources/views/consumables/checkout.blade.php
Normal file
@ -0,0 +1,87 @@
|
||||
@extends('layouts/default')
|
||||
|
||||
{{-- Page title --}}
|
||||
@section('title')
|
||||
{{ trans('admin/consumables/general.checkout') }}
|
||||
@parent
|
||||
@stop
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-9">
|
||||
|
||||
<form class="form-horizontal" id="checkout_form" method="post" action="" autocomplete="off">
|
||||
<!-- CSRF Token -->
|
||||
<input type="hidden" name="_token" value="{{ csrf_token() }}" />
|
||||
|
||||
<div class="box box-default">
|
||||
|
||||
@if ($consumable->id)
|
||||
<div class="box-header with-border">
|
||||
<div class="box-heading">
|
||||
<h2 class="box-title">{{ $consumable->name }} </h2>
|
||||
</div>
|
||||
</div><!-- /.box-header -->
|
||||
@endif
|
||||
|
||||
<div class="box-body">
|
||||
@if ($consumable->name)
|
||||
<!-- consumable name -->
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">{{ trans('admin/consumables/general.consumable_name') }}</label>
|
||||
<div class="col-md-6">
|
||||
<p class="form-control-static">{{ $consumable->name }}</p>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- User -->
|
||||
@include ('partials.forms.edit.user-select', ['translated_name' => trans('general.select_user'), 'fieldname' => 'assigned_to', 'required'=> 'true'])
|
||||
|
||||
|
||||
@if ($consumable->requireAcceptance() || $consumable->getEula() || ($snipeSettings->webhook_endpoint!=''))
|
||||
<div class="form-group notification-callout">
|
||||
<div class="col-md-8 col-md-offset-3">
|
||||
<div class="callout callout-info">
|
||||
|
||||
@if ($consumable->category->require_acceptance=='1')
|
||||
<i class="far fa-envelope"></i>
|
||||
{{ trans('admin/categories/general.required_acceptance') }}
|
||||
<br>
|
||||
@endif
|
||||
|
||||
@if ($consumable->getEula())
|
||||
<i class="far fa-envelope"></i>
|
||||
{{ trans('admin/categories/general.required_eula') }}
|
||||
<br>
|
||||
@endif
|
||||
|
||||
@if ($snipeSettings->webhook_endpoint!='')
|
||||
<i class="fab fa-slack"></i>
|
||||
{{ trans('general.webhook_msg_note') }}
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
<!-- Note -->
|
||||
<div class="form-group {{ $errors->has('note') ? 'error' : '' }}">
|
||||
<label for="note" class="col-md-3 control-label">{{ trans('admin/hardware/form.notes') }}</label>
|
||||
<div class="col-md-7">
|
||||
<textarea class="col-md-6 form-control" name="note">{{ old('note') }}</textarea>
|
||||
{!! $errors->first('note', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- .box-body -->
|
||||
<div class="box-footer">
|
||||
<a class="btn btn-link" href="{{ route('consumables.show', ['consumable'=> $consumable->id]) }}">{{ trans('button.cancel') }}</a>
|
||||
<button type="submit" id="submit_button" class="btn btn-primary pull-right"><i class="fas fa-check icon-white" aria-hidden="true"></i> {{ trans('general.checkout') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
27
SNIPE-IT/resources/views/consumables/edit.blade.php
Normal file
27
SNIPE-IT/resources/views/consumables/edit.blade.php
Normal file
@ -0,0 +1,27 @@
|
||||
@extends('layouts/edit-form', [
|
||||
'createText' => trans('admin/consumables/general.create') ,
|
||||
'updateText' => trans('admin/consumables/general.update'),
|
||||
'helpPosition' => 'right',
|
||||
'helpText' => trans('help.consumables'),
|
||||
'formAction' => (isset($item->id)) ? route('consumables.update', ['consumable' => $item->id]) : route('consumables.store'),
|
||||
])
|
||||
{{-- Page content --}}
|
||||
@section('inputFields')
|
||||
|
||||
@include ('partials.forms.edit.company-select', ['translated_name' => trans('general.company'), 'fieldname' => 'company_id'])
|
||||
@include ('partials.forms.edit.name', ['translated_name' => trans('admin/consumables/table.title')])
|
||||
@include ('partials.forms.edit.category-select', ['translated_name' => trans('general.category'), 'fieldname' => 'category_id', 'required' => 'true', 'category_type' => 'consumable'])
|
||||
@include ('partials.forms.edit.supplier-select', ['translated_name' => trans('general.supplier'), 'fieldname' => 'supplier_id'])
|
||||
@include ('partials.forms.edit.manufacturer-select', ['translated_name' => trans('general.manufacturer'), 'fieldname' => 'manufacturer_id'])
|
||||
@include ('partials.forms.edit.location-select', ['translated_name' => trans('general.location'), 'fieldname' => 'location_id'])
|
||||
@include ('partials.forms.edit.model_number')
|
||||
@include ('partials.forms.edit.item_number')
|
||||
@include ('partials.forms.edit.order_number')
|
||||
@include ('partials.forms.edit.purchase_date')
|
||||
@include ('partials.forms.edit.purchase_cost')
|
||||
@include ('partials.forms.edit.quantity')
|
||||
@include ('partials.forms.edit.minimum_quantity')
|
||||
@include ('partials.forms.edit.notes')
|
||||
@include ('partials.forms.edit.image-upload', ['image_path' => app('consumables_upload_path')])
|
||||
|
||||
@stop
|
56
SNIPE-IT/resources/views/consumables/index.blade.php
Normal file
56
SNIPE-IT/resources/views/consumables/index.blade.php
Normal file
@ -0,0 +1,56 @@
|
||||
@extends('layouts/default')
|
||||
|
||||
{{-- Page title --}}
|
||||
@section('title')
|
||||
{{ trans('general.consumables') }}
|
||||
@parent
|
||||
@stop
|
||||
|
||||
@section('header_right')
|
||||
@can('create', \App\Models\Consumable::class)
|
||||
<a href="{{ route('consumables.create') }}" accesskey="n" class="btn btn-primary pull-right"> {{ trans('general.create') }}</a>
|
||||
@endcan
|
||||
@stop
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<div class="box box-default">
|
||||
<div class="box-body">
|
||||
<table
|
||||
data-columns="{{ \App\Presenters\ConsumablePresenter::dataTableLayout() }}"
|
||||
data-cookie-id-table="consumablesTable"
|
||||
data-pagination="true"
|
||||
data-id-table="consumablesTable"
|
||||
data-search="true"
|
||||
data-side-pagination="server"
|
||||
data-show-columns="true"
|
||||
data-show-export="true"
|
||||
data-show-fullscreen="true"
|
||||
data-show-footer="true"
|
||||
data-show-refresh="true"
|
||||
data-sort-order="asc"
|
||||
data-sort-name="name"
|
||||
data-toolbar="#toolbar"
|
||||
id="consumablesTable"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{ route('api.consumables.index') }}"
|
||||
data-export-options='{
|
||||
"fileName": "export-consumables-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'>
|
||||
</table>
|
||||
|
||||
</div><!-- /.box-body -->
|
||||
</div><!-- /.box -->
|
||||
|
||||
</div> <!-- /.col-md-12 -->
|
||||
</div> <!-- /.row -->
|
||||
@stop
|
||||
|
||||
@section('moar_scripts')
|
||||
@include ('partials.bootstrap-table', ['exportFile' => 'consumables-export', 'search' => true,'showFooter' => true, 'columns' => \App\Presenters\ConsumablePresenter::dataTableLayout()])
|
||||
@stop
|
301
SNIPE-IT/resources/views/consumables/view.blade.php
Normal file
301
SNIPE-IT/resources/views/consumables/view.blade.php
Normal file
@ -0,0 +1,301 @@
|
||||
@extends('layouts/default')
|
||||
|
||||
{{-- Page title --}}
|
||||
@section('title')
|
||||
{{ $consumable->name }}
|
||||
{{ trans('general.consumable') }}
|
||||
@parent
|
||||
@stop
|
||||
|
||||
@section('header_right')
|
||||
<a href="{{ URL::previous() }}" class="btn btn-primary pull-right">
|
||||
{{ trans('general.back') }}</a>
|
||||
@stop
|
||||
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-9">
|
||||
|
||||
<!-- Custom Tabs -->
|
||||
<div class="nav-tabs-custom">
|
||||
<ul class="nav nav-tabs hidden-print">
|
||||
|
||||
<li class="active">
|
||||
<a href="#checkedout" data-toggle="tab">
|
||||
<span class="hidden-lg hidden-md">
|
||||
<i class="fas fa-info-circle fa-2x" aria-hidden="true"></i>
|
||||
</span>
|
||||
<span class="hidden-xs hidden-sm">{{ trans('admin/users/general.info') }}</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
@can('consumables.files', $consumable)
|
||||
<li>
|
||||
<a href="#files" data-toggle="tab">
|
||||
<span class="hidden-lg hidden-md">
|
||||
<i class="far fa-file fa-2x" aria-hidden="true"></i></span>
|
||||
<span class="hidden-xs hidden-sm">{{ trans('general.file_uploads') }}
|
||||
{!! ($consumable->uploads->count() > 0 ) ? '<badge class="badge badge-secondary">'.number_format($consumable->uploads->count()).'</badge>' : '' !!}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
@endcan
|
||||
|
||||
@can('update', $consumable)
|
||||
<li class="pull-right">
|
||||
<a href="#" data-toggle="modal" data-target="#uploadFileModal">
|
||||
<i class="fas fa-paperclip" aria-hidden="true"></i> {{ trans('button.upload') }}
|
||||
</a>
|
||||
</li>
|
||||
@endcan
|
||||
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
|
||||
<div class="tab-pane active" id="checkedout">
|
||||
<div class="table-responsive">
|
||||
|
||||
<table
|
||||
data-cookie-id-table="consumablesCheckedoutTable"
|
||||
data-pagination="true"
|
||||
data-id-table="consumablesCheckedoutTable"
|
||||
data-search="false"
|
||||
data-side-pagination="server"
|
||||
data-show-columns="true"
|
||||
data-show-export="true"
|
||||
data-show-footer="true"
|
||||
data-show-refresh="true"
|
||||
data-sort-order="asc"
|
||||
data-sort-name="name"
|
||||
id="consumablesCheckedoutTable"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{route('api.consumables.show.users', $consumable->id)}}"
|
||||
data-export-options='{
|
||||
"fileName": "export-consumables-{{ str_slug($consumable->name) }}-checkedout-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-searchable="false" data-sortable="false" data-field="avatar" data-formatter="imageFormatter">{{ trans('general.image') }}</th>
|
||||
<th data-searchable="false" data-sortable="false" data-field="name" formatter="usersLinkFormatter">{{ trans('general.user') }}</th>
|
||||
<th data-searchable="false" data-sortable="false" data-field="created_at" data-formatter="dateDisplayFormatter">
|
||||
{{ trans('general.date') }}
|
||||
</th>
|
||||
<th data-searchable="false" data-sortable="false" data-field="note">{{ trans('general.notes') }}</th>
|
||||
<th data-searchable="false" data-sortable="false" data-field="admin">{{ trans('general.admin') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div> <!-- close tab-pane div -->
|
||||
|
||||
|
||||
@can('consumables.files', $consumable)
|
||||
<div class="tab-pane" id="files">
|
||||
|
||||
<div class="table-responsive">
|
||||
<table
|
||||
data-cookie-id-table="consumableUploadsTable"
|
||||
data-id-table="consumableUploadsTable"
|
||||
id="consumableUploadsTable"
|
||||
data-search="true"
|
||||
data-pagination="true"
|
||||
data-side-pagination="client"
|
||||
data-show-columns="true"
|
||||
data-show-export="true"
|
||||
data-show-footer="true"
|
||||
data-toolbar="#upload-toolbar"
|
||||
data-show-refresh="true"
|
||||
data-sort-order="asc"
|
||||
data-sort-name="name"
|
||||
class="table table-striped snipe-table"
|
||||
data-export-options='{
|
||||
"fileName": "export-consumables-uploads-{{ str_slug($consumable->name) }}-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","delete","download","icon"]
|
||||
}'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-visible="true" data-field="icon" data-sortable="true">{{trans('general.file_type')}}</th>
|
||||
<th class="col-md-2" data-searchable="true" data-visible="true" data-field="image">{{ trans('general.image') }}</th>
|
||||
<th class="col-md-2" data-searchable="true" data-visible="true" data-field="filename" data-sortable="true">{{ trans('general.file_name') }}</th>
|
||||
<th class="col-md-1" data-searchable="true" data-visible="true" data-field="filesize">{{ trans('general.filesize') }}</th>
|
||||
<th class="col-md-2" data-searchable="true" data-visible="true" data-field="notes" data-sortable="true">{{ trans('general.notes') }}</th>
|
||||
<th class="col-md-1" data-searchable="true" data-visible="true" data-field="download">{{ trans('general.download') }}</th>
|
||||
<th class="col-md-2" data-searchable="true" data-visible="true" data-field="created_at" data-sortable="true">{{ trans('general.created_at') }}</th>
|
||||
<th class="col-md-1" data-searchable="true" data-visible="true" data-field="actions">{{ trans('table.actions') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if ($consumable->uploads->count() > 0)
|
||||
@foreach ($consumable->uploads as $file)
|
||||
<tr>
|
||||
<td>
|
||||
<i class="{{ Helper::filetype_icon($file->filename) }} icon-med" aria-hidden="true"></i>
|
||||
<span class="sr-only">{{ Helper::filetype_icon($file->filename) }}</span>
|
||||
|
||||
</td>
|
||||
<td>
|
||||
@if ($file->filename)
|
||||
@if ( Helper::checkUploadIsImage($file->get_src('consumables')))
|
||||
<a href="{{ route('show.consumablefile', ['consumableId' => $consumable->id, 'fileId' => $file->id, 'download' => 'false']) }}" data-toggle="lightbox" data-type="image"><img src="{{ route('show.consumablefile', ['consumableId' => $consumable->id, 'fileId' => $file->id]) }}" class="img-thumbnail" style="max-width: 50px;"></a>
|
||||
@endif
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
{{ $file->filename }}
|
||||
</td>
|
||||
<td data-value="{{ (Storage::exists('private_uploads/consumables/'.$file->filename) ? Storage::size('private_uploads/consumables/'.$file->filename) : '') }}">
|
||||
{{ @Helper::formatFilesizeUnits(Storage::exists('private_uploads/consumables/'.$file->filename) ? Storage::size('private_uploads/consumables/'.$file->filename) : '') }}
|
||||
</td>
|
||||
|
||||
<td>
|
||||
@if ($file->note)
|
||||
{!! nl2br(Helper::parseEscapedMarkedownInline($file->note)) !!}
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if ($file->filename)
|
||||
<a href="{{ route('show.consumablefile', [$consumable->id, $file->id]) }}" class="btn btn-sm btn-default">
|
||||
<i class="fas fa-download" aria-hidden="true"></i>
|
||||
<span class="sr-only">{{ trans('general.download') }}</span>
|
||||
</a>
|
||||
|
||||
<a href="{{ route('show.consumablefile', [$consumable->id, $file->id, 'inline' => 'true']) }}" class="btn btn-sm btn-default" target="_blank">
|
||||
<i class="fa fa-external-link" aria-hidden="true"></i>
|
||||
</a>
|
||||
@endif
|
||||
</td>
|
||||
<td>{{ $file->created_at }}</td>
|
||||
<td>
|
||||
<a class="btn delete-asset btn-danger btn-sm" href="{{ route('delete/consumablefile', [$consumable->id, $file->id]) }}" data-content="{{ trans('general.delete_confirm', ['item' => $file->filename]) }}" data-title="{{ trans('general.delete') }}">
|
||||
<i class="fas fa-trash icon-white" aria-hidden="true"></i>
|
||||
<span class="sr-only">{{ trans('general.delete') }}</span>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@else
|
||||
<tr>
|
||||
<td colspan="8">{{ trans('general.no_results') }}</td>
|
||||
</tr>
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div> <!-- /.tab-pane -->
|
||||
@endcan
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-3">
|
||||
|
||||
<div class="box box-default">
|
||||
<div class="box-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
|
||||
@if ($consumable->image!='')
|
||||
<div class="col-md-12 text-center">
|
||||
<a href="{{ Storage::disk('public')->url('consumables/'.e($consumable->image)) }}" data-toggle="lightbox">
|
||||
<img src="{{ Storage::disk('public')->url('consumables/'.e($consumable->image)) }}" class="img-responsive img-thumbnail" alt="{{ $consumable->name }}"></a>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if ($consumable->purchase_date)
|
||||
<div class="col-md-12">
|
||||
<strong>{{ trans('general.purchase_date') }}: </strong>
|
||||
{{ Helper::getFormattedDateObject($consumable->purchase_date, 'date', false) }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if ($consumable->purchase_cost)
|
||||
<div class="col-md-12">
|
||||
<strong>{{ trans('general.purchase_cost') }}:</strong>
|
||||
{{ $snipeSettings->default_currency }}
|
||||
{{ Helper::formatCurrencyOutput($consumable->purchase_cost) }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if ($consumable->item_no)
|
||||
<div class="col-md-12">
|
||||
<strong>{{ trans('admin/consumables/general.item_no') }}:</strong>
|
||||
{{ $consumable->item_no }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if ($consumable->model_number)
|
||||
<div class="col-md-12">
|
||||
<strong>{{ trans('general.model_no') }}:</strong>
|
||||
{{ $consumable->model_number }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if ($consumable->manufacturer)
|
||||
<div class="col-md-12">
|
||||
<strong>{{ trans('general.manufacturer') }}:</strong>
|
||||
<a href="{{ route('manufacturers.show', $consumable->manufacturer->id) }}">{{ $consumable->manufacturer->name }}</a>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if ($consumable->order_number)
|
||||
<div class="col-md-12">
|
||||
<strong>{{ trans('general.order_number') }}:</strong>
|
||||
{{ $consumable->order_number }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@can('checkout', \App\Models\Consumable::class)
|
||||
|
||||
<div class="col-md-12">
|
||||
<br><br>
|
||||
@if ($consumable->numRemaining() > 0)
|
||||
<a href="{{ route('consumables.checkout.show', $consumable->id) }}" style="margin-bottom:10px; width:100%" class="btn btn-primary btn-sm">
|
||||
{{ trans('general.checkout') }}
|
||||
</a>
|
||||
@else
|
||||
<button style="margin-bottom:10px; width:100%" class="btn btn-primary btn-sm disabled">
|
||||
{{ trans('general.checkout') }}
|
||||
</button>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
@endcan
|
||||
|
||||
@if ($consumable->notes)
|
||||
|
||||
<div class="col-md-12">
|
||||
<strong>
|
||||
{{ trans('general.notes') }}:
|
||||
</strong>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
{!! nl2br(Helper::parseEscapedMarkedownInline($consumable->notes)) !!}
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
</div>
|
||||
|
||||
</div> <!-- /.col-md-3-->
|
||||
</div> <!-- /.row-->
|
||||
|
||||
|
||||
|
||||
@can('consumables.files', \App\Models\Consumable::class)
|
||||
@include ('modals.upload-file', ['item_type' => 'consumable', 'item_id' => $consumable->id])
|
||||
@endcan
|
||||
@stop
|
||||
|
||||
@section('moar_scripts')
|
||||
@include ('partials.bootstrap-table', ['exportFile' => 'consumable' . $consumable->name . '-export', 'search' => false])
|
||||
@stop
|
336
SNIPE-IT/resources/views/custom_fields/fields/edit.blade.php
Normal file
336
SNIPE-IT/resources/views/custom_fields/fields/edit.blade.php
Normal file
@ -0,0 +1,336 @@
|
||||
@extends('layouts/default', [
|
||||
'helpText' => trans('admin/custom_fields/general.about_fieldsets_text'),
|
||||
'helpPosition' => 'right',
|
||||
])
|
||||
|
||||
|
||||
{{-- Page title --}}
|
||||
@section('title')
|
||||
{{ trans('admin/custom_fields/general.custom_fields') }}
|
||||
@parent
|
||||
@stop
|
||||
|
||||
@section('content')
|
||||
|
||||
@section('header_right')
|
||||
<a href="{{ route('fields.index') }}" class="btn btn-primary pull-right">
|
||||
{{ trans('general.back') }}</a>
|
||||
@stop
|
||||
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
|
||||
<!-- Horizontal Form -->
|
||||
@if ($field->id)
|
||||
{{ Form::open(['route' => ['fields.update', $field->id], 'class'=>'form-horizontal']) }}
|
||||
{{ method_field('PUT') }}
|
||||
@else
|
||||
{{ Form::open(['route' => 'fields.store', 'class'=>'form-horizontal']) }}
|
||||
@endif
|
||||
|
||||
@csrf
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box box-default">
|
||||
<div class="box-header with-border text-right">
|
||||
<button type="submit" class="btn btn-primary"> {{ trans('general.save') }}</button>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
|
||||
<div class="col-md-8">
|
||||
|
||||
<!-- Name -->
|
||||
<div class="form-group {{ $errors->has('name') ? ' has-error' : '' }}">
|
||||
<label for="name" class="col-md-3 control-label">
|
||||
{{ trans('admin/custom_fields/general.field_name') }}
|
||||
</label>
|
||||
<div class="col-md-8 required">
|
||||
{{ Form::text('name', old('name', $field->name), array('class' => 'form-control', 'aria-label'=>'name')) }}
|
||||
{!! $errors->first('name', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Element Type -->
|
||||
<div class="form-group {{ $errors->has('element') ? ' has-error' : '' }}">
|
||||
<label for="element" class="col-md-3 control-label">
|
||||
{{ trans('admin/custom_fields/general.field_element') }}
|
||||
</label>
|
||||
<div class="col-md-8 required">
|
||||
|
||||
{!! Form::customfield_elements('element', old('element', $field->element), 'field_element select2 form-control') !!}
|
||||
{!! $errors->first('element', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Element values -->
|
||||
<div class="form-group {{ $errors->has('field_values') ? ' has-error' : '' }}" id="field_values_text" style="display:none;">
|
||||
<label for="field_values" class="col-md-3 control-label">
|
||||
{{ trans('admin/custom_fields/general.field_values') }}
|
||||
</label>
|
||||
<div class="col-md-8 required">
|
||||
{!! Form::textarea('field_values', old('name', $field->field_values), ['style' => 'width: 100%', 'rows' => 4, 'class' => 'form-control', 'aria-label'=>'field_values']) !!}
|
||||
{!! $errors->first('field_values', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
<p class="help-block">{{ trans('admin/custom_fields/general.field_values_help') }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Format -->
|
||||
<div class="form-group {{ $errors->has('format') ? ' has-error' : '' }}" id="format_values">
|
||||
<label for="format" class="col-md-3 control-label">
|
||||
{{ trans('admin/custom_fields/general.field_format') }}
|
||||
</label>
|
||||
@php
|
||||
$field_format = '';
|
||||
if (stripos($field->format, 'regex') === 0){
|
||||
$field_format = 'CUSTOM REGEX';
|
||||
}
|
||||
@endphp
|
||||
<div class="col-md-8 required">
|
||||
{{ Form::select("format",Helper::predefined_formats(), ($field_format == '') ? $field->format : $field_format, array('class'=>'format select2 form-control', 'aria-label'=>'format', 'style' => 'width:100%;')) }}
|
||||
{!! $errors->first('format', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
<!-- Custom Format -->
|
||||
<div class="form-group {{ $errors->has('custom_format') ? ' has-error' : '' }}" id="custom_regex" style="display:none;">
|
||||
<label for="custom_format" class="col-md-3 control-label">
|
||||
{{ trans('admin/custom_fields/general.field_custom_format') }}
|
||||
</label>
|
||||
<div class="col-md-8 required">
|
||||
{{ Form::text('custom_format', old('custom_format', (($field->format!='') && (stripos($field->format,'regex')===0)) ? $field->format : ''), array('class' => 'form-control', 'id' => 'custom_format','aria-label'=>'custom_format', 'placeholder'=>'regex:/^[0-9]{15}$/')) }}
|
||||
<p class="help-block">{!! trans('admin/custom_fields/general.field_custom_format_help') !!}</p>
|
||||
|
||||
{!! $errors->first('custom_format', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Help Text -->
|
||||
<div class="form-group {{ $errors->has('help_text') ? ' has-error' : '' }}">
|
||||
<label for="help_text" class="col-md-3 control-label">
|
||||
{{ trans('admin/custom_fields/general.help_text') }}
|
||||
</label>
|
||||
<div class="col-md-8">
|
||||
{{ Form::text('help_text', old('help_text', $field->help_text), array('class' => 'form-control', 'aria-label'=>'help_text')) }}
|
||||
<p class="help-block">{{ trans('admin/custom_fields/general.help_text_description') }}</p>
|
||||
{!! $errors->first('help_text', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Set up checkbox form group -->
|
||||
<div class="form-group">
|
||||
|
||||
<!-- Encrypted warning callout box -->
|
||||
@if (($field->id) && ($field->field_encrypted=='1'))
|
||||
<div class="col-md-9 col-md-offset-3">
|
||||
<div class="alert alert-warning fade in">
|
||||
<i class="fas fa-exclamation-triangle faa-pulse animated"></i>
|
||||
<strong>{{ trans('general.notification_warning') }}:</strong>
|
||||
{{ trans('admin/custom_fields/general.encrypted_options') }}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (!$field->id)
|
||||
<!-- Encrypted -->
|
||||
<div class="col-md-9 col-md-offset-3" id="encryption_section">
|
||||
<label class="form-control">
|
||||
<input type="checkbox" value="1" name="field_encrypted" id="field_encrypted"{{ (Request::old('field_encrypted') || $field->field_encrypted) ? ' checked="checked"' : '' }}>
|
||||
{{ trans('admin/custom_fields/general.encrypt_field') }}
|
||||
</label>
|
||||
</div>
|
||||
<div class="col-md-9 col-md-offset-3" id="encrypt_warning" style="display:none;">
|
||||
<div class="callout callout-danger">
|
||||
<p><i class="fas fa-exclamation-triangle" aria-hidden="true"></i> {{ trans('admin/custom_fields/general.encrypt_field_help') }}</p>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
|
||||
|
||||
<!-- Auto-Add to Future Fieldsets -->
|
||||
<div class="col-md-9 col-md-offset-3">
|
||||
<label class="form-control">
|
||||
<input type="checkbox" name="auto_add_to_fieldsets" aria-label="auto_add_to_fieldsets" value="1"{{ (old('auto_add_to_fieldsets') || $field->auto_add_to_fieldsets) ? ' checked="checked"' : '' }}>
|
||||
{{ trans('admin/custom_fields/general.auto_add_to_fieldsets') }}
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<!-- Show in list view -->
|
||||
<div class="col-md-9 col-md-offset-3">
|
||||
<label class="form-control">
|
||||
<input type="checkbox" name="show_in_listview" aria-label="show_in_listview" value="1"{{ (old('show_in_listview') || $field->show_in_listview) ? ' checked="checked"' : '' }}>
|
||||
{{ trans('admin/custom_fields/general.show_in_listview') }}
|
||||
</label>
|
||||
</div>
|
||||
|
||||
|
||||
@if ((!$field->id) || ($field->field_encrypted=='0'))
|
||||
|
||||
<!-- Show in requestable list view -->
|
||||
<div class="col-md-9 col-md-offset-3" id="show_in_requestable_list">
|
||||
<label class="form-control">
|
||||
<input type="checkbox" name="show_in_requestable_list" aria-label="show_in_requestable_list" value="1"{{ (old('show_in_requestable_list') || $field->show_in_requestable_list) ? ' checked="checked"' : '' }}>
|
||||
{{ trans('admin/custom_fields/general.show_in_requestable_list') }}
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<!-- Show in Email -->
|
||||
<div class="col-md-9 col-md-offset-3" id="show_in_email">
|
||||
<label class="form-control">
|
||||
<input type="checkbox" name="show_in_email" aria-label="show_in_email" value="1"{{ (old('show_in_email') || $field->show_in_email) ? ' checked="checked"' : '' }}>
|
||||
{{ trans('admin/custom_fields/general.show_in_email') }}
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<!-- Value Must be Unique -->
|
||||
<div class="col-md-9 col-md-offset-3" id="is_unique">
|
||||
<label class="form-control">
|
||||
<input type="checkbox" name="is_unique" aria-label="is_unique" value="1"{{ (old('is_unique') || $field->is_unique) ? ' checked="checked"' : '' }}>
|
||||
{{ trans('admin/custom_fields/general.is_unique') }}
|
||||
</label>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Show in View All Assets profile view -->
|
||||
<div class="col-md-9 col-md-offset-3" id="display_in_user_view">
|
||||
<label class="form-control">
|
||||
<input type="checkbox" name="display_in_user_view" aria-label="display_in_user_view" value="1" {{ (old('display_in_user_view') || $field->display_in_user_view) ? ' checked="checked"' : '' }}>
|
||||
{{ trans('admin/custom_fields/general.display_in_user_view') }}
|
||||
</label>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@if ($fieldsets->count() > 0)
|
||||
<!-- begin fieldset columns -->
|
||||
<div class="col-md-4">
|
||||
|
||||
<h4>{{ trans('admin/custom_fields/general.fieldsets') }}</h4>
|
||||
{!! $errors->first('associate_fieldsets', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
|
||||
<label class="form-control">
|
||||
<input type="checkbox" id="checkAll">
|
||||
{{ trans('general.select_all') }}
|
||||
</label>
|
||||
|
||||
@foreach ($fieldsets as $fieldset)
|
||||
@php
|
||||
$array_fieldname = 'associate_fieldsets.'.$fieldset->id;
|
||||
|
||||
// Consider the form data first
|
||||
if (old($array_fieldname) == $fieldset->id) {
|
||||
$checked = 'checked';
|
||||
// Otherwise check DB
|
||||
} elseif (isset($field->fieldset) && ($field->fieldset->contains($fieldset->id))) {
|
||||
$checked = 'checked';
|
||||
} else {
|
||||
$checked = '';
|
||||
}
|
||||
@endphp
|
||||
|
||||
<label class="form-control{{ $errors->has('associate_fieldsets.'.$fieldset->id) ? ' has-error' : '' }}">
|
||||
<input type="checkbox"
|
||||
name="associate_fieldsets[{{ $fieldset->id }}]"
|
||||
class="fieldset"
|
||||
value="{{ $fieldset->id }}"
|
||||
{{ $checked }}>
|
||||
{{ $fieldset->name }}
|
||||
{!! $errors->first('associate_fieldsets.'.$fieldset->id, '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
|
||||
</label>
|
||||
|
||||
@endforeach
|
||||
|
||||
</div>
|
||||
@endif
|
||||
</div> <!-- /.box-body-->
|
||||
|
||||
<div class="box-footer text-right">
|
||||
<button type="submit" class="btn btn-primary"> {{ trans('general.save') }}</button>
|
||||
</div>
|
||||
|
||||
</div> <!--.box.box-default-->
|
||||
|
||||
|
||||
</div> <!--/.col-md-9-->
|
||||
|
||||
|
||||
</div>
|
||||
{{ Form::close() }}
|
||||
@stop
|
||||
|
||||
@section('moar_scripts')
|
||||
<script nonce="{{ csrf_token() }}">
|
||||
$(document).ready(function(){
|
||||
|
||||
$("#checkAll").change(function () {
|
||||
$(".fieldset").prop('checked', $(this).prop("checked"));
|
||||
});
|
||||
|
||||
// Only display the custom format field if it's a custom format validation type
|
||||
$(".format").change(function(){
|
||||
$(this).find("option:selected").each(function(){
|
||||
if ($('.format').prop("selectedIndex") == 1) {
|
||||
$("#custom_regex").show();
|
||||
} else{
|
||||
$("#custom_regex").hide();
|
||||
}
|
||||
});
|
||||
}).change();
|
||||
|
||||
// If the element is a radiobutton/checkbox, doesn't show the format input box
|
||||
$(".field_element").change(function(){
|
||||
$(this).find("option:selected").each(function(){
|
||||
if (($(this).attr("value") != "radio") && ($(this).attr("value") != "checkbox")){
|
||||
$("#format_values").show();
|
||||
} else{
|
||||
$("#format_values").hide();
|
||||
}
|
||||
});
|
||||
}).change();
|
||||
|
||||
// Only display the field element if the type is not text
|
||||
// and don't display encryption option for checkbox or radio
|
||||
$(".field_element").change(function(){
|
||||
$(this).find("option:selected").each(function(){
|
||||
if (($(this).attr("value")!="text") && ($(this).attr("value")!="textarea")){
|
||||
$("#field_values_text").show();
|
||||
if ($(this).attr("value") == "checkbox" || $(this).attr("value") == "radio") {
|
||||
$("#encryption_section").hide();
|
||||
}
|
||||
} else{
|
||||
$("#encryption_section").show();
|
||||
$("#field_values_text").hide();
|
||||
}
|
||||
});
|
||||
}).change();
|
||||
});
|
||||
|
||||
|
||||
$("#field_encrypted").change(function() {
|
||||
if (this.checked) {
|
||||
$("#encrypt_warning").show();
|
||||
$("#show_in_email").hide();
|
||||
$("#display_in_user_view").hide();
|
||||
$("#is_unique").hide();
|
||||
$("#show_in_requestable_list").hide();
|
||||
} else {
|
||||
$("#encrypt_warning").hide();
|
||||
$("#show_in_email").show();
|
||||
$("#display_in_user_view").show();
|
||||
$("#is_unique").show();
|
||||
$("#show_in_requestable_list").show();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
@stop
|
@ -0,0 +1,17 @@
|
||||
@extends('layouts/edit-form', [
|
||||
'createText' => trans('admin/custom_fields/general.create_fieldset') ,
|
||||
'updateText' => trans('admin/custom_fields/general.update_fieldset'),
|
||||
'helpText' => trans('admin/custom_fields/general.about_fieldsets_text'),
|
||||
'helpPosition' => 'right',
|
||||
'formAction' => (isset($item->id)) ? route('fieldsets.update', ['fieldset' => $item->id]) : route('fieldsets.store'),
|
||||
])
|
||||
|
||||
@section('content')
|
||||
@parent
|
||||
@stop
|
||||
|
||||
@section('inputFields')
|
||||
@include ('partials.forms.edit.name', ['translated_name' => trans('general.name')])
|
||||
@stop
|
||||
|
||||
|
177
SNIPE-IT/resources/views/custom_fields/fieldsets/view.blade.php
Normal file
177
SNIPE-IT/resources/views/custom_fields/fieldsets/view.blade.php
Normal file
@ -0,0 +1,177 @@
|
||||
@extends('layouts/default')
|
||||
|
||||
{{-- Page title --}}
|
||||
@section('title')
|
||||
{{ trans('admin/custom_fields/general.custom_fields') }}
|
||||
@parent
|
||||
@stop
|
||||
|
||||
@section('header_right')
|
||||
<a href="{{ route('fields.index') }}" class="btn btn-primary pull-right">
|
||||
{{ trans('general.back') }}</a>
|
||||
@stop
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box box-default">
|
||||
<div class="box-header with-border">
|
||||
<h2 class="box-title">{{ $custom_fieldset->name }} {{ trans('admin/custom_fields/general.fieldset') }}</h2>
|
||||
<div class="box-tools pull-right">
|
||||
</div>
|
||||
</div><!-- /.box-header -->
|
||||
<div class="box-body">
|
||||
<table
|
||||
name="fieldsets" id="sort" class="table table-responsive todo-list">
|
||||
<thead>
|
||||
<tr>
|
||||
{{-- Hide the sorting handle if we can't update the fieldset --}}
|
||||
@can('update', $custom_fieldset)
|
||||
<th class="col-md-1"><span class="sr-only">{{ trans('admin/custom_fields/general.reorder') }}</span></th>
|
||||
@endcan
|
||||
<th class="col-md-1" style="display: none;">{{ trans('admin/custom_fields/general.order') }}</th>
|
||||
<th class="col-md-3">{{ trans('admin/custom_fields/general.field_name') }}</th>
|
||||
<th class="col-md-2">{{ trans('admin/custom_fields/general.field_format') }}</th>
|
||||
<th class="col-md-2">{{ trans('admin/custom_fields/general.field_element') }}</th>
|
||||
<th class="col-md-1">{{ trans('admin/custom_fields/general.encrypted') }}</th>
|
||||
<th class="col-md-1">{{ trans('admin/custom_fields/general.required') }}</th>
|
||||
<th class="col-md-1"><span class="sr-only">{{ trans('button.remove') }}</span></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($custom_fieldset->fields as $field)
|
||||
<tr class="{{ Auth::user()->can('update', $custom_fieldset)?'cansort':'' }}" data-index="{{ $field->pivot->custom_field_id }}" id="item_{{ $field->pivot->custom_field_id }}">
|
||||
{{-- Hide the sorting handle if we can't update the fieldset --}}
|
||||
@can('update', $custom_fieldset)
|
||||
<td>
|
||||
<!-- drag handle -->
|
||||
<span class="handle">
|
||||
<i class="fas fa-ellipsis-v"></i>
|
||||
<i class="fas fa-ellipsis-v"></i>
|
||||
</span>
|
||||
</td>
|
||||
@endcan
|
||||
<td class="index" style="display: none;">{{$field->pivot->order + 1}}</td> {{--this +1 needs to exist to keep the first row from reverting to 0 if you edit/delete fields in/from a fielset--}}
|
||||
<td>{{$field->name}}</td>
|
||||
<td>{{$field->format}}</td>
|
||||
<td>{{$field->element}}</td>
|
||||
<td>{{ $field->field_encrypted=='1' ? trans('general.yes') : trans('general.no') }}</td>
|
||||
<td>
|
||||
|
||||
@if ($field->pivot->required)
|
||||
<form method="post" action="{{ route('fields.optional', [$custom_fieldset->id, $field->id]) }}">
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-link"><i class="fa fa-check text-success" aria-hidden="true"></i></button>
|
||||
</form>
|
||||
|
||||
@else
|
||||
|
||||
<form method="post" action="{{ route('fields.required', [$custom_fieldset->id, $field->id]) }}">
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-link"><i class="fa fa-times text-danger" aria-hidden="true"></i></button>
|
||||
</form>
|
||||
@endif
|
||||
|
||||
</td>
|
||||
<td>
|
||||
@can('update', $custom_fieldset)
|
||||
<form method="post" action="{{ route('fields.disassociate', [$field, $custom_fieldset->id]) }}">
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-sm btn-danger"><i class="fa fa-trash icon-white" aria-hidden="true"></i></button>
|
||||
</form>
|
||||
@endcan
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
@can('update', $custom_fieldset)
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="8">
|
||||
{{ Form::open(['route' =>
|
||||
["fieldsets.associate",$custom_fieldset->id],
|
||||
'class'=>'form-inline',
|
||||
'id' => 'ordering']) }}
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label for="field_id" class="sr-only">
|
||||
{{ trans('admin/custom-field/general.add_field_to_fieldset')}}
|
||||
</label>
|
||||
{{ Form::select("field_id",$custom_fields_list,"",['aria-label'=>'field_id', 'class'=>'select2', 'style' => 'min-width:400px;']) }}
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-group" style="display: none;">
|
||||
{{ Form::text('order', $maxid, array('aria-label'=>'order', 'maxlength'=>'3', 'size'=>'3')) }}
|
||||
<label for="order">{{ trans('admin/custom_fields/general.order') }}</label>
|
||||
</div>
|
||||
|
||||
<div class="checkbox-inline">
|
||||
<label>
|
||||
{{ Form::checkbox('required', 'on', old('required')) }}
|
||||
<span style="padding-left: 10px;">{{ trans('admin/custom_fields/general.required') }}</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<span style="padding-left: 10px;">
|
||||
<button type="submit" class="btn btn-primary"> {{ trans('general.save') }}</button>
|
||||
</span>
|
||||
|
||||
{{ Form::close() }}
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
@endcan
|
||||
</table>
|
||||
</div> <!-- /.box-body-->
|
||||
</div> <!-- /.box.box-default-->
|
||||
</div> <!-- /.col-md-12-->
|
||||
</div> <!--/.row-->
|
||||
|
||||
@stop
|
||||
|
||||
@push('js')
|
||||
@can('update', $custom_fieldset)
|
||||
|
||||
<script nonce="{{ csrf_token() }}">
|
||||
var fixHelperModified = function(e, tr) {
|
||||
var $originals = tr.children();
|
||||
var $helper = tr.clone();
|
||||
$helper.children().each(function(index) {
|
||||
$(this).width($originals.eq(index).width())
|
||||
});
|
||||
return $helper;
|
||||
},
|
||||
updateIndex = function(e, ui) {
|
||||
$('td.index', ui.item.parent()).each(function (i) {
|
||||
$(this).html(i + 1);
|
||||
$.ajax({
|
||||
method: "POST",
|
||||
url: "{{ route('api.customfields.order', $custom_fieldset->id) }}",
|
||||
headers: {
|
||||
"X-Requested-With": 'XMLHttpRequest',
|
||||
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
data: $("#sort tbody").sortable('serialize', {
|
||||
}),
|
||||
|
||||
success: function(data) {
|
||||
//console.log('ajax fired');
|
||||
// do some stuff here
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
// this uses the jquery UI sortable method, NOT the query-dragtable library
|
||||
$("#sort tbody").sortable({
|
||||
helper: fixHelperModified,
|
||||
stop: updateIndex
|
||||
}).disableSelection();
|
||||
</script>
|
||||
@endcan
|
||||
@endpush
|
235
SNIPE-IT/resources/views/custom_fields/index.blade.php
Normal file
235
SNIPE-IT/resources/views/custom_fields/index.blade.php
Normal file
@ -0,0 +1,235 @@
|
||||
@extends('layouts/default', [
|
||||
'helpText' => trans('admin/custom_fields/general.about_fieldsets_text'),
|
||||
'helpPosition' => 'right',
|
||||
])
|
||||
|
||||
|
||||
{{-- Page title --}}
|
||||
@section('title')
|
||||
{{ trans('admin/custom_fields/general.manage') }} {{ trans('admin/custom_fields/general.custom_fields') }}
|
||||
@parent
|
||||
@stop
|
||||
|
||||
@section('content')
|
||||
|
||||
@can('view', \App\Models\CustomFieldset::class)
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box box-default">
|
||||
|
||||
<div class="box-header with-border">
|
||||
<h2 class="box-title">{{ trans('admin/custom_fields/general.fieldsets') }}</h2>
|
||||
<div class="box-tools pull-right">
|
||||
@can('create', \App\Models\CustomFieldset::class)
|
||||
<a href="{{ route('fieldsets.create') }}" class="btn btn-sm btn-primary" data-tooltip="true" title="{{ trans('admin/custom_fields/general.create_fieldset_title') }}">{{ trans('admin/custom_fields/general.create_fieldset') }}</a>
|
||||
@endcan
|
||||
</div>
|
||||
</div><!-- /.box-header -->
|
||||
|
||||
<div class="box-body">
|
||||
<table
|
||||
data-cookie-id-table="customFieldsetsTable"
|
||||
data-id-table="customFieldsetsTable"
|
||||
data-search="true"
|
||||
data-side-pagination="client"
|
||||
data-show-columns="true"
|
||||
data-show-export="true"
|
||||
data-show-refresh="true"
|
||||
data-sort-order="asc"
|
||||
data-sort-name="name"
|
||||
id="customFieldsTable"
|
||||
class="table table-striped snipe-table"
|
||||
data-export-options='{
|
||||
"fileName": "export-fieldsets-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ trans('general.name') }}</th>
|
||||
<th>{{ trans('admin/custom_fields/general.qty_fields') }}</th>
|
||||
<th>{{ trans('admin/custom_fields/general.used_by_models') }}</th>
|
||||
<th>{{ trans('table.actions') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@if(isset($custom_fieldsets))
|
||||
<tbody>
|
||||
@foreach($custom_fieldsets AS $fieldset)
|
||||
<tr>
|
||||
<td>
|
||||
{{ link_to_route("fieldsets.show",$fieldset->name,['fieldset' => $fieldset->id]) }}
|
||||
</td>
|
||||
<td>
|
||||
{{ $fieldset->fields->count() }}
|
||||
</td>
|
||||
<td>
|
||||
@foreach($fieldset->models as $model)
|
||||
<a href="{{ route('models.show', $model->id) }}" class="label label-default">{{ $model->name }}{{ ($model->model_number) ? ' ('.$model->model_number.')' : '' }}</a>
|
||||
|
||||
@endforeach
|
||||
</td>
|
||||
<td>
|
||||
|
||||
<nobr>
|
||||
|
||||
@can('update', $fieldset)
|
||||
|
||||
<a href="{{ route('fieldsets.show', ['fieldset' => $fieldset->id]) }}" data-tooltip="true" title="{{ trans('general.edit_fieldset') }}">
|
||||
<button type="submit" class="btn btn-info btn-sm">
|
||||
<i class="fa-regular fa-rectangle-list"></i>
|
||||
</button>
|
||||
</a>
|
||||
|
||||
<a href="{{ route('fieldsets.edit', $fieldset->id) }}" class="btn btn-warning btn-sm" data-tooltip="true" title="{{ trans('general.update') }}">
|
||||
<i class="fas fa-pencil-alt" aria-hidden="true"></i>
|
||||
<span class="sr-only">{{ trans('button.edit') }}</span>
|
||||
</a>
|
||||
@endcan
|
||||
|
||||
@can('delete', $fieldset)
|
||||
{{ Form::open(['route' => array('fieldsets.destroy', $fieldset->id), 'method' => 'delete','style' => 'display:inline-block']) }}
|
||||
@if($fieldset->models->count() > 0)
|
||||
<button type="submit" class="btn btn-danger btn-sm disabled" data-tooltip="true" title="{{ trans('general.cannot_be_deleted') }}" disabled><i class="fas fa-trash"></i></button>
|
||||
@else
|
||||
<button type="submit" class="btn btn-danger btn-sm" data-tooltip="true" title="{{ trans('general.delete') }}"><i class="fas fa-trash"></i></button>
|
||||
@endif
|
||||
{{ Form::close() }}
|
||||
@endcan
|
||||
</nobr>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
@endif
|
||||
</table>
|
||||
</div><!-- /.box-body -->
|
||||
</div><!-- /.box.box-default -->
|
||||
|
||||
</div> <!-- .col-md-12-->
|
||||
|
||||
|
||||
</div> <!-- .row-->
|
||||
@endcan
|
||||
@can('view', \App\Models\CustomField::class)
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box box-default">
|
||||
<div class="box-header with-border">
|
||||
<h2 class="box-title">{{ trans('admin/custom_fields/general.custom_fields') }}</h2>
|
||||
<div class="box-tools pull-right">
|
||||
@can('create', \App\Models\CustomField::class)
|
||||
<a href="{{ route('fields.create') }}" class="btn btn-sm btn-primary" data-tooltip="true" title="{{ trans('admin/custom_fields/general.create_field_title') }}">{{ trans('admin/custom_fields/general.create_field') }}</a>
|
||||
@endcan
|
||||
</div>
|
||||
|
||||
</div><!-- /.box-header -->
|
||||
<div class="box-body">
|
||||
|
||||
<div class="table-responsive">
|
||||
<table
|
||||
data-cookie-id-table="customFieldsTable"
|
||||
data-id-table="customFieldsTable"
|
||||
data-search="true"
|
||||
data-side-pagination="client"
|
||||
data-show-columns="true"
|
||||
data-show-export="true"
|
||||
data-show-refresh="true"
|
||||
data-sort-order="asc"
|
||||
data-sort-name="name"
|
||||
id="customFieldsTable"
|
||||
class="table table-striped snipe-table"
|
||||
data-export-options='{
|
||||
"fileName": "export-fields-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-sortable="true" data-searchable="true">{{ trans('general.name') }}</th>
|
||||
<th data-sortable="true" data-searchable="true">{{ trans('admin/custom_fields/general.help_text')}}</th>
|
||||
<th data-sortable="true" data-searchable="true">{{ trans('admin/custom_fields/general.unique') }}</th>
|
||||
<th data-sortable="true" data-visible="false">{{ trans('admin/custom_fields/general.db_field') }}</th>
|
||||
<th data-sortable="true" data-searchable="true">{{ trans('admin/custom_fields/general.field_format') }}</th>
|
||||
<th data-sortable="true"><i class="fa fa-lock" aria-hidden="true"></i>
|
||||
<span class="hidden-xs hidden-sm hidden-md hidden-lg">{{ trans('admin/custom_fields/general.encrypted') }}</span>
|
||||
</th>
|
||||
<th data-sortable="true" class="text-center"><i class="fa fa-list" aria-hidden="true"></i>
|
||||
<span class="hidden-xs hidden-sm hidden-md hidden-lg">{{ trans('admin/custom_fields/general.show_in_listview_short') }}</span>
|
||||
</th>
|
||||
<th data-visible="false" data-sortable="true" class="text-center"><i class="fa fa-eye" aria-hidden="true"><span class="sr-only">Visible to User</span></i></th>
|
||||
<th data-sortable="true" data-searchable="true" class="text-center"><i class="fa fa-envelope" aria-hidden="true"><span class="sr-only">{{ trans('admin/custom_fields/general.show_in_email_short') }}</span></i></th>
|
||||
<th data-sortable="true" data-searchable="true" class="text-center"><i class="fa fa-laptop fa-fw" aria-hidden="true"><span class="sr-only">{{ trans('admin/custom_fields/general.show_in_requestable_list_short') }}</span></i></th>
|
||||
<th data-sortable="true" data-searchable="true" class="text-center"><i class="fa-solid fa-fingerprint"><span class="sr-only">{{ trans('admin/custom_fields/general.unique') }}</span></i></th>
|
||||
<th data-sortable="true" data-searchable="true" class="text-center">{{ trans('admin/custom_fields/general.field_element_short') }}</th>
|
||||
<th data-searchable="true">{{ trans('admin/custom_fields/general.fieldsets') }}</th>
|
||||
<th>{{ trans('button.actions') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($custom_fields as $field)
|
||||
<tr>
|
||||
<td>{{ $field->name }}</td>
|
||||
<td>{{ $field->help_text }}</td>
|
||||
|
||||
<td class="text-center">{!! ($field->is_unique=='1') ? '<i class="fas fa-check text-success" aria-hidden="true"><span class="sr-only">'.trans('general.yes').'</span></i>' : '<i class="fas fa-times text-danger" aria-hidden="true"><span class="sr-only">'.trans('general.no').'</span></i>' !!}</td>
|
||||
<td>
|
||||
<code>{{ $field->convertUnicodeDbSlug() }}</code>
|
||||
@if ($field->convertUnicodeDbSlug()!=$field->db_column)
|
||||
<br><i class="fas fa-exclamation-triangle text-danger"></i>
|
||||
{!! trans('admin/custom_fields/general.db_convert_warning',['db_column' => $field->db_column, 'expected' => $field->convertUnicodeDbSlug()]) !!}
|
||||
@endif
|
||||
</td>
|
||||
<td>{{ $field->format }}</td>
|
||||
<td class="text-center">{!! ($field->field_encrypted=='1' ? '<i class="fa fa-check text-success"></i>' : '<i class="fa fa-times text-danger"></i>') !!}</td>
|
||||
<td class="text-center">{!! ($field->show_in_listview=='1' ? '<i class="fa fa-check text-success"></i>' : '<i class="fa fa-times text-danger"></i>') !!}</td>
|
||||
<td class="text-center">{!! ($field->display_in_user_view=='1' ? '<i class="fa fa-check text-success"></i>' : '<i class="fa fa-times text-danger"></i>') !!}</td>
|
||||
<td class="text-center">{!! ($field->show_in_email=='1') ? '<i class="fas fa-check text-success" aria-hidden="true"><span class="sr-only">'.trans('general.yes').'</span></i>' : '<i class="fas fa-times text-danger" aria-hidden="true"><span class="sr-only">'.trans('general.no').'</span></i>' !!}</td>
|
||||
<td class="text-center">{!! ($field->show_in_requestable_list=='1') ? '<i class="fas fa-check text-success" aria-hidden="true"><span class="sr-only">'.trans('general.yes').'</span></i>' : '<i class="fas fa-times text-danger" aria-hidden="true"><span class="sr-only">'.trans('general.no').'</span></i>' !!}</td>
|
||||
<td class="text-center">{!! ($field->is_unique=='1') ? '<i class="fas fa-check text-success" aria-hidden="true"><span class="sr-only">'.trans('general.yes').'</span></i>' : '<i class="fas fa-times text-danger" aria-hidden="true"><span class="sr-only">'.trans('general.no').'</span></i>' !!}</td>
|
||||
<td>{{ $field->element }}</td>
|
||||
<td>
|
||||
@foreach($field->fieldset as $fieldset)
|
||||
<a href="{{ route('fieldsets.show', $fieldset->id) }}" class="label label-default">{{ $fieldset->name }}</a>
|
||||
@endforeach
|
||||
</td>
|
||||
<td>
|
||||
<nobr>
|
||||
{{ Form::open(array('route' => array('fields.destroy', $field->id), 'method' => 'delete', 'style' => 'display:inline-block')) }}
|
||||
@can('update', $field)
|
||||
<a href="{{ route('fields.edit', $field->id) }}" class="btn btn-warning btn-sm" data-tooltip="true" title="{{ trans('general.update') }}">
|
||||
<i class="fas fa-pencil-alt" aria-hidden="true"></i>
|
||||
<span class="sr-only">{{ trans('button.edit') }}</span>
|
||||
</a>
|
||||
@endcan
|
||||
|
||||
@can('delete', $field)
|
||||
|
||||
@if($field->fieldset->count()>0)
|
||||
<button type="submit" class="btn btn-danger btn-sm disabled" data-tooltip="true" title="{{ trans('general.cannot_be_deleted') }}" disabled>
|
||||
<i class="fas fa-trash" aria-hidden="true"></i>
|
||||
<span class="sr-only">{{ trans('button.delete') }}</span></button>
|
||||
@else
|
||||
<button type="submit" class="btn btn-danger btn-sm" data-tooltip="true" title="{{ trans('general.delete') }}">
|
||||
<i class="fas fa-trash" aria-hidden="true"></i>
|
||||
<span class="sr-only">{{ trans('button.delete') }}</span>
|
||||
</button>
|
||||
@endif
|
||||
|
||||
@endcan
|
||||
{{ Form::close() }}
|
||||
</nobr>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div><!-- /.box-body -->
|
||||
</div><!-- /.box -->
|
||||
</div> <!-- /.col-md-9-->
|
||||
</div>
|
||||
@endcan
|
||||
|
||||
@stop
|
||||
@section('moar_scripts')
|
||||
@include ('partials.bootstrap-table')
|
||||
@stop
|
545
SNIPE-IT/resources/views/dashboard.blade.php
Normal file
545
SNIPE-IT/resources/views/dashboard.blade.php
Normal file
@ -0,0 +1,545 @@
|
||||
@extends('layouts/default')
|
||||
{{-- Page title --}}
|
||||
@section('title')
|
||||
{{ trans('general.dashboard') }}
|
||||
@parent
|
||||
@stop
|
||||
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
|
||||
@if ($snipeSettings->dashboard_message!='')
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box">
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
{!! Helper::parseEscapedMarkedown($snipeSettings->dashboard_message) !!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="row">
|
||||
<!-- panel -->
|
||||
<div class="col-lg-2 col-xs-6">
|
||||
<a href="{{ route('hardware.index') }}">
|
||||
<!-- small box -->
|
||||
<div class="small-box bg-teal">
|
||||
<div class="inner">
|
||||
<h3>{{ number_format(\App\Models\Asset::AssetsForShow()->count()) }}</h3>
|
||||
<p>{{ strtolower(trans('general.assets')) }}</p>
|
||||
</div>
|
||||
<div class="icon" aria-hidden="true">
|
||||
<i class="fas fa-barcode" aria-hidden="true"></i>
|
||||
</div>
|
||||
@can('index', \App\Models\Asset::class)
|
||||
<a href="{{ route('hardware.index') }}" class="small-box-footer">{{ trans('general.view_all') }} <i class="fa fa-arrow-circle-right" aria-hidden="true"></i></a>
|
||||
@endcan
|
||||
</div>
|
||||
</a>
|
||||
</div><!-- ./col -->
|
||||
|
||||
<div class="col-lg-2 col-xs-6">
|
||||
<a href="{{ route('licenses.index') }}">
|
||||
<!-- small box -->
|
||||
<div class="small-box bg-maroon">
|
||||
<div class="inner">
|
||||
<h3>{{ number_format($counts['license']) }}</h3>
|
||||
<p>{{ strtolower(trans('general.licenses')) }}</p>
|
||||
</div>
|
||||
<div class="icon" aria-hidden="true">
|
||||
<i class="far fa-save"></i>
|
||||
</div>
|
||||
@can('view', \App\Models\License::class)
|
||||
<a href="{{ route('licenses.index') }}" class="small-box-footer">{{ trans('general.view_all') }} <i class="fa fa-arrow-circle-right" aria-hidden="true"></i></a>
|
||||
@endcan
|
||||
</div>
|
||||
</a>
|
||||
</div><!-- ./col -->
|
||||
|
||||
|
||||
<div class="col-lg-2 col-xs-6">
|
||||
<!-- small box -->
|
||||
<a href="{{ route('accessories.index') }}">
|
||||
<div class="small-box bg-orange">
|
||||
<div class="inner">
|
||||
<h3> {{ number_format($counts['accessory']) }}</h3>
|
||||
<p>{{ strtolower(trans('general.accessories')) }}</p>
|
||||
</div>
|
||||
<div class="icon" aria-hidden="true">
|
||||
<i class="far fa-keyboard"></i>
|
||||
</div>
|
||||
@can('index', \App\Models\Accessory::class)
|
||||
<a href="{{ route('accessories.index') }}" class="small-box-footer">{{ trans('general.view_all') }} <i class="fa fa-arrow-circle-right" aria-hidden="true"></i></a>
|
||||
@endcan
|
||||
</div>
|
||||
</a>
|
||||
</div><!-- ./col -->
|
||||
|
||||
<div class="col-lg-2 col-xs-6">
|
||||
<!-- small box -->
|
||||
|
||||
<a href="{{ route('consumables.index') }}">
|
||||
<div class="small-box bg-purple">
|
||||
<div class="inner">
|
||||
<h3> {{ number_format($counts['consumable']) }}</h3>
|
||||
<p>{{ strtolower(trans('general.consumables')) }}</p>
|
||||
</div>
|
||||
<div class="icon" aria-hidden="true">
|
||||
<i class="fas fa-tint"></i>
|
||||
</div>
|
||||
@can('index', \App\Models\Consumable::class)
|
||||
<a href="{{ route('consumables.index') }}" class="small-box-footer">{{ trans('general.view_all') }} <i class="fa fa-arrow-circle-right" aria-hidden="true"></i></a>
|
||||
@endcan
|
||||
</div>
|
||||
</div><!-- ./col -->
|
||||
|
||||
<div class="col-lg-2 col-xs-6">
|
||||
<a href="{{ route('components.index') }}">
|
||||
<!-- small box -->
|
||||
<div class="small-box bg-yellow">
|
||||
<div class="inner">
|
||||
<h3>{{ number_format($counts['component']) }}</h3>
|
||||
<p>{{ strtolower(trans('general.components')) }}</p>
|
||||
</div>
|
||||
<div class="icon" aria-hidden="true">
|
||||
<i class="far fa-hdd"></i>
|
||||
</div>
|
||||
@can('view', \App\Models\License::class)
|
||||
<a href="{{ route('components.index') }}" class="small-box-footer">{{ trans('general.view_all') }} <i class="fa fa-arrow-circle-right" aria-hidden="true"></i></a>
|
||||
@endcan
|
||||
</div>
|
||||
</a>
|
||||
</div><!-- ./col -->
|
||||
|
||||
<div class="col-lg-2 col-xs-6">
|
||||
<a href="{{ route('users.index') }}">
|
||||
<!-- small box -->
|
||||
<div class="small-box bg-light-blue">
|
||||
<div class="inner">
|
||||
<h3>{{ number_format($counts['user']) }}</h3>
|
||||
<p>{{ strtolower(trans('general.people')) }}</p>
|
||||
</div>
|
||||
<div class="icon" aria-hidden="true">
|
||||
<i class="fas fa-users"></i>
|
||||
</div>
|
||||
@can('view', \App\Models\License::class)
|
||||
<a href="{{ route('users.index') }}" class="small-box-footer">{{ trans('general.view_all') }} <i class="fa fa-arrow-circle-right" aria-hidden="true"></i></a>
|
||||
@endcan
|
||||
</div>
|
||||
</a>
|
||||
</div><!-- ./col -->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if ($counts['grand_total'] == 0)
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box">
|
||||
<div class="box-header with-border">
|
||||
<h2 class="box-title">{{ trans('general.dashboard_info') }}</h2>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<div class="progress">
|
||||
<div class="progress-bar progress-bar-yellow" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 60%">
|
||||
<span class="sr-only">{{ trans('general.60_percent_warning') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<p><strong>{{ trans('general.dashboard_empty') }}</strong></p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
@can('create', \App\Models\Asset::class)
|
||||
<a class="btn bg-teal" style="width: 100%" href="{{ route('hardware.create') }}">{{ trans('general.new_asset') }}</a>
|
||||
@endcan
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
@can('create', \App\Models\License::class)
|
||||
<a class="btn bg-maroon" style="width: 100%" href="{{ route('licenses.create') }}">{{ trans('general.new_license') }}</a>
|
||||
@endcan
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
@can('create', \App\Models\Accessory::class)
|
||||
<a class="btn bg-orange" style="width: 100%" href="{{ route('accessories.create') }}">{{ trans('general.new_accessory') }}</a>
|
||||
@endcan
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
@can('create', \App\Models\Consumable::class)
|
||||
<a class="btn bg-purple" style="width: 100%" href="{{ route('consumables.create') }}">{{ trans('general.new_consumable') }}</a>
|
||||
@endcan
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@else
|
||||
|
||||
<!-- recent activity -->
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<div class="box">
|
||||
<div class="box-header with-border">
|
||||
<h2 class="box-title">{{ trans('general.recent_activity') }}</h2>
|
||||
<div class="box-tools pull-right">
|
||||
<button type="button" class="btn btn-box-tool" data-widget="collapse" aria-hidden="true">
|
||||
<i class="fas fa-minus" aria-hidden="true"></i>
|
||||
<span class="sr-only">{{ trans('general.collapse') }}</span>
|
||||
</button>
|
||||
</div>
|
||||
</div><!-- /.box-header -->
|
||||
<div class="box-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="table-responsive">
|
||||
|
||||
<table
|
||||
data-cookie-id-table="dashActivityReport"
|
||||
data-height="350"
|
||||
data-pagination="false"
|
||||
data-id-table="dashActivityReport"
|
||||
data-side-pagination="server"
|
||||
data-sort-order="desc"
|
||||
data-sort-name="created_at"
|
||||
id="dashActivityReport"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{ route('api.activity.index', ['limit' => 25]) }}">
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-field="icon" data-visible="true" style="width: 40px;" class="hidden-xs" data-formatter="iconFormatter"><span class="sr-only">{{ trans('admin/hardware/table.icon') }}</span></th>
|
||||
<th class="col-sm-3" data-visible="true" data-field="created_at" data-formatter="dateDisplayFormatter">{{ trans('general.date') }}</th>
|
||||
<th class="col-sm-2" data-visible="true" data-field="admin" data-formatter="usersLinkObjFormatter">{{ trans('general.admin') }}</th>
|
||||
<th class="col-sm-2" data-visible="true" data-field="action_type">{{ trans('general.action') }}</th>
|
||||
<th class="col-sm-3" data-visible="true" data-field="item" data-formatter="polymorphicItemFormatter">{{ trans('general.item') }}</th>
|
||||
<th class="col-sm-2" data-visible="true" data-field="target" data-formatter="polymorphicItemFormatter">{{ trans('general.target') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
</div><!-- /.responsive -->
|
||||
</div><!-- /.col -->
|
||||
<div class="text-center col-md-12" style="padding-top: 10px;">
|
||||
<a href="{{ route('reports.activity') }}" class="btn btn-primary btn-sm" style="width: 100%">{{ trans('general.viewall') }}</a>
|
||||
</div>
|
||||
</div><!-- /.row -->
|
||||
</div><!-- ./box-body -->
|
||||
</div><!-- /.box -->
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="box box-default">
|
||||
<div class="box-header with-border">
|
||||
<h2 class="box-title">
|
||||
{{ (\App\Models\Setting::getSettings()->dash_chart_type == 'name') ? trans('general.assets_by_status') : trans('general.assets_by_status_type') }}
|
||||
</h2>
|
||||
<div class="box-tools pull-right">
|
||||
<button type="button" class="btn btn-box-tool" data-widget="collapse" aria-hidden="true">
|
||||
<i class="fas fa-minus" aria-hidden="true"></i>
|
||||
<span class="sr-only">{{ trans('general.collapse') }}</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="chart-responsive">
|
||||
<canvas id="statusPieChart" height="260"></canvas>
|
||||
</div> <!-- ./chart-responsive -->
|
||||
</div> <!-- /.col -->
|
||||
</div> <!-- /.row -->
|
||||
</div><!-- /.box-body -->
|
||||
</div> <!-- /.box -->
|
||||
</div>
|
||||
|
||||
</div> <!--/row-->
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
|
||||
@if ($snipeSettings->full_multiple_companies_support=='1')
|
||||
<!-- Companies -->
|
||||
<div class="box box-default">
|
||||
<div class="box-header with-border">
|
||||
<h2 class="box-title">{{ trans('general.companies') }}</h2>
|
||||
<div class="box-tools pull-right">
|
||||
<button type="button" class="btn btn-box-tool" data-widget="collapse">
|
||||
<i class="fas fa-minus" aria-hidden="true"></i>
|
||||
<span class="sr-only">{{ trans('general.collapse') }}</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="table-responsive">
|
||||
<table
|
||||
data-cookie-id-table="dashCompanySummary"
|
||||
data-height="400"
|
||||
data-pagination="true"
|
||||
data-side-pagination="server"
|
||||
data-sort-order="desc"
|
||||
data-sort-field="assets_count"
|
||||
id="dashCompanySummary"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{ route('api.companies.index', ['sort' => 'assets_count', 'order' => 'asc']) }}">
|
||||
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="col-sm-3" data-visible="true" data-field="name" data-formatter="companiesLinkFormatter" data-sortable="true">{{ trans('general.name') }}</th>
|
||||
<th class="col-sm-1" data-visible="true" data-field="users_count" data-sortable="true">
|
||||
<i class="fas fa-users" aria-hidden="true"></i>
|
||||
<span class="sr-only">{{ trans('general.people') }}</span>
|
||||
</th>
|
||||
<th class="col-sm-1" data-visible="true" data-field="assets_count" data-sortable="true">
|
||||
<i class="fas fa-barcode" aria-hidden="true"></i>
|
||||
<span class="sr-only">{{ trans('general.asset_count') }}</span>
|
||||
</th>
|
||||
<th class="col-sm-1" data-visible="true" data-field="accessories_count" data-sortable="true">
|
||||
<i class="far fa-keyboard" aria-hidden="true"></i>
|
||||
<span class="sr-only">{{ trans('general.accessories_count') }}</span>
|
||||
</th>
|
||||
<th class="col-sm-1" data-visible="true" data-field="consumables_count" data-sortable="true">
|
||||
<i class="fas fa-tint" aria-hidden="true"></i>
|
||||
<span class="sr-only">{{ trans('general.consumables_count') }}</span>
|
||||
</th>
|
||||
<th class="col-sm-1" data-visible="true" data-field="components_count" data-sortable="true">
|
||||
<i class="far fa-hdd" aria-hidden="true"></i>
|
||||
<span class="sr-only">{{ trans('general.components_count') }}</span>
|
||||
</th>
|
||||
<th class="col-sm-1" data-visible="true" data-field="licenses_count" data-sortable="true">
|
||||
<i class="far fa-save" aria-hidden="true"></i>
|
||||
<span class="sr-only">{{ trans('general.licenses_count') }}</span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div> <!-- /.col -->
|
||||
<div class="text-center col-md-12" style="padding-top: 10px;">
|
||||
<a href="{{ route('companies.index') }}" class="btn btn-primary btn-sm" style="width: 100%">{{ trans('general.viewall') }}</a>
|
||||
</div>
|
||||
</div> <!-- /.row -->
|
||||
|
||||
</div><!-- /.box-body -->
|
||||
</div> <!-- /.box -->
|
||||
|
||||
@else
|
||||
<!-- Locations -->
|
||||
<div class="box box-default">
|
||||
<div class="box-header with-border">
|
||||
<h2 class="box-title">{{ trans('general.locations') }}</h2>
|
||||
<div class="box-tools pull-right">
|
||||
<button type="button" class="btn btn-box-tool" data-widget="collapse">
|
||||
<i class="fas fa-minus" aria-hidden="true"></i>
|
||||
<span class="sr-only">{{ trans('general.collapse') }}</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="table-responsive">
|
||||
<table
|
||||
data-cookie-id-table="dashLocationSummary"
|
||||
data-height="400"
|
||||
data-pagination="true"
|
||||
data-side-pagination="server"
|
||||
data-sort-order="desc"
|
||||
data-sort-field="assets_count"
|
||||
id="dashLocationSummary"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{ route('api.locations.index', ['sort' => 'assets_count', 'order' => 'asc']) }}">
|
||||
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="col-sm-3" data-visible="true" data-field="name" data-formatter="locationsLinkFormatter" data-sortable="true">{{ trans('general.name') }}</th>
|
||||
|
||||
<th class="col-sm-1" data-visible="true" data-field="assets_count" data-sortable="true">
|
||||
<i class="fas fa-barcode" aria-hidden="true"></i>
|
||||
<span class="sr-only">{{ trans('general.asset_count') }}</span>
|
||||
</th>
|
||||
<th class="col-sm-1" data-visible="true" data-field="assigned_assets_count" data-sortable="true">
|
||||
|
||||
{{ trans('general.assigned') }}
|
||||
</th>
|
||||
<th class="col-sm-1" data-visible="true" data-field="users_count" data-sortable="true">
|
||||
<i class="fas fa-users" aria-hidden="true"></i>
|
||||
<span class="sr-only">{{ trans('general.people') }}</span>
|
||||
|
||||
</th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div> <!-- /.col -->
|
||||
<div class="text-center col-md-12" style="padding-top: 10px;">
|
||||
<a href="{{ route('locations.index') }}" class="btn btn-primary btn-sm" style="width: 100%">{{ trans('general.viewall') }}</a>
|
||||
</div>
|
||||
</div> <!-- /.row -->
|
||||
|
||||
</div><!-- /.box-body -->
|
||||
</div> <!-- /.box -->
|
||||
|
||||
@endif
|
||||
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
|
||||
<!-- Categories -->
|
||||
<div class="box box-default">
|
||||
<div class="box-header with-border">
|
||||
<h2 class="box-title">{{ trans('general.asset') }} {{ trans('general.categories') }}</h2>
|
||||
<div class="box-tools pull-right">
|
||||
<button type="button" class="btn btn-box-tool" data-widget="collapse">
|
||||
<i class="fas fa-minus" aria-hidden="true"></i>
|
||||
<span class="sr-only">{{ trans('general.collapse') }}</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="table-responsive">
|
||||
<table
|
||||
data-cookie-id-table="dashCategorySummary"
|
||||
data-height="400"
|
||||
data-pagination="true"
|
||||
data-side-pagination="server"
|
||||
data-sort-order="desc"
|
||||
data-sort-field="assets_count"
|
||||
id="dashCategorySummary"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{ route('api.categories.index', ['sort' => 'assets_count', 'order' => 'asc']) }}">
|
||||
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="col-sm-3" data-visible="true" data-field="name" data-formatter="categoriesLinkFormatter" data-sortable="true">{{ trans('general.name') }}</th>
|
||||
<th class="col-sm-3" data-visible="true" data-field="category_type" data-sortable="true">
|
||||
{{ trans('general.type') }}
|
||||
</th>
|
||||
<th class="col-sm-1" data-visible="true" data-field="assets_count" data-sortable="true">
|
||||
<i class="fas fa-barcode" aria-hidden="true"></i>
|
||||
<span class="sr-only">{{ trans('general.asset_count') }}</span>
|
||||
</th>
|
||||
<th class="col-sm-1" data-visible="true" data-field="accessories_count" data-sortable="true">
|
||||
<i class="far fa-keyboard" aria-hidden="true"></i>
|
||||
<span class="sr-only">{{ trans('general.accessories_count') }}</span>
|
||||
</th>
|
||||
<th class="col-sm-1" data-visible="true" data-field="consumables_count" data-sortable="true">
|
||||
<i class="fas fa-tint" aria-hidden="true"></i>
|
||||
<span class="sr-only">{{ trans('general.consumables_count') }}</span>
|
||||
</th>
|
||||
<th class="col-sm-1" data-visible="true" data-field="components_count" data-sortable="true">
|
||||
<i class="far fa-hdd" aria-hidden="true"></i>
|
||||
<span class="sr-only">{{ trans('general.components_count') }}</span>
|
||||
</th>
|
||||
<th class="col-sm-1" data-visible="true" data-field="licenses_count" data-sortable="true">
|
||||
<i class="far fa-save" aria-hidden="true"></i>
|
||||
<span class="sr-only">{{ trans('general.licenses_count') }}</span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div> <!-- /.col -->
|
||||
<div class="text-center col-md-12" style="padding-top: 10px;">
|
||||
<a href="{{ route('categories.index') }}" class="btn btn-primary btn-sm" style="width: 100%">{{ trans('general.viewall') }}</a>
|
||||
</div>
|
||||
</div> <!-- /.row -->
|
||||
|
||||
</div><!-- /.box-body -->
|
||||
</div> <!-- /.box -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endif
|
||||
|
||||
|
||||
@stop
|
||||
|
||||
@section('moar_scripts')
|
||||
@include ('partials.bootstrap-table', ['simple_view' => true, 'nopages' => true])
|
||||
@stop
|
||||
|
||||
@push('js')
|
||||
|
||||
|
||||
|
||||
<script nonce="{{ csrf_token() }}">
|
||||
// ---------------------------
|
||||
// - ASSET STATUS CHART -
|
||||
// ---------------------------
|
||||
var pieChartCanvas = $("#statusPieChart").get(0).getContext("2d");
|
||||
var pieChart = new Chart(pieChartCanvas);
|
||||
var ctx = document.getElementById("statusPieChart");
|
||||
var pieOptions = {
|
||||
legend: {
|
||||
position: 'top',
|
||||
responsive: true,
|
||||
maintainAspectRatio: true,
|
||||
},
|
||||
tooltips: {
|
||||
callbacks: {
|
||||
label: function(tooltipItem, data) {
|
||||
counts = data.datasets[0].data;
|
||||
total = 0;
|
||||
for(var i in counts) {
|
||||
total += counts[i];
|
||||
}
|
||||
prefix = data.labels[tooltipItem.index] || '';
|
||||
return prefix+" "+Math.round(counts[tooltipItem.index]/total*100)+"%";
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: '{{ (\App\Models\Setting::getSettings()->dash_chart_type == 'name') ? route('api.statuslabels.assets.byname') : route('api.statuslabels.assets.bytype') }}',
|
||||
headers: {
|
||||
"X-Requested-With": 'XMLHttpRequest',
|
||||
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
var myPieChart = new Chart(ctx,{
|
||||
type : 'pie',
|
||||
data : data,
|
||||
options: pieOptions
|
||||
});
|
||||
},
|
||||
error: function (data) {
|
||||
// window.location.reload(true);
|
||||
},
|
||||
});
|
||||
var last = document.getElementById('statusPieChart').clientWidth;
|
||||
addEventListener('resize', function() {
|
||||
var current = document.getElementById('statusPieChart').clientWidth;
|
||||
if (current != last) location.reload();
|
||||
last = current;
|
||||
});
|
||||
</script>
|
||||
@endpush
|
31
SNIPE-IT/resources/views/departments/edit.blade.php
Normal file
31
SNIPE-IT/resources/views/departments/edit.blade.php
Normal file
@ -0,0 +1,31 @@
|
||||
@extends('layouts/edit-form', [
|
||||
'createText' => trans('admin/departments/table.create') ,
|
||||
'updateText' => trans('admin/departments/table.update'),
|
||||
'formAction' => (isset($item->id)) ? route('departments.update', ['department' => $item->id]) : route('departments.store'),
|
||||
])
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('inputFields')
|
||||
|
||||
@include ('partials.forms.edit.name', ['translated_name' => trans('admin/departments/table.name')])
|
||||
|
||||
<!-- Company -->
|
||||
@if (\App\Models\Company::canManageUsersCompanies())
|
||||
@include ('partials.forms.edit.company-select', ['translated_name' => trans('general.company'), 'fieldname' => 'company_id'])
|
||||
@else
|
||||
<input id="hidden_company_id" type="hidden" name="company_id" value="{{ Auth::user()->company_id }}">
|
||||
@endif
|
||||
|
||||
@include ('partials.forms.edit.phone')
|
||||
@include ('partials.forms.edit.fax')
|
||||
|
||||
<!-- Manager -->
|
||||
@include ('partials.forms.edit.user-select', ['translated_name' => trans('admin/users/table.manager'), 'fieldname' => 'manager_id'])
|
||||
|
||||
<!-- Location -->
|
||||
@include ('partials.forms.edit.location-select', ['translated_name' => trans('general.location'), 'fieldname' => 'location_id'])
|
||||
@include ('partials.forms.edit.image-upload', ['image_path' => app('departments_upload_path')])
|
||||
|
||||
|
||||
@stop
|
||||
|
64
SNIPE-IT/resources/views/departments/index.blade.php
Normal file
64
SNIPE-IT/resources/views/departments/index.blade.php
Normal file
@ -0,0 +1,64 @@
|
||||
@extends('layouts/default')
|
||||
|
||||
{{-- Page title --}}
|
||||
@section('title')
|
||||
{{ trans('general.departments') }}
|
||||
@parent
|
||||
@stop
|
||||
|
||||
@section('header_right')
|
||||
<a href="{{ route('departments.create') }}" class="btn btn-primary pull-right">
|
||||
{{ trans('general.create') }}</a>
|
||||
@stop
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box box-default">
|
||||
<div class="box-body">
|
||||
<div class="table-responsive">
|
||||
|
||||
<table
|
||||
data-cookie-id-table="departmentsTable"
|
||||
data-pagination="true"
|
||||
data-id-table="departmentsTable"
|
||||
data-search="true"
|
||||
data-side-pagination="server"
|
||||
data-show-columns="true"
|
||||
data-show-fullscreen="true"
|
||||
data-show-export="true"
|
||||
data-show-refresh="true"
|
||||
data-sort-order="asc"
|
||||
id="departmentsTable"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{ route('api.departments.index') }}"
|
||||
data-export-options='{
|
||||
"fileName": "export-departments-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-sortable="true" data-field="id" data-visible="false">{{ trans('general.id') }}</th>
|
||||
<th data-sortable="true" data-field="company" data-visible="false" data-formatter="companiesLinkObjFormatter">{{ trans('general.company') }}</th>
|
||||
<th data-sortable="true" data-formatter="departmentsLinkFormatter" data-field="name" data-searchable="false">{{ trans('admin/departments/table.name') }}</th>
|
||||
<th data-sortable="true" data-field="image" data-visible="false" data-formatter="imageFormatter">{{ trans('general.image') }}</th>
|
||||
<th data-sortable="true" data-formatter="usersLinkObjFormatter" data-field="manager" data-searchable="false">{{ trans('admin/departments/table.manager') }}</th>
|
||||
<th data-sortable="true" data-field="users_count" data-searchable="false">{{ trans('general.users') }}</th>
|
||||
<th data-sortable="true" data-formatter="locationsLinkObjFormatter" data-field="location" data-searchable="false">{{ trans('admin/departments/table.location') }}</th>
|
||||
<th data-sortable="false" data-formatter="departmentsActionsFormatter" data-field="actions" data-searchable="false">{{ trans('table.actions') }}</th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@stop
|
||||
|
||||
@section('moar_scripts')
|
||||
@include ('partials.bootstrap-table')
|
||||
|
||||
@stop
|
65
SNIPE-IT/resources/views/departments/view.blade.php
Normal file
65
SNIPE-IT/resources/views/departments/view.blade.php
Normal file
@ -0,0 +1,65 @@
|
||||
@extends('layouts/default')
|
||||
|
||||
{{-- Page title --}}
|
||||
@section('title')
|
||||
|
||||
{{ $department->name }}
|
||||
{{ trans('general.department') }}
|
||||
@parent
|
||||
@stop
|
||||
|
||||
@section('header_right')
|
||||
<a href="{{ route('departments.edit', ['department' => $department->id]) }}" class="btn btn-sm btn-primary pull-right">{{ trans('admin/departments/table.update') }} </a>
|
||||
@stop
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box box-default">
|
||||
<div class="box-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="table table-responsive">
|
||||
|
||||
<table
|
||||
data-columns="{{ \App\Presenters\UserPresenter::dataTableLayout() }}"
|
||||
data-cookie-id-table="departmentsUsersTable"
|
||||
data-pagination="true"
|
||||
data-id-table="departmentsUsersTable"
|
||||
data-search="true"
|
||||
data-show-footer="true"
|
||||
data-side-pagination="server"
|
||||
data-show-columns="true"
|
||||
data-show-export="true"
|
||||
data-show-refresh="true"
|
||||
data-sort-order="asc"
|
||||
id="departmentsUsersTable"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{ route('api.users.index',['department_id'=> $department->id]) }}"
|
||||
data-export-options='{
|
||||
"fileName": "export-departments-{{ str_slug($department->name) }}-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'>
|
||||
|
||||
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@stop
|
||||
|
||||
@section('moar_scripts')
|
||||
@include ('partials.bootstrap-table',
|
||||
['exportFile' => 'departments-users-export',
|
||||
'search' => true,
|
||||
'columns' => \App\Presenters\UserPresenter::dataTableLayout()
|
||||
])
|
||||
|
||||
@stop
|
36
SNIPE-IT/resources/views/depreciations/edit.blade.php
Normal file
36
SNIPE-IT/resources/views/depreciations/edit.blade.php
Normal file
@ -0,0 +1,36 @@
|
||||
@extends('layouts/edit-form', [
|
||||
'createText' => trans('admin/depreciations/general.create') ,
|
||||
'updateText' => trans('admin/depreciations/general.update'),
|
||||
'helpPosition' => 'right',
|
||||
'helpText' => trans('help.depreciations'),
|
||||
'formAction' => (isset($item->id)) ? route('depreciations.update', ['depreciation' => $item->id]) : route('depreciations.store'),
|
||||
])
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('inputFields')
|
||||
|
||||
@include ('partials.forms.edit.name', ['translated_name' => trans('admin/depreciations/general.depreciation_name')])
|
||||
<!-- Months -->
|
||||
<div class="form-group {{ $errors->has('months') ? ' has-error' : '' }}">
|
||||
<label for="months" class="col-md-3 control-label">
|
||||
{{ trans('admin/depreciations/general.number_of_months') }}
|
||||
</label>
|
||||
<div class="col-md-7 col-sm-12 {{ (Helper::checkIfRequired($item, 'months')) ? ' required' : '' }}">
|
||||
<div class="col-md-7" style="padding-left:0px">
|
||||
<input class="form-control" type="text" name="months" id="months" value="{{ Request::old('months', $item->months) }}" style="width: 80px;"{!! (\App\Helpers\Helper::checkIfRequired($item, 'months')) ? ' data-validation="required" required' : '' !!} />
|
||||
{!! $errors->first('months', '<span class="alert-msg" aria-hidden="true"><i class="fa fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Depreciation Minimum -->
|
||||
<div class="form-group {{ $errors->has('depreciation_min') ? ' has-error' : '' }}">
|
||||
<label for="depreciation_min" class="col-md-3 control-label">
|
||||
{{ trans('admin/depreciations/general.depreciation_min') }}
|
||||
</label>
|
||||
<div class="col-md-2" style="padding-left:0px">
|
||||
<input class="form-control" name="depreciation_min" id="depreciation_min" value="{{ Request::old('depreciation_min', $item->depreciation_min) }}" style="width: 80px; margin-left:15px" />
|
||||
</div>
|
||||
{!! $errors->first('depreciation_min', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
@stop
|
62
SNIPE-IT/resources/views/depreciations/index.blade.php
Normal file
62
SNIPE-IT/resources/views/depreciations/index.blade.php
Normal file
@ -0,0 +1,62 @@
|
||||
@extends('layouts/default')
|
||||
|
||||
{{-- Page title --}}
|
||||
@section('title')
|
||||
{{ trans('general.depreciations')}}
|
||||
@parent
|
||||
@stop
|
||||
|
||||
@section('header_right')
|
||||
<a href="{{ route('depreciations.create') }}" class="btn btn-primary pull-right">
|
||||
{{ trans('general.create') }}</a>
|
||||
@stop
|
||||
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-9">
|
||||
<div class="box box-default">
|
||||
<div class="box-body">
|
||||
<div class="table-responsive">
|
||||
|
||||
<table
|
||||
data-columns="{{ \App\Presenters\DepreciationPresenter::dataTableLayout() }}"
|
||||
data-cookie-id-table="depreciationsTable"
|
||||
data-pagination="true"
|
||||
data-id-table="depreciationsTable"
|
||||
data-search="true"
|
||||
data-side-pagination="server"
|
||||
data-show-columns="true"
|
||||
data-show-export="true"
|
||||
data-show-refresh="true"
|
||||
data-sort-order="asc"
|
||||
id="depreciationsTable"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{ route('api.depreciations.index') }}"
|
||||
data-export-options='{
|
||||
"fileName": "export-depreciations-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- /.col-md-9-->
|
||||
|
||||
|
||||
<!-- side address column -->
|
||||
<div class="col-md-3">
|
||||
<h2>{{ trans('admin/depreciations/general.about_asset_depreciations') }}</h4>
|
||||
<p>{{ trans('admin/depreciations/general.about_depreciations') }} </p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@stop
|
||||
|
||||
@section('moar_scripts')
|
||||
@include ('partials.bootstrap-table', ['exportFile' => 'depreciations-export', 'search' => true])
|
||||
@stop
|
171
SNIPE-IT/resources/views/depreciations/view.blade.php
Normal file
171
SNIPE-IT/resources/views/depreciations/view.blade.php
Normal file
@ -0,0 +1,171 @@
|
||||
@extends('layouts/default')
|
||||
|
||||
{{-- Page title --}}
|
||||
@section('title')
|
||||
|
||||
{{ trans('general.depreciation') }}: {{ $depreciation->name }} ({{ $depreciation->months }} {{ trans('general.months') }})
|
||||
|
||||
@parent
|
||||
@stop
|
||||
|
||||
@section('header_right')
|
||||
<div class="btn-group pull-right">
|
||||
<button class="btn btn-default dropdown-toggle" data-toggle="dropdown">{{ trans('button.actions') }}
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="{{ route('depreciations.edit', ['depreciation' => $depreciation->id]) }}">{{ trans('general.update') }}</a></li>
|
||||
<li><a href="{{ route('depreciations.create') }}">{{ trans('general.create') }}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
@stop
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
|
||||
<!-- Custom Tabs -->
|
||||
<div class="nav-tabs-custom">
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="active"><a href="#assets" data-toggle="tab">{{ trans('general.assets') }}</a></li>
|
||||
<li><a href="#licenses" data-toggle="tab">{{ trans('general.licenses') }}</a></li>
|
||||
<li><a href="#models" data-toggle="tab">{{ trans('general.asset_models') }}</a></li>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
|
||||
<div class="tab-pane active" id="assets">
|
||||
|
||||
|
||||
<table
|
||||
data-columns="{{ \App\Presenters\AssetPresenter::dataTableLayout() }}"
|
||||
data-cookie-id-table="depreciationsAssetTable"
|
||||
data-id-table="depreciationsAssetTable"
|
||||
id="depreciationsAssetTable"
|
||||
data-pagination="true"
|
||||
data-search="true"
|
||||
data-side-pagination="server"
|
||||
data-show-columns="true"
|
||||
data-show-export="true"
|
||||
data-show-refresh="true"
|
||||
data-sort-order="asc"
|
||||
data-sort-name="name"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{ route('api.assets.index',['depreciation_id'=> $depreciation->id]) }}"
|
||||
data-export-options='{
|
||||
"fileName": "export-depreciations-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'>
|
||||
</table>
|
||||
|
||||
</div> <!-- end tab-pane -->
|
||||
|
||||
<!-- tab-pane -->
|
||||
<div class="tab-pane" id="licenses">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<div class="table-responsive">
|
||||
|
||||
<table
|
||||
data-columns="{{ \App\Presenters\LicensePresenter::dataTableLayout() }}"
|
||||
data-cookie-id-table="depreciationsLicenseTable"
|
||||
data-id-table="depreciationsLicenseTable"
|
||||
id="depreciationsLicenseTable"
|
||||
data-pagination="true"
|
||||
data-search="true"
|
||||
data-side-pagination="server"
|
||||
data-show-columns="true"
|
||||
data-show-export="true"
|
||||
data-show-refresh="true"
|
||||
data-sort-order="asc"
|
||||
data-sort-name="name"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{ route('api.licenses.index',['depreciation_id'=> $depreciation->id]) }}"
|
||||
data-export-options='{
|
||||
"fileName": "export-depreciations-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div> <!--/.row-->
|
||||
</div> <!-- /.tab-pane -->
|
||||
|
||||
<!-- tab-pane -->
|
||||
<div class="tab-pane" id="models">
|
||||
|
||||
<div class="row">
|
||||
{{ Form::open(
|
||||
[
|
||||
'method' => 'POST',
|
||||
'route' => ['models.bulkedit.index'],
|
||||
'class' => 'form-inline',
|
||||
'id' => 'bulkForm']
|
||||
) }}
|
||||
<div class="col-md-12">
|
||||
<div id="toolbar">
|
||||
<label for="bulk_actions" class="sr-only">{{ trans('general.bulk_actions') }}</label>
|
||||
<select name="bulk_actions" class="form-control select2" aria-label="bulk_actions" style="width: 300px;">
|
||||
<option value="edit">{{ trans('general.bulk_edit') }}</option>
|
||||
<option value="delete">{{ trans('general.bulk_delete') }}</option>
|
||||
</select>
|
||||
<button class="btn btn-primary" id="bulkEdit" disabled>{{ trans('button.go') }}</button>
|
||||
</div>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table
|
||||
data-columns="{{ \App\Presenters\AssetModelPresenter::dataTableLayout() }}"
|
||||
data-cookie-id-table="depreciationsModelsTable"
|
||||
data-id-table="depreciationsModelsTable"
|
||||
id="depreciationsModelsTable"
|
||||
data-pagination="true"
|
||||
data-search="true"
|
||||
data-toolbar="#toolbar"
|
||||
data-side-pagination="server"
|
||||
data-show-columns="true"
|
||||
data-show-export="true"
|
||||
data-show-refresh="true"
|
||||
data-sort-order="asc"
|
||||
data-sort-name="name"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{ route('api.models.index',['depreciation_id'=> $depreciation->id]) }}"
|
||||
data-export-options='{
|
||||
"fileName": "export-depreciations-bymodel-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'>
|
||||
</table>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
{{ Form::close() }}
|
||||
|
||||
</div> <!--/.row-->
|
||||
</div> <!-- /.tab-pane -->
|
||||
|
||||
</div> <!-- /.tab-content -->
|
||||
|
||||
|
||||
|
||||
</div> <!-- /.tab-content -->
|
||||
</div> <!-- nav-tabs-custom -->
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@stop
|
||||
|
||||
@section('moar_scripts')
|
||||
@include ('partials.bootstrap-table')
|
||||
|
||||
@stop
|
28
SNIPE-IT/resources/views/errors/403.blade.php
Normal file
28
SNIPE-IT/resources/views/errors/403.blade.php
Normal file
@ -0,0 +1,28 @@
|
||||
@extends('layouts/basic')
|
||||
|
||||
{{-- Page title --}}
|
||||
@section('title')
|
||||
403
|
||||
@parent
|
||||
@stop
|
||||
|
||||
{{-- Page content --}}
|
||||
|
||||
@section('content')
|
||||
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-8 col-md-offset-2">
|
||||
|
||||
<div style="padding-top: 200px">
|
||||
<img src="{{ config('app.url') }}/img/sad-panda.png" style="width: 200px; height: 200px;" class="pull-left">
|
||||
<div class="error-content">
|
||||
<h2><i class="fas fa-exclamation-triangle text-yellow"></i> 403 Forbidden.</h2>
|
||||
<p>
|
||||
Sad panda. You are not authorized to do the thing. Maybe <a href="{{ config('app.url') }}">return to the dashboard</a>, or contact your administrator.
|
||||
</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
29
SNIPE-IT/resources/views/errors/404.blade.php
Normal file
29
SNIPE-IT/resources/views/errors/404.blade.php
Normal file
@ -0,0 +1,29 @@
|
||||
@extends('layouts/basic')
|
||||
|
||||
{{-- Page title --}}
|
||||
@section('title')
|
||||
404
|
||||
@parent
|
||||
@stop
|
||||
|
||||
{{-- Page content --}}
|
||||
|
||||
@section('content')
|
||||
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-8 col-md-offset-2">
|
||||
|
||||
<div style="padding-top: 200px">
|
||||
<img src="{{ config('app.url') }}/img/sad-panda.png" style="width: 200px; height: 200px;" class="pull-left">
|
||||
<div class="error-content">
|
||||
<h2><i class="fas fa-exclamation-triangle text-yellow"></i> 404 Page not found.</h2>
|
||||
<p>
|
||||
Sad panda. We could not find the page you were looking for.
|
||||
You should maybe <a href="{{ config('app.url') }}">return to the dashboard</a>.
|
||||
</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
44
SNIPE-IT/resources/views/errors/503.blade.php
Normal file
44
SNIPE-IT/resources/views/errors/503.blade.php
Normal file
@ -0,0 +1,44 @@
|
||||
@extends('layouts/basic')
|
||||
|
||||
{{-- Page title --}}
|
||||
@section('title')
|
||||
{{ trans('general.maintenance_mode_title') }}
|
||||
@parent
|
||||
@stop
|
||||
|
||||
{{-- Page content --}}
|
||||
|
||||
@section('content')
|
||||
|
||||
|
||||
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-9 col-md-offset-1">
|
||||
|
||||
<div class="box box-warning">
|
||||
|
||||
<div class="box-header with-border">
|
||||
<h1 class="box-title">
|
||||
<i class="fas fa-exclamation-triangle text-orange" aria-hidden="true"></i>
|
||||
{{ trans('general.maintenance_mode_title') }}
|
||||
</h1>
|
||||
</div><!-- /.box-header -->
|
||||
|
||||
<div class="box-body">
|
||||
<div class="col-md-12">
|
||||
|
||||
<div class="col-md-2">
|
||||
<img src="{{ config('app.url') }}/img/sad-panda.png" class="pull-right" style="width: 140px; height: 140px;">
|
||||
</div>
|
||||
<div class="alert alert-warning fade in">
|
||||
<h2> {{ trans('general.maintenance_mode') }}</h2>
|
||||
</div>
|
||||
|
||||
</div> <!-- /.div -->
|
||||
</div><!-- /.box-body -->
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@stop
|
184
SNIPE-IT/resources/views/groups/edit.blade.php
Normal file
184
SNIPE-IT/resources/views/groups/edit.blade.php
Normal file
@ -0,0 +1,184 @@
|
||||
@extends('layouts/edit-form', [
|
||||
'createText' => trans('admin/groups/titles.create') ,
|
||||
'updateText' => trans('admin/groups/titles.update'),
|
||||
'item' => $group,
|
||||
'formAction' => ($group !== null && $group->id !== null) ? route('groups.update', ['group' => $group->id]) : route('groups.store'),
|
||||
|
||||
])
|
||||
@section('content')
|
||||
|
||||
<style>
|
||||
.form-horizontal .control-label {
|
||||
padding-top: 0px;
|
||||
}
|
||||
|
||||
input[type='text'][disabled], input[disabled], textarea[disabled], input[readonly], textarea[readonly], .form-control[disabled], .form-control[readonly], fieldset[disabled] .form-control {
|
||||
background-color: white;
|
||||
color: #555555;
|
||||
cursor:text;
|
||||
}
|
||||
table.permissions {
|
||||
display:flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.permissions.table > thead, .permissions.table > tbody {
|
||||
margin: 15px;
|
||||
margin-top: 0px;
|
||||
}
|
||||
.permissions.table > tbody {
|
||||
border: 1px solid;
|
||||
}
|
||||
.header-row {
|
||||
border-bottom: 1px solid #ccc;
|
||||
}
|
||||
.permissions-row {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
.table > tbody > tr > td.permissions-item {
|
||||
padding: 1px;
|
||||
padding-left: 8px;
|
||||
}
|
||||
|
||||
.header-name {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
@parent
|
||||
@stop
|
||||
|
||||
@section('inputFields')
|
||||
<!-- Name -->
|
||||
<div class="form-group {{ $errors->has('name') ? ' has-error' : '' }}">
|
||||
<label for="name" class="col-md-3 control-label">{{ trans('admin/groups/titles.group_name') }}</label>
|
||||
<div class="col-md-6 required">
|
||||
<input class="form-control" type="text" name="name" id="name" value="{{ old('name', $group->name) }}" />
|
||||
{!! $errors->first('name', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
|
||||
<table class="table table-striped permissions">
|
||||
<thead>
|
||||
<tr class="permissions-row">
|
||||
<th class="col-md-5">{{ trans('admin/groups/titles.permission')}}</th>
|
||||
<th class="col-md-1">{{ trans('admin/groups/titles.grant')}}</th>
|
||||
<th class="col-md-1">{{ trans('admin/groups/titles.deny')}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@foreach ($permissions as $area => $area_permission)
|
||||
<!-- handle superadmin and reports, and anything else with only one option -->
|
||||
<?php $localPermission = $area_permission[0]; ?>
|
||||
@if (count($area_permission) == 1)
|
||||
<tbody class="permissions-group">
|
||||
<tr class="header-row permissions-row">
|
||||
<td class="col-md-5 tooltip-base permissions-item"
|
||||
data-tooltip="true"
|
||||
data-placement="right"
|
||||
title="{{ $localPermission['note'] }}">
|
||||
@unless (empty($localPermission['label']))
|
||||
<h2>{{ $area . ': ' . $localPermission['label'] }}</h2>
|
||||
@else
|
||||
<h2>{{ $area }}</h2>
|
||||
@endunless
|
||||
</td>
|
||||
<td class="col-md-1 permissions-item">
|
||||
<label for="{{ 'permission['.$localPermission['permission'].']' }}" style="form-control"><span class="sr-only">{{ trans('admin/groups/titles.allow')}} {{ 'permission['.$localPermission['permission'].']' }}</span></label>
|
||||
{{ Form::radio('permission['.$localPermission['permission'].']', '1',(array_key_exists($localPermission['permission'], $groupPermissions) ? $groupPermissions[$localPermission['permission'] ] == '1' : null),['value'=>"grant", 'aria-label'=> 'permission['.$localPermission['permission'].']']) }}
|
||||
</td>
|
||||
<td class="col-md-1 permissions-item">
|
||||
<label for="{{ 'permission['.$localPermission['permission'].']' }}"><span class="sr-only">{{ trans('admin/groups/titles.deny')}} {{ 'permission['.$localPermission['permission'].']' }}</span></label>
|
||||
{{ Form::radio('permission['.$localPermission['permission'].']', '0',(array_key_exists($localPermission['permission'], $groupPermissions) ? $groupPermissions[$localPermission['permission'] ] == '0' : null),['value'=>"grant", 'aria-label'=> 'permission['.$localPermission['permission'].']']) }}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@else
|
||||
<tbody class="permission-group">
|
||||
<tr class="header-row permissions-row">
|
||||
<td class="col-md-5 tooltip-base permissions-item header-name"
|
||||
data-tooltip="true"
|
||||
data-placement="right"
|
||||
title="{{ $localPermission['note'] }}">
|
||||
<h2>{{ $area }}</h2>
|
||||
|
||||
|
||||
</td>
|
||||
<td class="col-md-1 permissions-item" style="vertical-align: bottom">
|
||||
<label for="{{ $area }}"><span class="sr-only">{{ trans('admin/groups/titles.allow')}} {{ $area }}</span></label>
|
||||
{{ Form::radio("$area", '1',false,['value'=>"grant", 'data-checker-group' => str_slug($area), 'aria-label'=> $area]) }}
|
||||
</td>
|
||||
<td class="col-md-1 permissions-item">
|
||||
<label for="{{ $area }}"><span class="sr-only">{{ trans('admin/groups/titles.deny')}} {{ $area }}</span></label>
|
||||
{{ Form::radio("$area", '0',false,['value'=>"deny", 'data-checker-group' => str_slug($area), 'aria-label'=> $area]) }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@foreach ($area_permission as $index => $this_permission)
|
||||
@if ($this_permission['display'])
|
||||
<tr class="permissions-row">
|
||||
<td
|
||||
class="col-md-5 tooltip-base permissions-item"
|
||||
data-tooltip="true"
|
||||
data-placement="right"
|
||||
title="{{ $this_permission['note'] }}">
|
||||
{{ $this_permission['label'] }}
|
||||
</td>
|
||||
<td class="col-md-1 permissions-item">
|
||||
<label for="{{ 'permission['.$this_permission['permission'].']' }}"><span class="sr-only">{{ trans('admin/groups/titles.allow')}} {{ 'permission['.$this_permission['permission'].']' }}</span></label>
|
||||
{{ Form::radio('permission['.$this_permission['permission'].']', '1',(array_key_exists($this_permission['permission'], $groupPermissions) ? $groupPermissions[$this_permission['permission'] ] == '1' : null),['class'=>'radiochecker-'.str_slug($area), 'aria-label'=>'permission['.$this_permission['permission'].']']) }}
|
||||
</td>
|
||||
<td class="col-md-1 permissions-item">
|
||||
<label for="{{ 'permission['.$this_permission['permission'].']' }}"><span class="sr-only">{{ trans('admin/groups/titles.deny')}} {{ 'permission['.$this_permission['permission'].']' }}</span></label>
|
||||
{{ Form::radio('permission['.$this_permission['permission'].']', '0',(array_key_exists($this_permission['permission'], $groupPermissions) ? $groupPermissions[$this_permission['permission'] ] == '0' : null),['class'=>'radiochecker-'.str_slug($area), 'aria-label'=>'permission['.$this_permission['permission'].']']) }}
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
@endif
|
||||
@endforeach
|
||||
|
||||
@endif
|
||||
</tbody>
|
||||
@endforeach
|
||||
</table>
|
||||
|
||||
</div>
|
||||
@stop
|
||||
@section('moar_scripts')
|
||||
|
||||
<script nonce="{{ csrf_token() }}">
|
||||
|
||||
$(document).ready(function(){
|
||||
|
||||
$('.tooltip-base').tooltip({container: 'body'});
|
||||
$(".superuser").change(function() {
|
||||
var perms = $(this).val();
|
||||
if (perms =='1') {
|
||||
$("#nonadmin").hide();
|
||||
} else {
|
||||
$("#nonadmin").show();
|
||||
}
|
||||
});
|
||||
|
||||
// Check/Uncheck all radio buttons in the group
|
||||
$('tr.header-row input:radio').change(function() {
|
||||
value = $(this).attr('value');
|
||||
area = $(this).data('checker-group');
|
||||
$('.radiochecker-'+area+'[value='+value+']').prop('checked', true);
|
||||
});
|
||||
|
||||
|
||||
$('.header-name').click(function() {
|
||||
$(this).parent().nextUntil('tr.header-row').slideToggle(500);
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
@stop
|
62
SNIPE-IT/resources/views/groups/index.blade.php
Normal file
62
SNIPE-IT/resources/views/groups/index.blade.php
Normal file
@ -0,0 +1,62 @@
|
||||
@extends('layouts/default')
|
||||
|
||||
{{-- Web site Title --}}
|
||||
@section('title')
|
||||
{{ trans('admin/groups/titles.group_management') }}
|
||||
@parent
|
||||
@stop
|
||||
|
||||
@section('header_right')
|
||||
<a href="{{ route('groups.create') }}" class="btn btn-primary text-right"> {{ trans('general.create') }}</a>
|
||||
<a href="{{ route('settings.index') }}" class="btn btn-default text-right">{{ trans('general.back') }}</a>
|
||||
@stop
|
||||
|
||||
|
||||
{{-- Content --}}
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box box-default">
|
||||
<div class="box-body">
|
||||
<div class="table-responsive">
|
||||
|
||||
<table
|
||||
data-cookie-id-table="groupsTable"
|
||||
data-pagination="true"
|
||||
data-search="true"
|
||||
data-side-pagination="server"
|
||||
data-show-columns="true"
|
||||
data-show-export="true"
|
||||
data-show-refresh="true"
|
||||
data-show-fullscreen="true"
|
||||
data-sort-order="asc"
|
||||
data-sort-name="name"
|
||||
id="groupsTable"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{ route('api.groups.index') }}"
|
||||
data-export-options='{
|
||||
"fileName": "export-groups-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'>
|
||||
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-switchable="true" data-sortable="true" data-field="id" data-visible="false">{{ trans('general.id') }}</th>
|
||||
<th data-switchable="true" data-sortable="true" data-field="name" data-formatter="groupsAdminLinkFormatter" data-visible="true">{{ trans('admin/groups/table.name') }}</th>
|
||||
<th data-switchable="true" data-sortable="true" data-field="users_count" data-visible="true"><i class="fas fa-user" aria-hidden="true"></i><span class="sr-only">{{ trans('admin/groups/table.users') }}</span></th>
|
||||
<th data-switchable="true" data-sortable="true" data-field="created_at" data-visible="true" data-formatter="dateDisplayFormatter">{{ trans('general.created_at') }}</th>
|
||||
<th data-switchable="false" data-searchable="false" data-sortable="false" data-field="created_by" data-formatter="usersLinkFormatter">{{ trans('general.created_by') }}</th>
|
||||
<th data-switchable="false" data-searchable="false" data-sortable="false" data-field="actions" data-formatter="groupsActionsFormatter">{{ trans('table.actions') }}</th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div> <!--.box-body-->
|
||||
</div> <!-- /.box.box-default-->
|
||||
</div> <!-- .col-md-12-->
|
||||
</div>
|
||||
@stop
|
||||
@section('moar_scripts')
|
||||
@include ('partials.bootstrap-table', ['exportFile' => 'groups-export', 'search' => true])
|
||||
@stop
|
70
SNIPE-IT/resources/views/groups/view.blade.php
Normal file
70
SNIPE-IT/resources/views/groups/view.blade.php
Normal file
@ -0,0 +1,70 @@
|
||||
@extends('layouts/default')
|
||||
|
||||
{{-- Page title --}}
|
||||
@section('title')
|
||||
{{ $group->name }}
|
||||
@parent
|
||||
@stop
|
||||
|
||||
@section('header_right')
|
||||
<a href="{{ route('groups.edit', ['group' => $group->id]) }}" class="btn btn-primary text-right">{{ trans('admin/groups/titles.update') }} </a>
|
||||
<a href="{{ route('groups.index') }}" class="btn btn-default pull-right">{{ trans('general.back') }}</a>
|
||||
@stop
|
||||
|
||||
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-9">
|
||||
<div class="box box-default">
|
||||
<div class="box-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="table table-responsive">
|
||||
|
||||
<table
|
||||
data-columns="{{ \App\Presenters\UserPresenter::dataTableLayout() }}"
|
||||
data-cookie-id-table="groupsUsersTable"
|
||||
data-pagination="true"
|
||||
data-search="true"
|
||||
data-side-pagination="server"
|
||||
data-show-columns="true"
|
||||
data-show-export="true"
|
||||
data-show-refresh="true"
|
||||
id="groupsUsersTable"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{ route('api.users.index',['group_id'=> $group->id]) }}"
|
||||
data-export-options='{
|
||||
"fileName": "export-{{ str_slug($group->name) }}-group-users-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
|
||||
@if (is_array($group->decodePermissions()))
|
||||
<ul class="list-unstyled">
|
||||
@foreach ($group->decodePermissions() as $permission_name => $permission)
|
||||
<li>{!! ($permission == '1') ? '<i class="fas fa-check text-success" aria-hidden="true"></i><span class="sr-only">GRANTED: </span>' : '<i class="fas fa-times text-danger" aria-hidden="true"></i><span class="sr-only">DENIED: </span>' !!} {{ e(str_replace('.', ': ', ucwords($permission_name))) }} </li>
|
||||
@endforeach
|
||||
|
||||
</ul>
|
||||
@else
|
||||
<p>{{ trans('admin/groups/title.no_permissions') }}</p>
|
||||
@endif
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@stop
|
||||
|
||||
@section('moar_scripts')
|
||||
@include ('partials.bootstrap-table')
|
||||
@stop
|
71
SNIPE-IT/resources/views/hardware/audit-due.blade.php
Normal file
71
SNIPE-IT/resources/views/hardware/audit-due.blade.php
Normal file
@ -0,0 +1,71 @@
|
||||
@extends('layouts/default')
|
||||
|
||||
@section('title0')
|
||||
|
||||
@if ((Request::get('company_id')) && ($company))
|
||||
{{ $company->name }}
|
||||
@endif
|
||||
|
||||
{{ trans('general.audit_due') }}
|
||||
|
||||
@stop
|
||||
|
||||
{{-- Page title --}}
|
||||
@section('title')
|
||||
@yield('title0') @parent
|
||||
@stop
|
||||
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box">
|
||||
<div class="box-body">
|
||||
|
||||
@include('partials.asset-bulk-actions')
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<table
|
||||
data-click-to-select="true"
|
||||
data-columns="{{ \App\Presenters\AssetAuditPresenter::dataTableLayout() }}"
|
||||
data-cookie-id-table="assetsAuditListingTable"
|
||||
data-pagination="true"
|
||||
data-id-table="assetsAuditListingTable"
|
||||
data-search="true"
|
||||
data-side-pagination="server"
|
||||
data-show-columns="true"
|
||||
data-show-fullscreen="true"
|
||||
data-show-export="true"
|
||||
data-show-footer="true"
|
||||
data-show-refresh="true"
|
||||
data-sort-order="asc"
|
||||
data-sort-name="name"
|
||||
data-toolbar="#assetsBulkEditToolbar"
|
||||
data-bulk-button-id="#bulkAssetEditButton"
|
||||
data-bulk-form-id="#assetsBulkForm"
|
||||
id="assetsAuditListingTable"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{ route('api.asset.to-audit', ['audit' => 'due']) }}"
|
||||
data-export-options='{
|
||||
"fileName": "export-assets-due-audit-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'>
|
||||
</table>
|
||||
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
{{ Form::close() }}
|
||||
</div><!-- ./box-body -->
|
||||
</div><!-- /.box -->
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
||||
|
||||
@section('moar_scripts')
|
||||
@include('partials.bootstrap-table')
|
||||
|
||||
@stop
|
69
SNIPE-IT/resources/views/hardware/audit-overdue.blade.php
Normal file
69
SNIPE-IT/resources/views/hardware/audit-overdue.blade.php
Normal file
@ -0,0 +1,69 @@
|
||||
@extends('layouts/default')
|
||||
|
||||
@section('title0')
|
||||
|
||||
@if ((Request::get('company_id')) && ($company))
|
||||
{{ $company->name }}
|
||||
@endif
|
||||
|
||||
{{ trans('general.audit_overdue') }}
|
||||
|
||||
@stop
|
||||
|
||||
{{-- Page title --}}
|
||||
@section('title')
|
||||
@yield('title0') @parent
|
||||
@stop
|
||||
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box">
|
||||
<div class="box-body">
|
||||
@include('partials.asset-bulk-actions')
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<table
|
||||
data-click-to-select="true"
|
||||
data-columns="{{ \App\Presenters\AssetAuditPresenter::dataTableLayout() }}"
|
||||
data-cookie-id-table="assetsOverdueAuditListingTable"
|
||||
data-pagination="true"
|
||||
data-id-table="assetsOverdueAuditListingTable"
|
||||
data-search="true"
|
||||
data-side-pagination="server"
|
||||
data-show-columns="true"
|
||||
data-show-fullscreen="true"
|
||||
data-show-export="true"
|
||||
data-show-footer="true"
|
||||
data-show-refresh="true"
|
||||
data-sort-order="asc"
|
||||
data-sort-name="name"
|
||||
data-toolbar="#assetsBulkEditToolbar"
|
||||
data-bulk-button-id="#bulkAssetEditButton"
|
||||
data-bulk-form-id="#assetsBulkForm"
|
||||
id="assetsAuditListingTable"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{ route('api.asset.to-audit', ['audit' => 'overdue']) }}"
|
||||
data-export-options='{
|
||||
"fileName": "export-assets-due-audit-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'>
|
||||
</table>
|
||||
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
{{ Form::close() }}
|
||||
</div><!-- ./box-body -->
|
||||
</div><!-- /.box -->
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
||||
|
||||
@section('moar_scripts')
|
||||
@include('partials.bootstrap-table')
|
||||
|
||||
@stop
|
109
SNIPE-IT/resources/views/hardware/audit.blade.php
Normal file
109
SNIPE-IT/resources/views/hardware/audit.blade.php
Normal file
@ -0,0 +1,109 @@
|
||||
@extends('layouts/default')
|
||||
|
||||
{{-- Page title --}}
|
||||
@section('title')
|
||||
{{ trans('general.audit') }}
|
||||
@parent
|
||||
@stop
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
|
||||
<style>
|
||||
|
||||
.input-group {
|
||||
padding-left: 0px !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="row">
|
||||
<!-- left column -->
|
||||
<div class="col-md-7">
|
||||
<div class="box box-default">
|
||||
|
||||
{{ Form::open([
|
||||
'method' => 'POST',
|
||||
'route' => ['asset.audit.store', $asset->id],
|
||||
'files' => true,
|
||||
'class' => 'form-horizontal' ]) }}
|
||||
|
||||
<div class="box-header with-border">
|
||||
<h2 class="box-title"> {{ trans('admin/hardware/form.tag') }} {{ $asset->asset_tag }}</h2>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
{{csrf_field()}}
|
||||
@if ($asset->model->name)
|
||||
<!-- Asset name -->
|
||||
<div class="form-group {{ $errors->has('name') ? 'error' : '' }}">
|
||||
{{ Form::label('name', trans('admin/hardware/form.model'), array('class' => 'col-md-3 control-label')) }}
|
||||
<div class="col-md-8">
|
||||
<p class="form-control-static">{{ $asset->model->name }}</p>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Asset Name -->
|
||||
<div class="form-group {{ $errors->has('name') ? 'error' : '' }}">
|
||||
{{ Form::label('name', trans('admin/hardware/form.name'), array('class' => 'col-md-3 control-label')) }}
|
||||
<div class="col-md-8">
|
||||
<p class="form-control-static">{{ $asset->name }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Locations -->
|
||||
@include ('partials.forms.edit.location-select', ['translated_name' => trans('general.location'), 'fieldname' => 'location_id'])
|
||||
|
||||
<!-- Update location -->
|
||||
<div class="form-group">
|
||||
|
||||
<div class="col-md-8 col-md-offset-3">
|
||||
<label class="form-control">
|
||||
<input type="checkbox" value="1" name="update_location" {{ Request::old('update_location') == '1' ? ' checked="checked"' : '' }}> {{ trans('admin/hardware/form.asset_location') }}
|
||||
</label>
|
||||
<p class="help-block">{!! trans('help.audit_help') !!}</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Next Audit -->
|
||||
<div class="form-group {{ $errors->has('next_audit_date') ? 'error' : '' }}">
|
||||
{{ Form::label('name', trans('general.next_audit_date'), array('class' => 'col-md-3 control-label')) }}
|
||||
<div class="col-md-9">
|
||||
<div class="input-group date col-md-5" data-provide="datepicker" data-date-format="yyyy-mm-dd" data-date-clear-btn="true">
|
||||
<input type="text" class="form-control" placeholder="{{ trans('general.next_audit_date') }}" name="next_audit_date" id="next_audit_date" value="{{ old('next_audit_date', $next_audit_date) }}">
|
||||
<span class="input-group-addon"><i class="fas fa-calendar" aria-hidden="true"></i></span>
|
||||
</div>
|
||||
{!! $errors->first('next_audit_date', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Note -->
|
||||
<div class="form-group {{ $errors->has('note') ? 'error' : '' }}">
|
||||
{{ Form::label('note', trans('admin/hardware/form.notes'), array('class' => 'col-md-3 control-label')) }}
|
||||
<div class="col-md-8">
|
||||
<textarea class="col-md-6 form-control" id="note" name="note">{{ old('note', $asset->note) }}</textarea>
|
||||
{!! $errors->first('note', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Images -->
|
||||
@include ('partials.forms.edit.image-upload')
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div> <!--/.box-body-->
|
||||
<div class="box-footer">
|
||||
<a class="btn btn-link" href="{{ URL::previous() }}"> {{ trans('button.cancel') }}</a>
|
||||
<button type="submit" class="btn btn-success pull-right"><i class="fas fa-check icon-white" aria-hidden="true"></i> {{ trans('general.audit') }}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div> <!--/.col-md-7-->
|
||||
</div>
|
||||
@stop
|
107
SNIPE-IT/resources/views/hardware/bulk-checkout.blade.php
Normal file
107
SNIPE-IT/resources/views/hardware/bulk-checkout.blade.php
Normal file
@ -0,0 +1,107 @@
|
||||
@extends('layouts/default')
|
||||
|
||||
{{-- Page title --}}
|
||||
@section('title')
|
||||
{{ trans('admin/hardware/general.bulk_checkout') }}
|
||||
@parent
|
||||
@stop
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
|
||||
<style>
|
||||
.input-group {
|
||||
padding-left: 0px !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<!-- left column -->
|
||||
<div class="col-md-7">
|
||||
<div class="box box-default">
|
||||
<div class="box-header with-border">
|
||||
<h2 class="box-title"> {{ trans('admin/hardware/form.tag') }} </h2>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<form class="form-horizontal" method="post" action="" autocomplete="off">
|
||||
{{ csrf_field() }}
|
||||
|
||||
<!-- Checkout selector -->
|
||||
@include ('partials.forms.checkout-selector', ['user_select' => 'true','asset_select' => 'true', 'location_select' => 'true'])
|
||||
|
||||
@include ('partials.forms.edit.user-select', ['translated_name' => trans('general.user'), 'fieldname' => 'assigned_user', 'required'=>'true'])
|
||||
@include ('partials.forms.edit.asset-select', ['translated_name' => trans('general.asset'), 'fieldname' => 'assigned_asset', 'unselect' => 'true', 'style' => 'display:none;', 'required'=>'true'])
|
||||
@include ('partials.forms.edit.location-select', ['translated_name' => trans('general.location'), 'fieldname' => 'assigned_location', 'style' => 'display:none;', 'required'=>'true'])
|
||||
|
||||
<!-- Checkout/Checkin Date -->
|
||||
<div class="form-group {{ $errors->has('checkout_at') ? 'error' : '' }}">
|
||||
{{ Form::label('checkout_at', trans('admin/hardware/form.checkout_date'), array('class' => 'col-md-3 control-label')) }}
|
||||
<div class="col-md-8">
|
||||
<div class="input-group date col-md-5" data-provide="datepicker" data-date-format="yyyy-mm-dd" data-date-end-date="0d" data-date-clear-btn="true">
|
||||
<input type="text" class="form-control" placeholder="{{ trans('general.select_date') }}" name="checkout_at" id="checkout_at" value="{{ old('checkout_at') }}">
|
||||
<span class="input-group-addon"><i class="fas fa-calendar" aria-hidden="true"></i></span>
|
||||
</div>
|
||||
{!! $errors->first('checkout_at', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Expected Checkin Date -->
|
||||
<div class="form-group {{ $errors->has('expected_checkin') ? 'error' : '' }}">
|
||||
{{ Form::label('expected_checkin', trans('admin/hardware/form.expected_checkin'), array('class' => 'col-md-3 control-label')) }}
|
||||
<div class="col-md-8">
|
||||
<div class="input-group date col-md-5" data-provide="datepicker" data-date-format="yyyy-mm-dd" data-date-start-date="0d" data-date-clear-btn="true">
|
||||
<input type="text" class="form-control" placeholder="{{ trans('general.select_date') }}" name="expected_checkin" id="expected_checkin" value="{{ old('expected_checkin') }}">
|
||||
<span class="input-group-addon"><i class="fas fa-calendar" aria-hidden="true"></i></span>
|
||||
</div>
|
||||
{!! $errors->first('expected_checkin', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Note -->
|
||||
<div class="form-group {{ $errors->has('note') ? 'error' : '' }}">
|
||||
{{ Form::label('note', trans('admin/hardware/form.notes'), array('class' => 'col-md-3 control-label')) }}
|
||||
<div class="col-md-8">
|
||||
<textarea class="col-md-6 form-control" id="note" name="note">{{ old('note') }}</textarea>
|
||||
{!! $errors->first('note', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@include ('partials.forms.edit.asset-select', [
|
||||
'translated_name' => trans('general.assets'),
|
||||
'fieldname' => 'selected_assets[]',
|
||||
'multiple' => true,
|
||||
'asset_status_type' => 'RTD',
|
||||
'select_id' => 'assigned_assets_select',
|
||||
])
|
||||
|
||||
|
||||
</div> <!--./box-body-->
|
||||
<div class="box-footer">
|
||||
<a class="btn btn-link" href="{{ URL::previous() }}"> {{ trans('button.cancel') }}</a>
|
||||
<button type="submit" class="btn btn-primary pull-right"><i class="fas fa-check icon-white" aria-hidden="true"></i> {{ trans('general.checkout') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div> <!--/.col-md-7-->
|
||||
|
||||
<!-- right column -->
|
||||
<div class="col-md-5" id="current_assets_box" style="display:none;">
|
||||
<div class="box box-primary">
|
||||
<div class="box-header with-border">
|
||||
<h2 class="box-title">{{ trans('admin/users/general.current_assets') }}</h2>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<div id="current_assets_content">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
||||
|
||||
@section('moar_scripts')
|
||||
@include('partials/assets-assigned')
|
||||
|
||||
@stop
|
68
SNIPE-IT/resources/views/hardware/bulk-delete.blade.php
Normal file
68
SNIPE-IT/resources/views/hardware/bulk-delete.blade.php
Normal file
@ -0,0 +1,68 @@
|
||||
@extends('layouts/default')
|
||||
|
||||
{{-- Page title --}}
|
||||
@section('title')
|
||||
{{ trans('admin/hardware/form.bulk_delete') }}
|
||||
@parent
|
||||
@stop
|
||||
|
||||
@section('header_right')
|
||||
<a href="{{ URL::previous() }}" class="btn btn-primary pull-right">
|
||||
{{ trans('general.back') }}</a>
|
||||
@stop
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<!-- left column -->
|
||||
<div class="col-md-12">
|
||||
<p>{{ trans('admin/hardware/form.bulk_delete_help') }}</p>
|
||||
<form class="form-horizontal" method="post" action="{{ route('hardware/bulkdelete') }}" autocomplete="off" role="form">
|
||||
{{csrf_field()}}
|
||||
<div class="box box-default">
|
||||
<div class="box-header with-border">
|
||||
<h2 class="box-title" style="color: red">{{ trans('admin/hardware/form.bulk_delete_warn', ['asset_count' => count($assets)]) }}</h2>
|
||||
</div>
|
||||
|
||||
<div class="box-body">
|
||||
<table class="table table-striped table-condensed">
|
||||
<thead>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>{{ trans('admin/hardware/table.id') }}</td>
|
||||
<td>{{ trans('admin/hardware/table.name') }}</td>
|
||||
<td>{{ trans('admin/hardware/table.location')}}</td>
|
||||
<td>{{ trans('admin/hardware/table.assigned_to') }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($assets as $asset)
|
||||
<tr>
|
||||
<td><input type="checkbox" name="ids[]" value="{{ $asset->id }}" checked="checked"></td>
|
||||
<td>{{ $asset->id }}</td>
|
||||
<td>{{ $asset->present()->name() }}</td>
|
||||
<td>
|
||||
@if ($asset->location)
|
||||
{{ $asset->location->name }}
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if ($asset->assignedTo)
|
||||
{{ $asset->assignedTo->present()->name()}}
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div><!-- /.box-body -->
|
||||
|
||||
<div class="box-footer text-right">
|
||||
<a class="btn btn-link" href="{{ URL::previous() }}" method="post" enctype="multipart/form-data">{{ trans('button.cancel') }}</a>
|
||||
<button type="submit" class="btn btn-success" id="submit-button"><i class="fas fa-check icon-white" aria-hidden="true"></i> {{ trans('button.delete') }}</button>
|
||||
</div><!-- /.box-footer -->
|
||||
</div><!-- /.box -->
|
||||
</form>
|
||||
</div> <!-- .col-md-12-->
|
||||
</div><!--.row-->
|
||||
@stop
|
62
SNIPE-IT/resources/views/hardware/bulk-restore.blade.php
Normal file
62
SNIPE-IT/resources/views/hardware/bulk-restore.blade.php
Normal file
@ -0,0 +1,62 @@
|
||||
@extends('layouts/default')
|
||||
|
||||
{{-- Page title --}}
|
||||
@section('title')
|
||||
{{ trans('admin/hardware/form.bulk_restore') }}
|
||||
@parent
|
||||
@stop
|
||||
|
||||
@section('header_right')
|
||||
<a href="{{ URL::previous() }}" class="btn btn-primary pull-right">
|
||||
{{ trans('general.back') }}</a>
|
||||
@stop
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<!-- left column -->
|
||||
<div class="col-md-12">
|
||||
<p>{{ trans('admin/hardware/form.bulk_restore_help') }}</p>
|
||||
<form class="form-horizontal" method="post" action="{{ route('hardware/bulkrestore') }}" autocomplete="off" role="form">
|
||||
{{csrf_field()}}
|
||||
<div class="box box-default">
|
||||
<div class="box-header with-border">
|
||||
<h2 class="box-title" style="color: red">{{ trans('admin/hardware/form.bulk_restore_warn', ['asset_count' => count($assets)]) }}</h2>
|
||||
</div>
|
||||
|
||||
<div class="box-body">
|
||||
<table class="table table-striped table-condensed">
|
||||
<thead>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>{{ trans('admin/hardware/table.id') }}</td>
|
||||
<td>{{ trans('admin/hardware/form.name') }}</td>
|
||||
<td>{{ trans('admin/hardware/table.location')}}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($assets as $asset)
|
||||
<tr>
|
||||
<td><input type="checkbox" name="ids[]" value="{{ $asset->id }}" checked="checked"></td>
|
||||
<td>{{ $asset->id }}</td>
|
||||
<td>{{ $asset->present()->name() }}</td>
|
||||
<td>
|
||||
@if ($asset->location)
|
||||
{{ $asset->location->name }}
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div><!-- /.box-body -->
|
||||
|
||||
<div class="box-footer text-right">
|
||||
<a class="btn btn-link" href="{{ URL::previous() }}" method="post" enctype="multipart/form-data">{{ trans('button.cancel') }}</a>
|
||||
<button type="submit" class="btn btn-success" id="submit-button"><i class="fas fa-check icon-white" aria-hidden="true"></i> {{ trans('button.restore') }}</button>
|
||||
</div><!-- /.box-footer -->
|
||||
</div><!-- /.box -->
|
||||
</form>
|
||||
</div> <!-- .col-md-12-->
|
||||
</div><!--.row-->
|
||||
@stop
|
211
SNIPE-IT/resources/views/hardware/bulk.blade.php
Normal file
211
SNIPE-IT/resources/views/hardware/bulk.blade.php
Normal file
@ -0,0 +1,211 @@
|
||||
@extends('layouts/default')
|
||||
|
||||
{{-- Page title --}}
|
||||
@section('title')
|
||||
{{ trans('admin/hardware/form.update') }}
|
||||
@parent
|
||||
@stop
|
||||
|
||||
|
||||
@section('header_right')
|
||||
<a href="{{ URL::previous() }}" class="btn btn-sm btn-primary pull-right">
|
||||
{{ trans('general.back') }}</a>
|
||||
@stop
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col-md-8 col-md-offset-2">
|
||||
|
||||
<p>{{ trans('admin/hardware/form.bulk_update_help') }}</p>
|
||||
|
||||
|
||||
|
||||
<form class="form-horizontal" method="post" action="{{ route('hardware/bulksave') }}" autocomplete="off" role="form">
|
||||
{{ csrf_field() }}
|
||||
|
||||
<div class="box box-default">
|
||||
<div class="box-body">
|
||||
|
||||
<div class="callout callout-warning">
|
||||
<i class="fas fa-exclamation-triangle"></i> {{ trans_choice('admin/hardware/form.bulk_update_warn', count($assets), ['asset_count' => count($assets)]) }}
|
||||
|
||||
@if (count($models) > 0)
|
||||
{{ trans_choice('admin/hardware/form.bulk_update_with_custom_field', count($models), ['asset_model_count' => count($models)]) }}
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<!-- Purchase Date -->
|
||||
<div class="form-group {{ $errors->has('purchase_date') ? ' has-error' : '' }}">
|
||||
<label for="purchase_date" class="col-md-3 control-label">{{ trans('admin/hardware/form.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.select_date') }}" name="purchase_date" id="purchase_date" value="{{ old('purchase_date') }}">
|
||||
<span class="input-group-addon"><i class="fas fa-calendar" aria-hidden="true"></i></span>
|
||||
</div>
|
||||
{!! $errors->first('purchase_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_purchase_date', '1', false) }}
|
||||
{{ trans_choice('general.set_to_null', count($assets),['asset_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>
|
||||
<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.select_date') }}" name="expected_checkin" id="expected_checkin" value="{{ old('expected_checkin') }}">
|
||||
<span class="input-group-addon"><i class="fas fa-calendar" aria-hidden="true"></i></span>
|
||||
</div>
|
||||
|
||||
{!! $errors->first('expected_checkin', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
<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)]) }}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Status -->
|
||||
<div class="form-group {{ $errors->has('status_id') ? ' has-error' : '' }}">
|
||||
<label for="status_id" class="col-md-3 control-label">
|
||||
{{ trans('admin/hardware/form.status') }}
|
||||
</label>
|
||||
<div class="col-md-7">
|
||||
{{ Form::select('status_id', $statuslabel_list , old('status_id'), array('class'=>'select2', 'style'=>'width:100%', 'aria-label'=>'status_id')) }}
|
||||
<p class="help-block">{{ trans('general.status_compatibility') }}</p>
|
||||
{!! $errors->first('status_id', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@include ('partials.forms.edit.model-select', ['translated_name' => trans('admin/hardware/form.model'), 'fieldname' => 'model_id'])
|
||||
|
||||
<!-- Default Location -->
|
||||
@include ('partials.forms.edit.location-select', ['translated_name' => trans('admin/hardware/form.default_location'), 'fieldname' => 'rtd_location_id'])
|
||||
|
||||
<!-- Update actual location -->
|
||||
<div class="form-group">
|
||||
<div class="col-md-9 col-md-offset-3">
|
||||
<label class="form-control">
|
||||
{{ Form::radio('update_real_loc', '1', old('update_real_loc'), ['checked'=> 'checked', 'aria-label'=>'update_real_loc']) }}
|
||||
{{ trans('admin/hardware/form.asset_location_update_default_current') }}
|
||||
</label>
|
||||
<label class="form-control">
|
||||
{{ Form::radio('update_real_loc', '0', old('update_real_loc'), ['aria-label'=>'update_default_loc']) }}
|
||||
{{ trans('admin/hardware/form.asset_location_update_default') }}
|
||||
</label>
|
||||
<label class="form-control">
|
||||
{{ Form::radio('update_real_loc', '2', old('update_real_loc'), ['aria-label'=>'update_default_loc']) }}
|
||||
{{ trans('admin/hardware/form.asset_location_update_actual') }}
|
||||
</label>
|
||||
|
||||
</div>
|
||||
</div> <!--/form-group-->
|
||||
|
||||
|
||||
|
||||
<!-- Purchase Cost -->
|
||||
<div class="form-group {{ $errors->has('purchase_cost') ? ' has-error' : '' }}">
|
||||
<label for="purchase_cost" class="col-md-3 control-label">
|
||||
{{ trans('admin/hardware/form.cost') }}
|
||||
</label>
|
||||
<div class="input-group col-md-3">
|
||||
<span class="input-group-addon">{{ $snipeSettings->default_currency }}</span>
|
||||
<input type="text" class="form-control" maxlength="10" placeholder="{{ trans('admin/hardware/form.cost') }}" name="purchase_cost" id="purchase_cost" value="{{ old('purchase_cost') }}">
|
||||
{!! $errors->first('purchase_cost', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Supplier -->
|
||||
@include ('partials.forms.edit.supplier-select', ['translated_name' => trans('general.supplier'), 'fieldname' => 'supplier_id'])
|
||||
<!-- Company -->
|
||||
@include ('partials.forms.edit.company-select', ['translated_name' => trans('general.company'), 'fieldname' => 'company_id'])
|
||||
|
||||
<!-- Order Number -->
|
||||
<div class="form-group {{ $errors->has('order_number') ? ' has-error' : '' }}">
|
||||
<label for="order_number" class="col-md-3 control-label">
|
||||
{{ trans('admin/hardware/form.order') }}
|
||||
</label>
|
||||
<div class="col-md-7">
|
||||
<input class="form-control" type="text" maxlength="200" name="order_number" id="order_number" value="{{ old('order_number') }}" />
|
||||
{!! $errors->first('order_number', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Warranty -->
|
||||
<div class="form-group {{ $errors->has('warranty_months') ? ' has-error' : '' }}">
|
||||
<label for="warranty_months" class="col-md-3 control-label">
|
||||
{{ trans('admin/hardware/form.warranty') }}
|
||||
</label>
|
||||
<div class="col-md-3">
|
||||
<div class="input-group">
|
||||
<input class="col-md-3 form-control" maxlength="4" type="text" name="warranty_months" id="warranty_months" value="{{ old('warranty_months') }}" />
|
||||
<span class="input-group-addon">{{ trans('admin/hardware/form.months') }}</span>
|
||||
{!! $errors->first('warranty_months', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Next audit Date -->
|
||||
<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-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.select_date') }}" name="next_audit_date" id="next_audit_date" value="{{ old('next_audit_date') }}">
|
||||
<span class="input-group-addon"><i class="fas fa-calendar" aria-hidden="true"></i></span>
|
||||
</div>
|
||||
|
||||
{!! $errors->first('next_audit_date', '<span class="alert-msg" aria-hidden="true">
|
||||
<i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
<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)]) }}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Requestable -->
|
||||
<div class="form-group {{ $errors->has('requestable') ? ' has-error' : '' }}">
|
||||
<div class="control-label col-md-3">
|
||||
<strong>{{ trans('admin/hardware/form.requestable') }}</strong>
|
||||
</div>
|
||||
<div class="col-md-7">
|
||||
<label class="form-control">
|
||||
<input type="radio" name="requestable" value="1">
|
||||
{{ trans('general.yes')}}
|
||||
</label>
|
||||
<label class="form-control">
|
||||
<input type="radio" name="requestable" value="0">
|
||||
{{ trans('general.no')}}
|
||||
</label>
|
||||
<label class="form-control">
|
||||
<input type="radio" name="requestable" value="" checked>
|
||||
{{ trans('general.do_not_change')}}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@include("models/custom_fields_form_bulk_edit",["models" => $models])
|
||||
|
||||
@foreach ($assets as $key => $value)
|
||||
<input type="hidden" name="ids[{{ $value }}]" value="1">
|
||||
@endforeach
|
||||
</div> <!--/.box-body-->
|
||||
|
||||
<div class="text-right box-footer">
|
||||
<button type="submit" class="btn btn-success"><i class="fas fa-check icon-white" aria-hidden="true"></i> {{ trans('general.save') }}</button>
|
||||
</div>
|
||||
</div> <!--/.box.box-default-->
|
||||
</form>
|
||||
</div> <!--/.col-md-8-->
|
||||
</div>
|
||||
@stop
|
116
SNIPE-IT/resources/views/hardware/checkin.blade.php
Normal file
116
SNIPE-IT/resources/views/hardware/checkin.blade.php
Normal file
@ -0,0 +1,116 @@
|
||||
@extends('layouts/default')
|
||||
|
||||
{{-- Page title --}}
|
||||
@section('title')
|
||||
{{ trans('admin/hardware/general.checkin') }}
|
||||
@parent
|
||||
@stop
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
<style>
|
||||
|
||||
.input-group {
|
||||
padding-left: 0px !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<!-- left column -->
|
||||
<div class="col-md-9">
|
||||
<div class="box box-default">
|
||||
<div class="box-header with-border">
|
||||
<h2 class="box-title">{{ trans('admin/hardware/form.tag') }} {{ $asset->asset_tag }}</h2>
|
||||
</div><!-- /.box-header -->
|
||||
|
||||
<div class="box-body">
|
||||
<div class="col-md-12">
|
||||
@if ($backto=='user')
|
||||
<form class="form-horizontal" method="post"
|
||||
action="{{ route('hardware.checkin.store', array('assetId'=> $asset->id, 'backto'=>'user')) }}"
|
||||
autocomplete="off">
|
||||
@else
|
||||
<form class="form-horizontal" method="post"
|
||||
action="{{ route('hardware.checkin.store', array('assetId'=> $asset->id)) }}" autocomplete="off">
|
||||
@endif
|
||||
{{csrf_field()}}
|
||||
|
||||
<!-- AssetModel name -->
|
||||
<div class="form-group">
|
||||
{{ Form::label('model', trans('admin/hardware/form.model'), array('class' => 'col-md-3 control-label')) }}
|
||||
<div class="col-md-8">
|
||||
<p class="form-control-static">
|
||||
@if (($asset->model) && ($asset->model->name))
|
||||
{{ $asset->model->name }}
|
||||
|
||||
@else
|
||||
<span class="text-danger text-bold">
|
||||
<i class="fas fa-exclamation-triangle"></i>{{ trans('admin/hardware/general.model_invalid')}}
|
||||
<a href="{{ route('hardware.edit', $asset->id) }}"></a> {{ trans('admin/hardware/general.model_invalid_fix')}}</span>
|
||||
@endif
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Asset Name -->
|
||||
<div class="form-group {{ $errors->has('name') ? 'error' : '' }}">
|
||||
{{ Form::label('name', trans('admin/hardware/form.name'), array('class' => 'col-md-3 control-label')) }}
|
||||
<div class="col-md-8">
|
||||
<input class="form-control" type="text" name="name" aria-label="name" id="name"
|
||||
value="{{ old('name', $asset->name) }}"/>
|
||||
{!! $errors->first('name', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Status -->
|
||||
<div class="form-group {{ $errors->has('status_id') ? 'error' : '' }}">
|
||||
{{ Form::label('status_id', trans('admin/hardware/form.status'), array('class' => 'col-md-3 control-label')) }}
|
||||
<div class="col-md-7 required">
|
||||
{{ Form::select('status_id', $statusLabel_list, '', array('class'=>'select2', 'style'=>'width:100%','id' =>'modal-statuslabel_types', 'aria-label'=>'status_id')) }}
|
||||
{!! $errors->first('status_id', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@include ('partials.forms.edit.location-select', ['translated_name' => trans('general.location'), 'fieldname' => 'location_id', 'help_text' => ($asset->defaultLoc) ? 'You can choose to check this asset in to a location other than the default location of '.$asset->defaultLoc->name.' if one is set.' : null, 'hide_location_radio' => true])
|
||||
|
||||
<!-- Checkout/Checkin Date -->
|
||||
<div class="form-group{{ $errors->has('checkin_at') ? ' has-error' : '' }}">
|
||||
{{ Form::label('checkin_at', trans('admin/hardware/form.checkin_date'), array('class' => 'col-md-3 control-label')) }}
|
||||
<div class="col-md-8">
|
||||
<div class="input-group col-md-5 required">
|
||||
<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.select_date') }}" name="checkin_at" id="checkin_at" value="{{ old('checkin_at', date('Y-m-d')) }}">
|
||||
<span class="input-group-addon"><i class="fas fa-calendar" aria-hidden="true"></i></span>
|
||||
</div>
|
||||
{!! $errors->first('checkin_at', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Note -->
|
||||
<div class="form-group {{ $errors->has('note') ? 'error' : '' }}">
|
||||
|
||||
{{ Form::label('note', trans('admin/hardware/form.notes'), array('class' => 'col-md-3 control-label')) }}
|
||||
|
||||
<div class="col-md-8">
|
||||
<textarea class="col-md-6 form-control" id="note"
|
||||
name="note">{{ old('note', $asset->note) }}</textarea>
|
||||
{!! $errors->first('note', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
<a class="btn btn-link" href="{{ URL::previous() }}"> {{ trans('button.cancel') }}</a>
|
||||
<button type="submit" class="btn btn-primary pull-right"><i class="fas fa-check icon-white" aria-hidden="true"></i> {{ trans('general.checkin') }}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div> <!--/.col-md-12-->
|
||||
</div> <!--/.box-body-->
|
||||
|
||||
</div> <!--/.box.box-default-->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@stop
|
180
SNIPE-IT/resources/views/hardware/checkout.blade.php
Normal file
180
SNIPE-IT/resources/views/hardware/checkout.blade.php
Normal file
@ -0,0 +1,180 @@
|
||||
@extends('layouts/default')
|
||||
|
||||
{{-- Page title --}}
|
||||
@section('title')
|
||||
{{ trans('admin/hardware/general.checkout') }}
|
||||
@parent
|
||||
@stop
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
|
||||
<style>
|
||||
|
||||
.input-group {
|
||||
padding-left: 0px !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="row">
|
||||
<!-- left column -->
|
||||
<div class="col-md-7">
|
||||
<div class="box box-default">
|
||||
<form class="form-horizontal" method="post" action="" autocomplete="off">
|
||||
<div class="box-header with-border">
|
||||
<h2 class="box-title"> {{ trans('admin/hardware/form.tag') }} {{ $asset->asset_tag }}</h2>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
{{csrf_field()}}
|
||||
@if ($asset->company && $asset->company->name)
|
||||
<div class="form-group">
|
||||
{{ Form::label('model', trans('general.company'), array('class' => 'col-md-3 control-label')) }}
|
||||
<div class="col-md-8">
|
||||
<p class="form-control-static">
|
||||
{{ $asset->company->name }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
<!-- AssetModel name -->
|
||||
<div class="form-group">
|
||||
{{ Form::label('model', trans('admin/hardware/form.model'), array('class' => 'col-md-3 control-label')) }}
|
||||
<div class="col-md-8">
|
||||
<p class="form-control-static">
|
||||
@if (($asset->model) && ($asset->model->name))
|
||||
{{ $asset->model->name }}
|
||||
@else
|
||||
<span class="text-danger text-bold">
|
||||
<i class="fas fa-exclamation-triangle"></i>{{ trans('admin/hardware/general.model_invalid')}}
|
||||
<a href="{{ route('hardware.edit', $asset->id) }}"></a> {{ trans('admin/hardware/general.model_invalid_fix')}}</span>
|
||||
@endif
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Asset Name -->
|
||||
<div class="form-group {{ $errors->has('name') ? 'error' : '' }}">
|
||||
{{ Form::label('name', trans('admin/hardware/form.name'), array('class' => 'col-md-3 control-label')) }}
|
||||
<div class="col-md-8">
|
||||
<input class="form-control" type="text" name="name" id="name" value="{{ old('name', $asset->name) }}" tabindex="1">
|
||||
{!! $errors->first('name', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Status -->
|
||||
<div class="form-group {{ $errors->has('status_id') ? 'error' : '' }}">
|
||||
{{ Form::label('status_id', trans('admin/hardware/form.status'), array('class' => 'col-md-3 control-label')) }}
|
||||
<div class="col-md-7 required">
|
||||
{{ Form::select('status_id', $statusLabel_list, $asset->status_id, array('class'=>'select2', 'style'=>'width:100%','', 'aria-label'=>'status_id')) }}
|
||||
{!! $errors->first('status_id', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@include ('partials.forms.checkout-selector', ['user_select' => 'true','asset_select' => 'true', 'location_select' => 'true'])
|
||||
|
||||
@include ('partials.forms.edit.user-select', ['translated_name' => trans('general.user'), 'fieldname' => 'assigned_user', 'required'=>'true'])
|
||||
|
||||
<!-- We have to pass unselect here so that we don't default to the asset that's being checked out. We want that asset to be pre-selected everywhere else. -->
|
||||
@include ('partials.forms.edit.asset-select', ['translated_name' => trans('general.asset'), 'fieldname' => 'assigned_asset', 'unselect' => 'true', 'style' => 'display:none;', 'required'=>'true'])
|
||||
|
||||
@include ('partials.forms.edit.location-select', ['translated_name' => trans('general.location'), 'fieldname' => 'assigned_location', 'style' => 'display:none;', 'required'=>'true'])
|
||||
|
||||
|
||||
|
||||
<!-- Checkout/Checkin Date -->
|
||||
<div class="form-group {{ $errors->has('checkout_at') ? 'error' : '' }}">
|
||||
{{ Form::label('checkout_at', trans('admin/hardware/form.checkout_date'), array('class' => 'col-md-3 control-label')) }}
|
||||
<div class="col-md-8">
|
||||
<div class="input-group date col-md-7" data-provide="datepicker" data-date-format="yyyy-mm-dd" data-date-end-date="0d" data-date-clear-btn="true">
|
||||
<input type="text" class="form-control" placeholder="{{ trans('general.select_date') }}" name="checkout_at" id="checkout_at" value="{{ old('checkout_at', date('Y-m-d')) }}">
|
||||
<span class="input-group-addon"><i class="fas fa-calendar" aria-hidden="true"></i></span>
|
||||
</div>
|
||||
{!! $errors->first('checkout_at', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Expected Checkin Date -->
|
||||
<div class="form-group {{ $errors->has('expected_checkin') ? 'error' : '' }}">
|
||||
{{ Form::label('expected_checkin', trans('admin/hardware/form.expected_checkin'), array('class' => 'col-md-3 control-label')) }}
|
||||
<div class="col-md-8">
|
||||
<div class="input-group date col-md-7" data-provide="datepicker" data-date-format="yyyy-mm-dd" data-date-start-date="0d" data-date-clear-btn="true">
|
||||
<input type="text" class="form-control" placeholder="{{ trans('general.select_date') }}" name="expected_checkin" id="expected_checkin" value="{{ old('expected_checkin') }}">
|
||||
<span class="input-group-addon"><i class="fas fa-calendar" aria-hidden="true"></i></span>
|
||||
</div>
|
||||
{!! $errors->first('expected_checkin', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Note -->
|
||||
<div class="form-group {{ $errors->has('note') ? 'error' : '' }}">
|
||||
{{ Form::label('note', trans('admin/hardware/form.notes'), array('class' => 'col-md-3 control-label')) }}
|
||||
<div class="col-md-8">
|
||||
<textarea class="col-md-6 form-control" id="note" name="note">{{ old('note', $asset->note) }}</textarea>
|
||||
{!! $errors->first('note', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if ($asset->requireAcceptance() || $asset->getEula() || ($snipeSettings->webhook_endpoint!=''))
|
||||
<div class="form-group notification-callout">
|
||||
<div class="col-md-8 col-md-offset-3">
|
||||
<div class="callout callout-info">
|
||||
|
||||
@if ($asset->requireAcceptance())
|
||||
<i class="far fa-envelope" aria-hidden="true"></i>
|
||||
{{ trans('admin/categories/general.required_acceptance') }}
|
||||
<br>
|
||||
@endif
|
||||
|
||||
@if ($asset->getEula())
|
||||
<i class="far fa-envelope" aria-hidden="true"></i>
|
||||
{{ trans('admin/categories/general.required_eula') }}
|
||||
<br>
|
||||
@endif
|
||||
|
||||
@if ($snipeSettings->webhook_endpoint!='')
|
||||
<i class="fab fa-slack" aria-hidden="true"></i>
|
||||
{{ trans('general.webhook_msg_note') }}
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
</div> <!--/.box-body-->
|
||||
<div class="box-footer">
|
||||
<a class="btn btn-link" href="{{ URL::previous() }}"> {{ trans('button.cancel') }}</a>
|
||||
<button type="submit" class="btn btn-primary pull-right"><i class="fas fa-check icon-white" aria-hidden="true"></i> {{ trans('general.checkout') }}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div> <!--/.col-md-7-->
|
||||
|
||||
<!-- right column -->
|
||||
<div class="col-md-5" id="current_assets_box" style="display:none;">
|
||||
<div class="box box-primary">
|
||||
<div class="box-header with-border">
|
||||
<h2 class="box-title">{{ trans('admin/users/general.current_assets') }}</h2>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<div id="current_assets_content">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
||||
|
||||
@section('moar_scripts')
|
||||
@include('partials/assets-assigned')
|
||||
|
||||
<script>
|
||||
// $('#checkout_at').datepicker({
|
||||
// clearBtn: true,
|
||||
// todayHighlight: true,
|
||||
// endDate: '0d',
|
||||
// format: 'yyyy-mm-dd'
|
||||
// });
|
||||
|
||||
|
||||
</script>
|
||||
@stop
|
382
SNIPE-IT/resources/views/hardware/edit.blade.php
Normal file
382
SNIPE-IT/resources/views/hardware/edit.blade.php
Normal file
@ -0,0 +1,382 @@
|
||||
|
||||
@extends('layouts/edit-form', [
|
||||
'createText' => trans('admin/hardware/form.create'),
|
||||
'updateText' => trans('admin/hardware/form.update'),
|
||||
'topSubmit' => true,
|
||||
'helpText' => trans('help.assets'),
|
||||
'helpPosition' => 'right',
|
||||
'formAction' => ($item->id) ? route('hardware.update', ['hardware' => $item->id]) : route('hardware.store'),
|
||||
])
|
||||
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('inputFields')
|
||||
|
||||
@include ('partials.forms.edit.company-select', ['translated_name' => trans('general.company'), 'fieldname' => 'company_id'])
|
||||
|
||||
|
||||
<!-- Asset Tag -->
|
||||
<div class="form-group {{ $errors->has('asset_tag') ? ' has-error' : '' }}">
|
||||
<label for="asset_tag" class="col-md-3 control-label">{{ trans('admin/hardware/form.tag') }}</label>
|
||||
|
||||
|
||||
|
||||
@if ($item->id)
|
||||
<!-- we are editing an existing asset, there will be only one asset tag -->
|
||||
<div class="col-md-7 col-sm-12{{ (Helper::checkIfRequired($item, 'asset_tag')) ? ' required' : '' }}">
|
||||
|
||||
|
||||
<input class="form-control" type="text" name="asset_tags[1]" id="asset_tag" value="{{ old('asset_tag', $item->asset_tag) }}" data-validation="required">
|
||||
{!! $errors->first('asset_tags', '<span class="alert-msg"><i class="fas fa-times"></i> :message</span>') !!}
|
||||
{!! $errors->first('asset_tag', '<span class="alert-msg"><i class="fas fa-times"></i> :message</span>') !!}
|
||||
</div>
|
||||
@else
|
||||
<!-- we are creating a new asset - let people use more than one asset tag -->
|
||||
<div class="col-md-7 col-sm-12{{ (Helper::checkIfRequired($item, 'asset_tag')) ? ' required' : '' }}">
|
||||
<input class="form-control" type="text" name="asset_tags[1]" id="asset_tag" value="{{ old('asset_tags.1', \App\Models\Asset::autoincrement_asset()) }}" data-validation="required">
|
||||
{!! $errors->first('asset_tags', '<span class="alert-msg"><i class="fas fa-times"></i> :message</span>') !!}
|
||||
{!! $errors->first('asset_tag', '<span class="alert-msg"><i class="fas fa-times"></i> :message</span>') !!}
|
||||
</div>
|
||||
<div class="col-md-2 col-sm-12">
|
||||
<button class="add_field_button btn btn-default btn-sm">
|
||||
<i class="fas fa-plus"></i>
|
||||
</button>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
@include ('partials.forms.edit.serial', ['fieldname'=> 'serials[1]', 'old_val_name' => 'serials.1', 'translated_serial' => trans('admin/hardware/form.serial')])
|
||||
|
||||
<div class="input_fields_wrap">
|
||||
</div>
|
||||
|
||||
@include ('partials.forms.edit.model-select', ['translated_name' => trans('admin/hardware/form.model'), 'fieldname' => 'model_id', 'field_req' => true])
|
||||
|
||||
|
||||
@include ('partials.forms.edit.status', [ 'required' => 'true'])
|
||||
@if (!$item->id)
|
||||
@include ('partials.forms.checkout-selector', ['user_select' => 'true','asset_select' => 'true', 'location_select' => 'true', 'style' => 'display:none;'])
|
||||
@include ('partials.forms.edit.user-select', ['translated_name' => trans('admin/hardware/form.checkout_to'), 'fieldname' => 'assigned_user', 'style' => 'display:none;', 'required' => 'false'])
|
||||
@include ('partials.forms.edit.asset-select', ['translated_name' => trans('admin/hardware/form.checkout_to'), 'fieldname' => 'assigned_asset', 'style' => 'display:none;', 'required' => 'false'])
|
||||
@include ('partials.forms.edit.location-select', ['translated_name' => trans('admin/hardware/form.checkout_to'), 'fieldname' => 'assigned_location', 'style' => 'display:none;', 'required' => 'false'])
|
||||
@elseif (($item->assignedTo) && ($item->deleted_at == ''))
|
||||
<!-- This is an asset and it's currently deployed, so let them edit the expected checkin date -->
|
||||
@include ('partials.forms.edit.datepicker', ['translated_name' => trans('admin/hardware/form.expected_checkin'),'fieldname' => 'expected_checkin'])
|
||||
@endif
|
||||
|
||||
@include ('partials.forms.edit.notes')
|
||||
@include ('partials.forms.edit.location-select', ['translated_name' => trans('admin/hardware/form.default_location'), 'fieldname' => 'rtd_location_id', 'help_text' => trans('general.rtd_location_help')])
|
||||
@include ('partials.forms.edit.requestable', ['requestable_text' => trans('admin/hardware/general.requestable')])
|
||||
|
||||
|
||||
|
||||
@include ('partials.forms.edit.image-upload', ['image_path' => app('assets_upload_path')])
|
||||
|
||||
|
||||
<div id='custom_fields_content'>
|
||||
<!-- Custom Fields -->
|
||||
@if ($item->model && $item->model->fieldset)
|
||||
<?php $model = $item->model; ?>
|
||||
@endif
|
||||
@if (Request::old('model_id'))
|
||||
@php
|
||||
$model = \App\Models\AssetModel::find(old('model_id'));
|
||||
@endphp
|
||||
@elseif (isset($selected_model))
|
||||
@php
|
||||
$model = $selected_model;
|
||||
@endphp
|
||||
@endif
|
||||
@if (isset($model) && $model)
|
||||
@include("models/custom_fields_form",["model" => $model])
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label"></label>
|
||||
|
||||
<div class="col-md-9 col-sm-9 col-md-offset-3">
|
||||
|
||||
<a id="optional_info" class="text-primary">
|
||||
<i class="fa fa-caret-right fa-2x" id="optional_info_icon"></i>
|
||||
<strong>{{ trans('admin/hardware/form.optional_infos') }}</strong>
|
||||
</a>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="optional_details" class="col-md-12" style="display:none">
|
||||
<br>
|
||||
@include ('partials.forms.edit.name', ['translated_name' => trans('admin/hardware/form.name')])
|
||||
@include ('partials.forms.edit.warranty')
|
||||
|
||||
<!-- byod checkbox -->
|
||||
<div class="form-group">
|
||||
<div class="col-md-7 col-md-offset-3">
|
||||
<label for="byod" class="form-control">
|
||||
<input type="checkbox" value="1" name="byod" {{ (old('remote', $item->byod)) == '1' ? ' checked="checked"' : '' }} aria-label="byod">
|
||||
{{ trans('general.byod') }}
|
||||
|
||||
</label>
|
||||
<p class="help-block">{{ trans('general.byod_help') }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-md-9 col-sm-9 col-md-offset-3">
|
||||
<a id="order_info" class="text-primary">
|
||||
<i class="fa fa-caret-right fa-2x" id="order_info_icon"></i>
|
||||
<strong>{{ trans('admin/hardware/form.order_details') }}</strong>
|
||||
</a>
|
||||
|
||||
</div>
|
||||
|
||||
<div id='order_details' class="col-md-12" style="display:none">
|
||||
<br>
|
||||
@include ('partials.forms.edit.order_number')
|
||||
@include ('partials.forms.edit.purchase_date')
|
||||
@include ('partials.forms.edit.eol_date')
|
||||
@include ('partials.forms.edit.supplier-select', ['translated_name' => trans('general.supplier'), 'fieldname' => 'supplier_id'])
|
||||
|
||||
@php
|
||||
$currency_type = null;
|
||||
if ($item->id && $item->location) {
|
||||
$currency_type = $item->location->currency;
|
||||
}
|
||||
@endphp
|
||||
|
||||
@include ('partials.forms.edit.purchase_cost', ['currency_type' => $currency_type])
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@stop
|
||||
|
||||
@section('moar_scripts')
|
||||
|
||||
|
||||
|
||||
<script nonce="{{ csrf_token() }}">
|
||||
|
||||
@if(Request::has('model_id'))
|
||||
//TODO: Refactor custom fields to use Livewire, populate from server on page load when requested with model_id
|
||||
$(document).ready(function() {
|
||||
fetchCustomFields()
|
||||
});
|
||||
@endif
|
||||
|
||||
var transformed_oldvals={};
|
||||
|
||||
function fetchCustomFields() {
|
||||
//save custom field choices
|
||||
var oldvals = $('#custom_fields_content').find('input,select').serializeArray();
|
||||
for(var i in oldvals) {
|
||||
transformed_oldvals[oldvals[i].name]=oldvals[i].value;
|
||||
}
|
||||
|
||||
var modelid = $('#model_select_id').val();
|
||||
if (modelid == '') {
|
||||
$('#custom_fields_content').html("");
|
||||
} else {
|
||||
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: "{{ config('app.url') }}/models/" + modelid + "/custom_fields",
|
||||
headers: {
|
||||
"X-Requested-With": 'XMLHttpRequest',
|
||||
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
_token: "{{ csrf_token() }}",
|
||||
dataType: 'html',
|
||||
success: function (data) {
|
||||
$('#custom_fields_content').html(data);
|
||||
$('#custom_fields_content select').select2(); //enable select2 on any custom fields that are select-boxes
|
||||
//now re-populate the custom fields based on the previously saved values
|
||||
$('#custom_fields_content').find('input,select').each(function (index,elem) {
|
||||
if(transformed_oldvals[elem.name]) {
|
||||
{{-- If there already *is* is a previously-input 'transformed_oldvals' handy,
|
||||
overwrite with that previously-input value *IF* this is an edit of an existing item *OR*
|
||||
if there is no new default custom field value coming from the model --}}
|
||||
if({{ $item->id ? 'true' : 'false' }} || $(elem).val() == '') {
|
||||
$(elem).val(transformed_oldvals[elem.name]).trigger('change'); //the trigger is for select2-based objects, if we have any
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function user_add(status_id) {
|
||||
|
||||
if (status_id != '') {
|
||||
$(".status_spinner").css("display", "inline");
|
||||
$.ajax({
|
||||
url: "{{config('app.url') }}/api/v1/statuslabels/" + status_id + "/deployable",
|
||||
headers: {
|
||||
"X-Requested-With": 'XMLHttpRequest',
|
||||
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
success: function (data) {
|
||||
$(".status_spinner").css("display", "none");
|
||||
$("#selected_status_status").fadeIn();
|
||||
|
||||
if (data == true) {
|
||||
$("#assignto_selector").show();
|
||||
$("#assigned_user").show();
|
||||
|
||||
$("#selected_status_status").removeClass('text-danger');
|
||||
$("#selected_status_status").removeClass('text-warning');
|
||||
$("#selected_status_status").addClass('text-success');
|
||||
$("#selected_status_status").html('<i class="fas fa-check"></i> {{ trans('admin/hardware/form.asset_deployable')}}');
|
||||
|
||||
|
||||
} else {
|
||||
$("#assignto_selector").hide();
|
||||
$("#selected_status_status").removeClass('text-danger');
|
||||
$("#selected_status_status").removeClass('text-success');
|
||||
$("#selected_status_status").addClass('text-warning');
|
||||
$("#selected_status_status").html('<i class="fas fa-exclamation-triangle"></i> {{ trans('admin/hardware/form.asset_not_deployable')}} ');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$(function () {
|
||||
//grab custom fields for this model whenever model changes.
|
||||
$('#model_select_id').on("change", fetchCustomFields);
|
||||
|
||||
//initialize assigned user/loc/asset based on statuslabel's statustype
|
||||
user_add($(".status_id option:selected").val());
|
||||
|
||||
//whenever statuslabel changes, update assigned user/loc/asset
|
||||
$(".status_id").on("change", function () {
|
||||
user_add($(".status_id").val());
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
// Add another asset tag + serial combination if the plus sign is clicked
|
||||
$(document).ready(function() {
|
||||
|
||||
var max_fields = 100; //maximum input boxes allowed
|
||||
var wrapper = $(".input_fields_wrap"); //Fields wrapper
|
||||
var add_button = $(".add_field_button"); //Add button ID
|
||||
var x = 1; //initial text box count
|
||||
|
||||
|
||||
|
||||
|
||||
$(add_button).click(function(e){ //on add input button click
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
var auto_tag = $("#asset_tag").val().replace(/[^\d]/g, '');
|
||||
var box_html = '';
|
||||
const zeroPad = (num, places) => String(num).padStart(places, '0');
|
||||
|
||||
// Check that we haven't exceeded the max number of asset fields
|
||||
if (x < max_fields) {
|
||||
|
||||
if (auto_tag!='') {
|
||||
auto_tag = zeroPad(parseInt(auto_tag) + parseInt(x),auto_tag.length);
|
||||
} else {
|
||||
auto_tag = '';
|
||||
}
|
||||
|
||||
x++; //text box increment
|
||||
|
||||
box_html += '<span class="fields_wrapper">';
|
||||
box_html += '<div class="form-group"><label for="asset_tag" class="col-md-3 control-label">{{ trans('admin/hardware/form.tag') }} ' + x + '</label>';
|
||||
box_html += '<div class="col-md-7 col-sm-12 required">';
|
||||
box_html += '<input type="text" class="form-control" name="asset_tags[' + x + ']" value="{{ (($snipeSettings->auto_increment_prefix!='') && ($snipeSettings->auto_increment_assets=='1')) ? $snipeSettings->auto_increment_prefix : '' }}'+ auto_tag +'" data-validation="required">';
|
||||
box_html += '</div>';
|
||||
box_html += '<div class="col-md-2 col-sm-12">';
|
||||
box_html += '<a href="#" class="remove_field btn btn-default btn-sm"><i class="fas fa-minus"></i></a>';
|
||||
box_html += '</div>';
|
||||
box_html += '</div>';
|
||||
box_html += '</div>';
|
||||
box_html += '<div class="form-group"><label for="serial" class="col-md-3 control-label">{{ trans('admin/hardware/form.serial') }} ' + x + '</label>';
|
||||
box_html += '<div class="col-md-7 col-sm-12">';
|
||||
box_html += '<input type="text" class="form-control" name="serials[' + x + ']">';
|
||||
box_html += '</div>';
|
||||
box_html += '</div>';
|
||||
box_html += '</span>';
|
||||
$(wrapper).append(box_html);
|
||||
|
||||
// We have reached the maximum number of extra asset fields, so disable the button
|
||||
} else {
|
||||
$(".add_field_button").attr('disabled');
|
||||
$(".add_field_button").addClass('disabled');
|
||||
}
|
||||
});
|
||||
|
||||
$(wrapper).on("click",".remove_field", function(e){ //user clicks on remove text
|
||||
$(".add_field_button").removeAttr('disabled');
|
||||
$(".add_field_button").removeClass('disabled');
|
||||
e.preventDefault();
|
||||
//console.log(x);
|
||||
|
||||
$(this).parent('div').parent('div').parent('span').remove();
|
||||
x--;
|
||||
});
|
||||
|
||||
|
||||
$('.expand').click(function(){
|
||||
id = $(this).attr('id');
|
||||
fields = $(this).text();
|
||||
if (txt == '+'){
|
||||
$(this).text('-');
|
||||
}
|
||||
else{
|
||||
$(this).text('+');
|
||||
}
|
||||
$("#"+id).toggle();
|
||||
|
||||
});
|
||||
|
||||
{{-- TODO: Clean up some of the duplication in here. Not too high of a priority since we only copied it once. --}}
|
||||
$("#optional_info").on("click",function(){
|
||||
$('#optional_details').fadeToggle(100);
|
||||
$('#optional_info_icon').toggleClass('fa-caret-right fa-caret-down');
|
||||
var optional_info_open = $('#optional_info_icon').hasClass('fa-caret-down');
|
||||
document.cookie = "optional_info_open="+optional_info_open+'; path=/';
|
||||
});
|
||||
|
||||
$("#order_info").on("click",function(){
|
||||
$('#order_details').fadeToggle(100);
|
||||
$("#order_info_icon").toggleClass('fa-caret-right fa-caret-down');
|
||||
var order_info_open = $('#order_info_icon').hasClass('fa-caret-down');
|
||||
document.cookie = "order_info_open="+order_info_open+'; path=/';
|
||||
});
|
||||
|
||||
var all_cookies = document.cookie.split(';')
|
||||
for(var i in all_cookies) {
|
||||
var trimmed_cookie = all_cookies[i].trim(' ')
|
||||
if (trimmed_cookie.startsWith('optional_info_open=')) {
|
||||
elems = all_cookies[i].split('=', 2)
|
||||
if (elems[1] == 'true') {
|
||||
$('#optional_info').trigger('click')
|
||||
}
|
||||
}
|
||||
if (trimmed_cookie.startsWith('order_info_open=')) {
|
||||
elems = all_cookies[i].split('=', 2)
|
||||
if (elems[1] == 'true') {
|
||||
$('#order_info').trigger('click')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
@stop
|
231
SNIPE-IT/resources/views/hardware/history.blade.php
Normal file
231
SNIPE-IT/resources/views/hardware/history.blade.php
Normal file
@ -0,0 +1,231 @@
|
||||
@extends('layouts/default')
|
||||
|
||||
{{-- Page title --}}
|
||||
@section('title')
|
||||
{{ trans('general.import-history') }}
|
||||
@parent
|
||||
@stop
|
||||
|
||||
@section('header_right')
|
||||
<a href="{{ route('hardware.index') }}" class="btn btn-default"> {{ trans('general.back') }}</a>
|
||||
@stop
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
|
||||
|
||||
@if (isset($status))
|
||||
|
||||
@if (count($status['error']) > 0)
|
||||
<div class="row">
|
||||
<div class="col-md-8 col-md-offset-2">
|
||||
<div class="box box-default">
|
||||
<div class="alert alert-danger">
|
||||
<i class="fas fa-exclamation-triangle faa-pulse animated"></i>
|
||||
<strong>{{ count($status['error']) }} {{ trans('admin/hardware/general.error_messages') }}</strong> </strong>
|
||||
{{ trans('admin/hardware/general.alert_details') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-8 col-md-offset-2">
|
||||
<div class="box box-default">
|
||||
<div class="alert alert-success">
|
||||
<i class="fas fa-check faa-pulse animated"></i>
|
||||
<strong>{{ count($status['success']) }} {{ trans('admin/hardware/general.success_messages') }} </strong>
|
||||
{{ trans('admin/hardware/general.alert_details') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endif
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-8 col-md-offset-2">
|
||||
<div class="box box-default">
|
||||
<div class="box-body">
|
||||
<form class="form-horizontal" role="form" method="post" enctype="multipart/form-data" action="">
|
||||
<!-- CSRF Token -->
|
||||
<input type="hidden" name="_token" value="{{ csrf_token() }}" />
|
||||
|
||||
<div class="col-md-12">
|
||||
@if (Session::get('message'))
|
||||
<p class="alert-danger">
|
||||
{{ trans('admin/hardware/general.csv_error') }}<br />
|
||||
{{ Session::get('message') }}
|
||||
</p>
|
||||
@endif
|
||||
</div>
|
||||
<div class="col-md-12" style="padding: 10px;">
|
||||
{!! trans('admin/hardware/general.import_text') !!}
|
||||
</div>
|
||||
|
||||
<div class="col-md-12" style="padding: 10px;">
|
||||
<div class="form-group">
|
||||
<div class="col-md-9 col-md-offset-2">
|
||||
|
||||
<label class="btn btn-default" aria-hidden="true">
|
||||
{{ trans('button.select_file') }}
|
||||
<input type="file" name="user_import_csv" class="js-uploadFile" id="uploadFile" data-maxsize="user_import_csv" accept=".csv,.xls,.xlsx,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel,text/plain" style="display:none; max-width: 90%" aria-label="user_import_csv" aria-hidden="true"{{ (config('app.lock_passwords')===true) ? ' disabled' : ''}}>
|
||||
</label>
|
||||
<span class="label label-default" id="uploadFile-info" style="font-size: 15px;"></span>
|
||||
|
||||
@if (config('app.lock_passwords')===true)
|
||||
<p class="text-warning"><i class="fas fa-lock"></i>
|
||||
{{ trans('general.feature_disabled') }}</p>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12">
|
||||
<!-- Match firstname.lastname -->
|
||||
<div class="form-group">
|
||||
<div class="col-sm-10 col-md-offset-2">
|
||||
<label class="form-control">
|
||||
{{ Form::checkbox('match_firstnamelastname', '1', Request::old('match_firstnamelastname')) }}
|
||||
<!-- enclosing span needed for the checkbox CSS to work properly, since there's HTML in the label text -->
|
||||
<span>
|
||||
{!! trans('admin/hardware/general.csv_import_match_f-l') !!}
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Match flastname -->
|
||||
<div class="form-group">
|
||||
<div class="col-sm-10 col-md-offset-2">
|
||||
<label class="form-control">
|
||||
{{ Form::checkbox('match_flastname', '1', Request::old('match_flastname')) }}
|
||||
<!-- enclosing span needed for the checkbox CSS to work properly, since there's HTML in the label text -->
|
||||
<span>
|
||||
{!! trans('admin/hardware/general.csv_import_match_initial_last') !!}
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Match firstname -->
|
||||
<div class="form-group">
|
||||
<div class="col-sm-10 col-md-offset-2">
|
||||
<label class="form-control">
|
||||
{{ Form::checkbox('match_firstname', '1', Request::old('match_firstname')) }}
|
||||
<!-- enclosing span needed for the checkbox CSS to work properly, since there's HTML in the label text -->
|
||||
<span>
|
||||
{!! trans('admin/hardware/general.csv_import_match_first') !!}
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Match email -->
|
||||
<div class="form-group">
|
||||
<div class="col-sm-10 col-md-offset-2">
|
||||
<label class="form-control">
|
||||
{{ Form::checkbox('match_email', '1', Request::old('match_email')) }}
|
||||
<!-- enclosing span needed for the checkbox CSS to work properly, since there's HTML in the label text -->
|
||||
<span>
|
||||
{!! trans('admin/hardware/general.csv_import_match_email') !!}
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Match username -->
|
||||
<div class="form-group">
|
||||
<div class="col-sm-10 col-md-offset-2">
|
||||
<label class="form-control">
|
||||
{{ Form::checkbox('match_username', '1', Request::old('match_username')) }}
|
||||
<!-- enclosing span needed for the checkbox CSS to work properly, since there's HTML in the label text -->
|
||||
<span>
|
||||
{!! trans('admin/hardware/general.csv_import_match_username') !!}
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Form Actions -->
|
||||
<div class="box-footer text-right">
|
||||
@if (config('app.lock_passwords')===true)
|
||||
<div class="col-md-12">
|
||||
<div class="callout callout-info">
|
||||
{{ trans('general.feature_disabled') }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@else
|
||||
<button type="submit" class="btn btn-default">{{ trans('button.submit') }}</button>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
@if (isset($status))
|
||||
|
||||
|
||||
@if (count($status['error']) > 0)
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box box-default">
|
||||
<div class="box-header with-border">
|
||||
<h2 class="box-title"> {{ count($status['error']) }} {{ trans('admin/hardware/general.error_messages') }} </h2>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<div style="height : 400px; overflow : auto;">
|
||||
<table class="table">
|
||||
@for ($x = 0; $x < count($status['error']); $x++)
|
||||
@foreach($status['error'][$x] as $object_type => $message)
|
||||
<tr class="danger">
|
||||
<td><strong>{{ ucwords($object_type) }} {{ key($message) }}:</strong></td>
|
||||
<td>{{ $message[key($message)]['msg'] }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@endfor
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endif
|
||||
|
||||
@if (count($status['success']) > 0)
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box box-default">
|
||||
<div class="box-header with-border">
|
||||
<h2 class="box-title"> {{ count($status['success']) }} {{ trans('admin/hardware/general.success_messages') }} </h2>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<div style="height : 400px; overflow : auto;">
|
||||
<table class="table">
|
||||
@for ($x = 0; $x < count($status['success']); $x++)
|
||||
@foreach($status['success'][$x] as $object_type => $message)
|
||||
<tr class="success">
|
||||
<td><strong>{{ ucwords($object_type) }} {{ key($message) }}:</strong></td>
|
||||
<td>{{ $message[key($message)]['msg'] }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@endfor
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
@endif
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@stop
|
112
SNIPE-IT/resources/views/hardware/index.blade.php
Normal file
112
SNIPE-IT/resources/views/hardware/index.blade.php
Normal file
@ -0,0 +1,112 @@
|
||||
@extends('layouts/default')
|
||||
|
||||
@section('title0')
|
||||
|
||||
@if ((Request::get('company_id')) && ($company))
|
||||
{{ $company->name }}
|
||||
@endif
|
||||
|
||||
|
||||
|
||||
@if (Request::get('status'))
|
||||
@if (Request::get('status')=='Pending')
|
||||
{{ trans('general.pending') }}
|
||||
@elseif (Request::get('status')=='RTD')
|
||||
{{ trans('general.ready_to_deploy') }}
|
||||
@elseif (Request::get('status')=='Deployed')
|
||||
{{ trans('general.deployed') }}
|
||||
@elseif (Request::get('status')=='Undeployable')
|
||||
{{ trans('general.undeployable') }}
|
||||
@elseif (Request::get('status')=='Deployable')
|
||||
{{ trans('general.deployed') }}
|
||||
@elseif (Request::get('status')=='Requestable')
|
||||
{{ trans('admin/hardware/general.requestable') }}
|
||||
@elseif (Request::get('status')=='Archived')
|
||||
{{ trans('general.archived') }}
|
||||
@elseif (Request::get('status')=='Deleted')
|
||||
{{ trans('general.deleted') }}
|
||||
@elseif (Request::get('status')=='byod')
|
||||
{{ trans('general.byod') }}
|
||||
@endif
|
||||
@else
|
||||
{{ trans('general.all') }}
|
||||
@endif
|
||||
{{ trans('general.assets') }}
|
||||
|
||||
@if (Request::has('order_number'))
|
||||
: Order #{{ strval(Request::get('order_number')) }}
|
||||
@endif
|
||||
@stop
|
||||
|
||||
{{-- Page title --}}
|
||||
@section('title')
|
||||
@yield('title0') @parent
|
||||
@stop
|
||||
|
||||
@section('header_right')
|
||||
<a href="{{ route('reports/custom') }}" style="margin-right: 5px;" class="btn btn-default">
|
||||
{{ trans('admin/hardware/general.custom_export') }}</a>
|
||||
@can('create', \App\Models\Asset::class)
|
||||
<a href="{{ route('hardware.create') }}" accesskey="n" class="btn btn-primary pull-right"></i> {{ trans('general.create') }}</a>
|
||||
@endcan
|
||||
|
||||
@stop
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box">
|
||||
<div class="box-body">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
@include('partials.asset-bulk-actions', ['status' => Request::get('status')])
|
||||
|
||||
<table
|
||||
data-advanced-search="true"
|
||||
data-click-to-select="true"
|
||||
data-columns="{{ \App\Presenters\AssetPresenter::dataTableLayout() }}"
|
||||
data-cookie-id-table="assetsListingTable"
|
||||
data-pagination="true"
|
||||
data-id-table="assetsListingTable"
|
||||
data-search="true"
|
||||
data-side-pagination="server"
|
||||
data-show-columns="true"
|
||||
data-show-export="true"
|
||||
data-show-footer="true"
|
||||
data-show-refresh="true"
|
||||
data-sort-order="asc"
|
||||
data-sort-name="name"
|
||||
data-show-fullscreen="true"
|
||||
data-toolbar="#assetsBulkEditToolbar"
|
||||
data-bulk-button-id="#bulkAssetEditButton"
|
||||
data-bulk-form-id="#assetsBulkForm"
|
||||
id="assetsListingTable"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{ route('api.assets.index',
|
||||
array('status' => e(Request::get('status')),
|
||||
'order_number'=>e(strval(Request::get('order_number'))),
|
||||
'company_id'=>e(Request::get('company_id')),
|
||||
'status_id'=>e(Request::get('status_id')))) }}"
|
||||
data-export-options='{
|
||||
"fileName": "export{{ (Request::has('status')) ? '-'.str_slug(Request::get('status')) : '' }}-assets-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'>
|
||||
</table>
|
||||
|
||||
</div><!-- /.col -->
|
||||
</div><!-- /.row -->
|
||||
|
||||
</div><!-- ./box-body -->
|
||||
</div><!-- /.box -->
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
||||
|
||||
@section('moar_scripts')
|
||||
@include('partials.bootstrap-table')
|
||||
|
||||
@stop
|
178
SNIPE-IT/resources/views/hardware/labels.blade.php
Normal file
178
SNIPE-IT/resources/views/hardware/labels.blade.php
Normal file
@ -0,0 +1,178 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<title>Labels</title>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<?php
|
||||
$settings->labels_width = $settings->labels_width - $settings->labels_display_sgutter;
|
||||
$settings->labels_height = $settings->labels_height - $settings->labels_display_bgutter;
|
||||
// Leave space on bottom for 1D barcode if necessary
|
||||
$qr_size = ($settings->alt_barcode_enabled=='1') && ($settings->alt_barcode!='') ? $settings->labels_height - .3 : $settings->labels_height - 0.1;
|
||||
?>
|
||||
|
||||
<style>
|
||||
body {
|
||||
font-family: arial, helvetica, sans-serif;
|
||||
width: {{ $settings->labels_pagewidth }}in;
|
||||
height: {{ $settings->labels_pageheight }}in;
|
||||
margin: {{ $settings->labels_pmargin_top }}in {{ $settings->labels_pmargin_right }}in {{ $settings->labels_pmargin_bottom }}in {{ $settings->labels_pmargin_left }}in;
|
||||
font-size: {{ $settings->labels_fontsize }}pt;
|
||||
}
|
||||
.label {
|
||||
width: {{ $settings->labels_width }}in;
|
||||
height: {{ $settings->labels_height }}in;
|
||||
padding: 0in;
|
||||
margin-right: {{ $settings->labels_display_sgutter }}in; /* the gutter */
|
||||
margin-bottom: {{ $settings->labels_display_bgutter }}in;
|
||||
display: inline-block;
|
||||
overflow: hidden;
|
||||
}
|
||||
.page-break {
|
||||
page-break-after:always;
|
||||
}
|
||||
div.qr_img {
|
||||
width: {{ $qr_size }}in;
|
||||
height: {{ $qr_size }}in;
|
||||
|
||||
float: left;
|
||||
display: inline-flex;
|
||||
padding-right: .15in;
|
||||
}
|
||||
img.qr_img {
|
||||
|
||||
width: 120.79%;
|
||||
height: 120.79%;
|
||||
margin-top: -6.9%;
|
||||
margin-left: -6.9%;
|
||||
padding-bottom: .04in;
|
||||
}
|
||||
img.barcode {
|
||||
display:block;
|
||||
margin-top:{{$settings->qr_code=='1' ? '-15px' : '-7px;'}};
|
||||
width: 100%;
|
||||
}
|
||||
div.label-logo {
|
||||
float: right;
|
||||
display: inline-block;
|
||||
}
|
||||
img.label-logo {
|
||||
height: 0.5in;
|
||||
}
|
||||
.qr_text {
|
||||
width: {{ $settings->labels_width }}in;
|
||||
height: {{ $settings->labels_height }}in;
|
||||
padding-top: {{$settings->labels_display_bgutter}}in;
|
||||
font-family: arial, helvetica, sans-serif;
|
||||
font-size: {{$settings->labels_fontsize}}pt;
|
||||
padding-right: .0001in;
|
||||
overflow: hidden !important;
|
||||
display: inline;
|
||||
word-wrap: break-word;
|
||||
word-break: break-all;
|
||||
}
|
||||
div.barcode_container {
|
||||
|
||||
width: 100%;
|
||||
display: inline;
|
||||
overflow: hidden;
|
||||
}
|
||||
.next-padding {
|
||||
margin: {{ $settings->labels_pmargin_top }}in {{ $settings->labels_pmargin_right }}in {{ $settings->labels_pmargin_bottom }}in {{ $settings->labels_pmargin_left }}in;
|
||||
}
|
||||
@media print {
|
||||
.noprint {
|
||||
display: none !important;
|
||||
}
|
||||
.next-padding {
|
||||
margin: {{ $settings->labels_pmargin_top }}in {{ $settings->labels_pmargin_right }}in {{ $settings->labels_pmargin_bottom }}in {{ $settings->labels_pmargin_left }}in;
|
||||
font-size: 0;
|
||||
}
|
||||
}
|
||||
@media screen {
|
||||
.label {
|
||||
outline: .02in black solid; /* outline doesn't occupy space like border does */
|
||||
}
|
||||
.noprint {
|
||||
font-size: 13px;
|
||||
padding-bottom: 15px;
|
||||
}
|
||||
}
|
||||
@if ($snipeSettings->custom_css)
|
||||
{!! $snipeSettings->show_custom_css() !!}
|
||||
@endif
|
||||
</style>
|
||||
|
||||
@foreach ($assets as $asset)
|
||||
<?php $count++; ?>
|
||||
<div class="label">
|
||||
|
||||
@if ($settings->qr_code=='1')
|
||||
<div class="qr_img">
|
||||
<img src="{{ config('app.url') }}/hardware/{{ $asset->id }}/qr_code" class="qr_img">
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="qr_text">
|
||||
@if ($settings->label_logo)
|
||||
<div class="label-logo">
|
||||
<img class="label-logo" src="{{ Storage::disk('public')->url('').e($snipeSettings->label_logo) }}">
|
||||
</div>
|
||||
@endif
|
||||
@if ($settings->qr_text!='')
|
||||
<div class="pull-left">
|
||||
<strong>{{ $settings->qr_text }}</strong>
|
||||
<br>
|
||||
</div>
|
||||
@endif
|
||||
@if (($settings->labels_display_company_name=='1') && ($asset->company))
|
||||
<div class="pull-left">
|
||||
C: {{ $asset->company->name }}
|
||||
</div>
|
||||
@endif
|
||||
@if (($settings->labels_display_name=='1') && ($asset->name!=''))
|
||||
<div class="pull-left">
|
||||
N: {{ $asset->name }}
|
||||
</div>
|
||||
@endif
|
||||
@if (($settings->labels_display_tag=='1') && ($asset->asset_tag!=''))
|
||||
<div class="pull-left">
|
||||
T: {{ $asset->asset_tag }}
|
||||
</div>
|
||||
@endif
|
||||
@if (($settings->labels_display_serial=='1') && ($asset->serial!=''))
|
||||
<div class="pull-left">
|
||||
S: {{ $asset->serial }}
|
||||
</div>
|
||||
@endif
|
||||
@if (($settings->labels_display_model=='1') && ($asset->model->name!=''))
|
||||
<div class="pull-left">
|
||||
M: {{ $asset->model->name }} {{ $asset->model->model_number }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
</div>
|
||||
|
||||
@if ((($settings->alt_barcode_enabled=='1') && $settings->alt_barcode!=''))
|
||||
<div class="barcode_container">
|
||||
<img src="{{ config('app.url') }}/hardware/{{ $asset->id }}/barcode" class="barcode">
|
||||
</div>
|
||||
@endif
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
@if (($count % $settings->labels_per_page == 0) && $count!=count($assets))
|
||||
<div class="page-break"></div>
|
||||
<div class="next-padding"> </div>
|
||||
@endif
|
||||
|
||||
@endforeach
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
177
SNIPE-IT/resources/views/hardware/quickscan-checkin.blade.php
Normal file
177
SNIPE-IT/resources/views/hardware/quickscan-checkin.blade.php
Normal file
@ -0,0 +1,177 @@
|
||||
@extends('layouts/default')
|
||||
|
||||
{{-- Page title --}}
|
||||
@section('title')
|
||||
{{ trans('general.quickscan_checkin') }}
|
||||
@parent
|
||||
@stop
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
|
||||
<style>
|
||||
|
||||
.input-group {
|
||||
padding-left: 0px !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
|
||||
<div class="row">
|
||||
{{ Form::open(['method' => 'POST', 'class' => 'form-horizontal', 'role' => 'form', 'id' => 'checkin-form' ]) }}
|
||||
<!-- left column -->
|
||||
<div class="col-md-6">
|
||||
<div class="box box-default">
|
||||
<div class="box-header with-border">
|
||||
<h2 class="box-title"> {{ trans('admin/hardware/general.bulk_checkin') }} </h2>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
{{csrf_field()}}
|
||||
|
||||
<!-- Asset Tag -->
|
||||
<div class="form-group {{ $errors->has('asset_tag') ? 'error' : '' }}">
|
||||
{{ Form::label('asset_tag', trans('general.asset_tag'), array('class' => 'col-md-3 control-label', 'id' => 'checkin_tag')) }}
|
||||
<div class="col-md-9">
|
||||
<div class="input-group date col-md-5" data-date-format="yyyy-mm-dd">
|
||||
<input type="text" class="form-control" name="asset_tag" id="asset_tag" value="{{ Request::old('asset_tag') }}">
|
||||
|
||||
</div>
|
||||
{!! $errors->first('asset_tag', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Locations -->
|
||||
@include ('partials.forms.edit.location-select', ['translated_name' => trans('general.location'), 'fieldname' => 'location_id'])
|
||||
|
||||
<!-- Note -->
|
||||
<div class="form-group {{ $errors->has('note') ? 'error' : '' }}">
|
||||
{{ Form::label('note', trans('admin/hardware/form.notes'), array('class' => 'col-md-3 control-label')) }}
|
||||
<div class="col-md-8">
|
||||
<textarea class="col-md-6 form-control" id="note" name="note">{{ old('note') }}</textarea>
|
||||
{!! $errors->first('note', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div> <!--/.box-body-->
|
||||
<div class="box-footer">
|
||||
<a class="btn btn-link" href="{{ route('hardware.index') }}"> {{ trans('button.cancel') }}</a>
|
||||
<button type="submit" id="checkin_button" class="btn btn-success pull-right"><i class="fas fa-check icon-white" aria-hidden="true"></i> {{ trans('general.checkin') }}</button>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
{{Form::close()}}
|
||||
</div> <!--/.col-md-6-->
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="box box-default" id="checkedin-div" style="display: none">
|
||||
<div class="box-header with-border">
|
||||
<h2 class="box-title"> {{ trans('general.quickscan_checkin_status') }} (<span id="checkin-counter">0</span> {{ trans('general.assets_checked_in_count') }}) </h2>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
|
||||
<table id="checkedin" class="table table-striped snipe-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ trans('general.asset_tag') }}</th>
|
||||
<th>{{ trans('general.asset_model') }}</th>
|
||||
<th>{{ trans('general.model_no') }}</th>
|
||||
<th>{{ trans('general.quickscan_checkin_status') }}</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
<tr id="checkin-loader" style="display: none;">
|
||||
<td colspan="3">
|
||||
<i class="fas fa-spinner spin" aria-hidden="true"></i> {{ trans('general.processing') }}...
|
||||
</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@stop
|
||||
|
||||
|
||||
@section('moar_scripts')
|
||||
<script nonce="{{ csrf_token() }}">
|
||||
|
||||
$("#checkin-form").submit(function (event) {
|
||||
$('#checkedin-div').show();
|
||||
$('#checkin-loader').show();
|
||||
|
||||
event.preventDefault();
|
||||
|
||||
var form = $("#checkin-form").get(0);
|
||||
var formData = $('#checkin-form').serializeArray();
|
||||
|
||||
$.ajax({
|
||||
url: "{{ route('api.asset.checkinbytag') }}",
|
||||
type : 'POST',
|
||||
headers: {
|
||||
"X-Requested-With": 'XMLHttpRequest',
|
||||
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
dataType : 'json',
|
||||
data : formData,
|
||||
success : function (data) {
|
||||
if (data.status == 'success') {
|
||||
$('#checkedin tbody').prepend("<tr class='success'><td>" + data.payload.asset_tag + "</td><td>" + data.payload.model + "</td><td>" + data.payload.model_number + "</td><td>" + data.messages + "</td><td><i class='fas fa-check text-success'></i></td></tr>");
|
||||
incrementOnSuccess();
|
||||
} else {
|
||||
handlecheckinFail(data);
|
||||
}
|
||||
$('input#asset_tag').val('');
|
||||
},
|
||||
error: function (data) {
|
||||
handlecheckinFail(data);
|
||||
},
|
||||
complete: function() {
|
||||
$('#checkin-loader').hide();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
function handlecheckinFail (data) {
|
||||
if (data.payload.asset_tag) {
|
||||
var asset_tag = data.payload.asset_tag;
|
||||
var model = data.payload.model;
|
||||
var model_number = data.payload.model_number;
|
||||
} else {
|
||||
var asset_tag = '';
|
||||
var model = '';
|
||||
var model_number = '';
|
||||
}
|
||||
if (data.messages) {
|
||||
var messages = data.messages;
|
||||
} else {
|
||||
var messages = '';
|
||||
}
|
||||
$('#checkedin tbody').prepend("<tr class='danger'><td>" + asset_tag + "</td><td>" + model + "</td><td>" + model_number + "</td><td>" + messages + "</td><td><i class='fas fa-times text-danger'></i></td></tr>");
|
||||
}
|
||||
|
||||
function incrementOnSuccess() {
|
||||
var x = parseInt($('#checkin-counter').html());
|
||||
y = x + 1;
|
||||
$('#checkin-counter').html(y);
|
||||
}
|
||||
|
||||
$("#checkin_tag").focus();
|
||||
|
||||
</script>
|
||||
@stop
|
200
SNIPE-IT/resources/views/hardware/quickscan.blade.php
Normal file
200
SNIPE-IT/resources/views/hardware/quickscan.blade.php
Normal file
@ -0,0 +1,200 @@
|
||||
@extends('layouts/default')
|
||||
|
||||
{{-- Page title --}}
|
||||
@section('title')
|
||||
{{ trans('general.bulkaudit') }}
|
||||
@parent
|
||||
@stop
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
|
||||
<style>
|
||||
|
||||
.input-group {
|
||||
padding-left: 0px !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
|
||||
<div class="row">
|
||||
{{ Form::open(['method' => 'POST', 'class' => 'form-horizontal', 'role' => 'form', 'id' => 'audit-form' ]) }}
|
||||
<!-- left column -->
|
||||
<div class="col-md-6">
|
||||
<div class="box box-default">
|
||||
<div class="box-header with-border">
|
||||
<h2 class="box-title"> {{ trans('general.bulkaudit') }} </h2>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
{{csrf_field()}}
|
||||
|
||||
<!-- Next Audit -->
|
||||
<div class="form-group {{ $errors->has('asset_tag') ? 'error' : '' }}">
|
||||
{{ Form::label('asset_tag', trans('general.asset_tag'), array('class' => 'col-md-3 control-label', 'id' => 'audit_tag')) }}
|
||||
<div class="col-md-9">
|
||||
<div class="input-group date col-md-5" data-date-format="yyyy-mm-dd">
|
||||
<input type="text" class="form-control" name="asset_tag" id="asset_tag" value="{{ Request::old('asset_tag') }}">
|
||||
|
||||
</div>
|
||||
{!! $errors->first('asset_tag', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<!-- Locations -->
|
||||
@include ('partials.forms.edit.location-select', ['translated_name' => trans('general.location'), 'fieldname' => 'location_id'])
|
||||
|
||||
|
||||
<!-- Update location -->
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-3 col-md-9">
|
||||
<label class="form-control">
|
||||
<input type="checkbox" value="1" name="update_location" {{ old('update_location') == '1' ? ' checked="checked"' : '' }}> {{ trans('admin/hardware/form.asset_location') }}
|
||||
</label>
|
||||
|
||||
<a href="#" class="text-dark-gray" tabindex="0" role="button" data-toggle="popover" data-trigger="focus" title="<i class='far fa-life-ring'></i> More Info" data-html="true" data-content="Checking this box will edit the asset record to reflect this new location. Leaving it unchecked will simply note the location in the audit log.<br><br>Note that if this asset is checked out, it will not change the location of the person, asset or location it is checked out to."><i class="far fa-life-ring"></i></a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Next Audit -->
|
||||
<div class="form-group {{ $errors->has('next_audit_date') ? 'error' : '' }}">
|
||||
{{ Form::label('next_audit_date', trans('general.next_audit_date'), array('class' => 'col-md-3 control-label')) }}
|
||||
<div class="col-md-9">
|
||||
<div class="input-group date col-md-5" data-provide="datepicker" data-date-format="yyyy-mm-dd" data-date-clear-btn="true">
|
||||
<input type="text" class="form-control" placeholder="{{ trans('general.next_audit_date') }}" name="next_audit_date" id="next_audit_date" value="{{ old('next_audit_date', $next_audit_date) }}">
|
||||
<span class="input-group-addon"><i class="fas fa-calendar" aria-hidden="true"></i></span>
|
||||
</div>
|
||||
{!! $errors->first('next_audit_date', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Note -->
|
||||
<div class="form-group {{ $errors->has('note') ? 'error' : '' }}">
|
||||
{{ Form::label('note', trans('admin/hardware/form.notes'), array('class' => 'col-md-3 control-label')) }}
|
||||
<div class="col-md-8">
|
||||
<textarea class="col-md-6 form-control" id="note" name="note">{{ old('note') }}</textarea>
|
||||
{!! $errors->first('note', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div> <!--/.box-body-->
|
||||
<div class="box-footer">
|
||||
<a class="btn btn-link" href="{{ route('hardware.index') }}"> {{ trans('button.cancel') }}</a>
|
||||
<button type="submit" id="audit_button" class="btn btn-success pull-right"><i class="fas fa-check icon-white" aria-hidden="true"></i> {{ trans('general.audit') }}</button>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
{{Form::close()}}
|
||||
</div> <!--/.col-md-6-->
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="box box-default" id="audited-div" style="display: none">
|
||||
<div class="box-header with-border">
|
||||
<h2 class="box-title"> {{ trans('general.bulkaudit_status') }} (<span id="audit-counter">0</span> {{ trans('general.assets_audited') }}) </h2>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
|
||||
<table id="audited" class="table table-striped snipe-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ trans('general.asset_tag') }}</th>
|
||||
<th>{{ trans('general.bulkaudit_status') }}</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
<tr id="audit-loader" style="display: none;">
|
||||
<td colspan="3">
|
||||
<i class="fas fa-spinner spin" aria-hidden="true"></i> {{ trans('admin/hardware/form.processing_spinner') }}
|
||||
</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@stop
|
||||
|
||||
|
||||
@section('moar_scripts')
|
||||
<script nonce="{{ csrf_token() }}">
|
||||
|
||||
$("#audit-form").submit(function (event) {
|
||||
$('#audited-div').show();
|
||||
$('#audit-loader').show();
|
||||
|
||||
event.preventDefault();
|
||||
|
||||
var form = $("#audit-form").get(0);
|
||||
var formData = $('#audit-form').serializeArray();
|
||||
|
||||
$.ajax({
|
||||
url: "{{ route('api.asset.audit') }}",
|
||||
type : 'POST',
|
||||
headers: {
|
||||
"X-Requested-With": 'XMLHttpRequest',
|
||||
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
dataType : 'json',
|
||||
data : formData,
|
||||
success : function (data) {
|
||||
if (data.status == 'success') {
|
||||
$('#audited tbody').prepend("<tr class='success'><td>" + data.payload.asset_tag + "</td><td>" + data.messages + "</td><td><i class='fas fa-check text-success'></i></td></tr>");
|
||||
incrementOnSuccess();
|
||||
} else {
|
||||
handleAuditFail(data);
|
||||
}
|
||||
$('input#asset_tag').val('');
|
||||
},
|
||||
error: function (data) {
|
||||
handleAuditFail(data);
|
||||
},
|
||||
complete: function() {
|
||||
$('#audit-loader').hide();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
function handleAuditFail (data) {
|
||||
if (data.asset_tag) {
|
||||
var asset_tag = data.asset_tag;
|
||||
} else {
|
||||
var asset_tag = '';
|
||||
}
|
||||
if (data.messages) {
|
||||
var messages = data.messages;
|
||||
} else {
|
||||
var messages = '';
|
||||
}
|
||||
$('#audited tbody').prepend("<tr class='danger'><td>" + asset_tag + "</td><td>" + messages + "</td><td><i class='fas fa-times text-danger'></i></td></tr>");
|
||||
}
|
||||
|
||||
function incrementOnSuccess() {
|
||||
var x = parseInt($('#audit-counter').html());
|
||||
y = x + 1;
|
||||
$('#audit-counter').html(y);
|
||||
}
|
||||
|
||||
$("#audit_tag").focus();
|
||||
|
||||
</script>
|
||||
@stop
|
153
SNIPE-IT/resources/views/hardware/requested.blade.php
Normal file
153
SNIPE-IT/resources/views/hardware/requested.blade.php
Normal file
@ -0,0 +1,153 @@
|
||||
@extends('layouts/default')
|
||||
|
||||
@section('title0')
|
||||
{{ trans('admin/hardware/general.requested') }}
|
||||
{{ trans('general.assets') }}
|
||||
@stop
|
||||
|
||||
{{-- Page title --}}
|
||||
@section('title')
|
||||
@yield('title0') @parent
|
||||
@stop
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box">
|
||||
<div class="box-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
@if ($requestedItems->count() > 0)
|
||||
<div class="table-responsive">
|
||||
<table
|
||||
name="requestedAssets"
|
||||
data-toolbar="#toolbar"
|
||||
class="table table-striped snipe-table"
|
||||
id="requestedAssets"
|
||||
data-advanced-search="true"
|
||||
data-search="true"
|
||||
data-show-columns="true"
|
||||
data-show-export="true"
|
||||
data-pagination="true"
|
||||
data-id-table="requestedAssets"
|
||||
data-cookie-id-table="requestedAssets"
|
||||
data-export-options='{
|
||||
"fileName": "export-assetrequests-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'>
|
||||
<thead>
|
||||
<tr role="row">
|
||||
<th class="col-md-1">Image</th>
|
||||
<th class="col-md-2">Item Name</th>
|
||||
<th class="col-md-2" data-sortable="true">{{ trans('admin/hardware/table.location') }}</th>
|
||||
<th class="col-md-2" data-sortable="true">{{ trans('admin/hardware/form.expected_checkin') }}</th>
|
||||
<th class="col-md-3" data-sortable="true">{{ trans('admin/hardware/table.requesting_user') }}</th>
|
||||
<th class="col-md-2">{{ trans('admin/hardware/table.requested_date') }}</th>
|
||||
<th class="col-md-1">{{ trans('button.actions') }}</th>
|
||||
<th class="col-md-1">{{ trans('general.checkout') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($requestedItems as $request)
|
||||
|
||||
@if ($request->requestable)
|
||||
<tr>
|
||||
{{ csrf_field() }}
|
||||
<td>
|
||||
@if (($request->itemType() == "asset") && ($request->requestable))
|
||||
<a href="{{ $request->requestable->getImageUrl() }}" data-toggle="lightbox" data-type="image"><img src="{{ $request->requestable->getImageUrl() }}" style="max-height: {{ $snipeSettings->thumbnail_max_h }}px; width: auto;" class="img-responsive" alt="{{ $request->requestable->name }}"></a>
|
||||
@elseif (($request->itemType() == "asset_model") && ($request->requestable))
|
||||
<a href="{{ config('app.url') }}/uploads/models/{{ $request->requestable->image }}" data-toggle="lightbox" data-type="image"><img src="{{ config('app.url') }}/uploads/models/{{ $request->requestable->image }}" style="max-height: {{ $snipeSettings->thumbnail_max_h }}px; width: auto;" class="img-responsive" alt="{{ $request->requestable->name }}"></a>
|
||||
@endif
|
||||
|
||||
|
||||
</td>
|
||||
<td>
|
||||
|
||||
@if ($request->itemType() == "asset")
|
||||
<a href="{{ config('app.url') }}/hardware/{{ $request->requestable->id }}">
|
||||
{{ $request->name() }}
|
||||
</a>
|
||||
@elseif ($request->itemType() == "asset_model")
|
||||
<a href="{{ config('app.url') }}/models/{{ $request->requestable->id }}">
|
||||
{{ $request->name() }}
|
||||
</a>
|
||||
@endif
|
||||
|
||||
</td>
|
||||
@if ($request->location())
|
||||
<td>{{ $request->location()->name }}</td>
|
||||
@else
|
||||
<td></td>
|
||||
@endif
|
||||
|
||||
<td>
|
||||
@if ($request->itemType() == "asset")
|
||||
{{ App\Helpers\Helper::getFormattedDateObject($request->requestable->expected_checkin, 'datetime', false) }}
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if ($request->requestingUser() && !$request->requestingUser()->trashed())
|
||||
<a href="{{ config('app.url') }}/users/{{ $request->requestingUser()->id }}">
|
||||
{{ $request->requestingUser()->present()->fullName() }}
|
||||
</a>
|
||||
@else
|
||||
(deleted user)
|
||||
@endif
|
||||
</td>
|
||||
<td>{{ App\Helpers\Helper::getFormattedDateObject($request->created_at, 'datetime', false) }}</td>
|
||||
<td>
|
||||
{{ Form::open([
|
||||
'method' => 'POST',
|
||||
'route' => ['account/request-item', $request->itemType(), $request->requestable->id, true, $request->requestingUser()->id],
|
||||
]) }}
|
||||
<button class="btn btn-warning btn-sm" data-tooltip="true" title="{{ trans('general.cancel_request') }}">{{ trans('button.cancel') }}</button>
|
||||
{{ Form::close() }}
|
||||
</td>
|
||||
<td>
|
||||
@if ($request->itemType() == "asset")
|
||||
@if ($request->requestable->assigned_to=='')
|
||||
<a href="{{ config('app.url') }}/hardware/{{ $request->requestable->id }}/checkout" class="btn btn-sm bg-maroon" data-tooltip="true" title="{{ trans('general.checkout_user_tooltip') }}">{{ trans('general.checkout') }}</a>
|
||||
@else
|
||||
<a href="{{ config('app.url') }}/hardware/{{ $request->requestable->id }}/checkin" class="btn btn-sm bg-purple" data-tooltip="true" title="{{ trans('general.checkin_toolip') }}">{{ trans('general.checkin') }}</a>
|
||||
@endif
|
||||
|
||||
@endif
|
||||
</td>
|
||||
|
||||
|
||||
</tr>
|
||||
@endif
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@else
|
||||
<div class="col-md-12">
|
||||
<div class="alert alert-info alert-block">
|
||||
<i class="fas fa-info-circle"></i>
|
||||
{{ trans('general.no_results') }}
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- .col-md-12> -->
|
||||
</div> <!-- .row -->
|
||||
@stop
|
||||
|
||||
@section('moar_scripts')
|
||||
@include ('partials.bootstrap-table', [
|
||||
'exportFile' => 'requested-export',
|
||||
'search' => true,
|
||||
'clientSearch' => true,
|
||||
])
|
||||
|
||||
@stop
|
1483
SNIPE-IT/resources/views/hardware/view.blade.php
Normal file
1483
SNIPE-IT/resources/views/hardware/view.blade.php
Normal file
File diff suppressed because it is too large
Load Diff
23
SNIPE-IT/resources/views/kits/accessory-edit.blade.php
Normal file
23
SNIPE-IT/resources/views/kits/accessory-edit.blade.php
Normal file
@ -0,0 +1,23 @@
|
||||
@extends('layouts/edit-form', [
|
||||
'createText' => {{ trans('admin/kits/general.append_accessory') }},
|
||||
'updateText' => {{ trans('admin/kits/general.update_appended_accessory') }},
|
||||
'formAction' => (isset($item->id)) ? route('kits.accessories.update', ['kit_id' => $kit->id, 'accessory_id' => $item->accessory_id]) : route('kits.accessories.store', ['kit_id' => $kit->id]),
|
||||
])
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('inputFields')
|
||||
@include ('partials.forms.edit.accessory-select', ['translated_name' => {{ trans('general.accessory')}}, 'fieldname' => 'accessory_id', 'required' => 'true'])
|
||||
<div class="form-group {{ $errors->has('quantity') ? ' has-error' : '' }}">
|
||||
<label for="quantity" class="col-md-3 control-label">{{ trans('general.quantity') }}</label>
|
||||
<div class="col-md-7 required">
|
||||
<div class="col-md-2" style="padding-left:0px">
|
||||
<input class="form-control" type="text" name="quantity" id="quantity" value="{{ Request::old('quantity', $item->quantity) }}" />
|
||||
</div>
|
||||
{!! $errors->first('quantity', '<span class="alert-msg"><i class="fas fa-times"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input type="hidden" name="pivot_id" value="{{$item->id}}">
|
||||
{{-- <input class="form-control" type="text" name="quantity" id="quantity" value="{{ Request::old('quantity', $item->quantity) }}" /> --}}
|
||||
|
||||
@stop
|
94
SNIPE-IT/resources/views/kits/checkout.blade.php
Normal file
94
SNIPE-IT/resources/views/kits/checkout.blade.php
Normal file
@ -0,0 +1,94 @@
|
||||
@extends('layouts/default')
|
||||
|
||||
{{-- Page title --}}
|
||||
@section('title')
|
||||
{{ trans('admin/kits/general.checkout') }}
|
||||
@parent
|
||||
@stop
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
|
||||
<style>
|
||||
.input-group {
|
||||
padding-left: 0px !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<!-- left column -->
|
||||
<div class="col-md-7">
|
||||
<div class="box box-default">
|
||||
<div class="box-body">
|
||||
<form class="form-horizontal" method="post" action="" autocomplete="off">
|
||||
{{ csrf_field() }}
|
||||
@include ('partials.forms.edit.user-select', ['translated_name' => trans('general.select_user'), 'fieldname' => 'user_id', 'required'=> 'true'])
|
||||
|
||||
<!-- Checkout/Checkin Date -->
|
||||
<div class="form-group {{ $errors->has('checkout_at') ? 'error' : '' }}">
|
||||
{{ Form::label('name', trans('admin/hardware/form.checkout_date'), array('class' => 'col-md-3 control-label')) }}
|
||||
<div class="col-md-8">
|
||||
<div class="input-group date col-md-5" data-provide="datepicker" data-date-format="yyyy-mm-dd" data-date-end-date="0d" data-date-clear-btn="true">
|
||||
<input type="text" class="form-control" placeholder="{{ trans('general.select_date') }}" name="checkout_at" id="checkout_at" value="{{ Request::old('checkout_at') }}">
|
||||
<span class="input-group-addon"><i class="fas fa-calendar"></i></span>
|
||||
</div>
|
||||
{!! $errors->first('checkout_at', '<span class="alert-msg"><i class="fas fa-times"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Expected Checkin Date -->
|
||||
<div class="form-group {{ $errors->has('expected_checkin') ? 'error' : '' }}">
|
||||
{{ Form::label('name', trans('admin/hardware/form.expected_checkin'), array('class' => 'col-md-3 control-label')) }}
|
||||
<div class="col-md-8">
|
||||
<div class="input-group date col-md-5" data-provide="datepicker" data-date-format="yyyy-mm-dd" data-date-start-date="0d">
|
||||
<input type="text" class="form-control" placeholder="{{ trans('general.select_date') }}" name="expected_checkin" id="expected_checkin" value="{{ Request::old('expected_checkin') }}">
|
||||
<span class="input-group-addon"><i class="fas fa-calendar"></i></span>
|
||||
</div>
|
||||
{!! $errors->first('expected_checkin', '<span class="alert-msg"><i class="fas fa-times"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Note -->
|
||||
<div class="form-group {{ $errors->has('note') ? 'error' : '' }}">
|
||||
{{ Form::label('note', trans('admin/hardware/form.notes'), array('class' => 'col-md-3 control-label')) }}
|
||||
<div class="col-md-8">
|
||||
<textarea class="col-md-6 form-control" id="note" name="note">{{ Request::old('note') }}</textarea>
|
||||
{!! $errors->first('note', '<span class="alert-msg"><i class="fas fa-times"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div> <!--./box-body-->
|
||||
<div class="box-footer">
|
||||
<a class="btn btn-link" href="{{ route('kits.index') }}"> {{ trans('button.cancel') }}</a>
|
||||
<button type="submit" class="btn btn-success pull-right"><i class="fas fa-check icon-white"></i> {{ trans('general.checkout') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div> <!--/.col-md-7-->
|
||||
|
||||
<!-- right column -->
|
||||
<div class="col-md-5" id="current_assets_box" style="display:none;">
|
||||
<div class="box box-primary">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">{{ trans('admin/users/general.current_assets') }}</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<div id="current_assets_content">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
||||
|
||||
@section('moar_scripts')
|
||||
@include('partials/assets-assigned')
|
||||
|
||||
@stop
|
||||
|
||||
@section('notifications')
|
||||
@parent
|
||||
<!-- included content -->
|
||||
@stop
|
24
SNIPE-IT/resources/views/kits/consumable-edit.blade.php
Normal file
24
SNIPE-IT/resources/views/kits/consumable-edit.blade.php
Normal file
@ -0,0 +1,24 @@
|
||||
@extends('layouts/edit-form', [
|
||||
'createText' => {{ trans('admin/kits/general.append_consumable') }},
|
||||
'updateText' => {{ trans('admin/kits/general.update_appended_consumable') }},
|
||||
'formAction' => (isset($item->id)) ? route('kits.consumables.update', ['kit_id' => $kit->id, 'consumable_id' => $item->consumable_id]) : route('kits.consumables.store', ['kit_id' => $kit->id]),
|
||||
])
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('inputFields')
|
||||
@include ('partials.forms.edit.consumable-select', ['translated_name' => {{ trans('general.consumable')}}, 'fieldname' => 'consumable_id', 'required' => 'true'])
|
||||
|
||||
<div class="form-group {{ $errors->has('quantity') ? ' has-error' : '' }}">
|
||||
<label for="quantity" class="col-md-3 control-label">{{ trans('general.quantity') }}</label>
|
||||
<div class="col-md-7 required">
|
||||
<div class="col-md-2" style="padding-left:0px">
|
||||
<input class="form-control" type="text" name="quantity" id="quantity" value="{{ Request::old('quantity', $item->quantity) }}" />
|
||||
</div>
|
||||
{!! $errors->first('quantity', '<span class="alert-msg"><i class="fas fa-times"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input type="hidden" name="pivot_id" value="{{$item->id}}">
|
||||
{{-- <input class="form-control" type="text" name="quantity" id="quantity" value="{{ Request::old('quantity', $item->quantity) }}" /> --}}
|
||||
|
||||
@stop
|
10
SNIPE-IT/resources/views/kits/create.blade.php
Normal file
10
SNIPE-IT/resources/views/kits/create.blade.php
Normal file
@ -0,0 +1,10 @@
|
||||
@extends('layouts/edit-form', [
|
||||
'createText' => trans('admin/kits/general.create'),
|
||||
'updateText' => trans('admin/kits/general.update'),
|
||||
'formAction' => (isset($item->id)) ? route('kits.update', ['kit' => $item->id]) : route('kits.store'),
|
||||
])
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('inputFields')
|
||||
@include ('partials.forms.edit.name', ['translated_name' => trans('general.name')])
|
||||
@stop
|
156
SNIPE-IT/resources/views/kits/edit.blade.php
Normal file
156
SNIPE-IT/resources/views/kits/edit.blade.php
Normal file
@ -0,0 +1,156 @@
|
||||
@extends('layouts/edit-form', [
|
||||
'createText' => trans('admin/kits/general.create'),
|
||||
'updateText' => trans('admin/kits/general.update'),
|
||||
'helpTitle' => trans('admin/kits/general.about_kits_title'),
|
||||
'helpText' => trans('admin/kits/general.about_kits_text'),
|
||||
'formAction' => (isset($item->id)) ? route('kits.update', ['kit' => $item->id]) : route('kits.store'),
|
||||
])
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('inputFields')
|
||||
@include ('partials.forms.edit.name', ['translated_name' => trans('general.name')])
|
||||
@stop
|
||||
|
||||
@section('content')
|
||||
@parent
|
||||
{{-- Assets by model --}}
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box box-default">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title"><span>{{ trans('general.asset_models') }}</span></h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<div class="table-responsive">
|
||||
<table
|
||||
data-cookie-id-table="kitModelsTable"
|
||||
data-columns="{{ \App\Presenters\PredefinedKitPresenter::dataTableModels() }}"
|
||||
data-pagination="true"
|
||||
data-search="true"
|
||||
data-side-pagination="server"
|
||||
data-show-columns="true"
|
||||
data-show-export="true"
|
||||
data-show-refresh="true"
|
||||
data-sort-order="asc"
|
||||
data-sort-name="name"
|
||||
id="kitModelsTable"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{ route('api.kits.models.index', $item->id) }}"
|
||||
data-export-options='{
|
||||
"fileName": "export-kit-models-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'>
|
||||
</table>
|
||||
<a href="{{ route('modal.show', ['type' => 'kit-model', 'itemId' => $item->id]) }}" data-refresh="kitModelsTable" data-toggle="modal" data-target="#createModal" class="btn btn-primary pull-right"><i class="fas fa-plus icon-white"></i> {{ trans('button.append')}}</a>
|
||||
</div>
|
||||
</div> <!--.box-body-->
|
||||
</div> <!-- /.box.box-default-->
|
||||
</div> <!-- .col-md-12-->
|
||||
</div>
|
||||
{{-- Licenses --}}
|
||||
{{--<div class="row">--}}
|
||||
{{-- <div class="col-md-12">--}}
|
||||
{{-- <div class="box box-default">--}}
|
||||
{{-- <div class="box-header with-border">--}}
|
||||
{{-- <h3 class="box-title">Licenses--}}{{-- TODO: trans --}}{{--</h3>--}}
|
||||
{{-- </div>--}}
|
||||
{{-- <div class="box-body">--}}
|
||||
{{-- <div class="table-responsive">--}}
|
||||
{{-- <table--}}
|
||||
{{-- data-cookie-id-table="kitLicensesTable"--}}
|
||||
{{-- data-columns="{{ \App\Presenters\PredefinedKitPresenter::dataTableLicenses() }}"--}}
|
||||
{{-- data-pagination="true"--}}
|
||||
{{-- data-search="true"--}}
|
||||
{{-- data-side-pagination="server"--}}
|
||||
{{-- data-show-columns="true"--}}
|
||||
{{-- data-show-export="true"--}}
|
||||
{{-- data-show-refresh="true"--}}
|
||||
{{-- data-sort-order="asc"--}}
|
||||
{{-- data-sort-name="name"--}}
|
||||
{{-- id="kitLicensesTable"--}}
|
||||
{{-- class="table table-striped snipe-table"--}}
|
||||
{{-- data-url="{{ route('api.kits.licenses.index', $item->id) }}"--}}
|
||||
{{-- data-export-options='{--}}
|
||||
{{-- "fileName": "export-kit-models-{{ date('Y-m-d') }}",--}}
|
||||
{{-- "ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]--}}
|
||||
{{-- }'>--}}
|
||||
{{-- </table>--}}
|
||||
{{-- <a href="{{ route('modal.show', [ 'type' => 'kit-license', 'itemId' => $item->id]) }}" data-refresh="kitLicensesTable" data-toggle="modal" data-target="#createModal" class="btn btn-primary pull-right"><i class="fas fa-plus icon-white"></i> Append--}}{{-- TODO: trans --}}{{--</a>--}}
|
||||
{{-- </div>--}}
|
||||
{{-- </div> <!--.box-body-->--}}
|
||||
{{-- </div> <!-- /.box.box-default-->--}}
|
||||
{{-- </div> <!-- .col-md-12-->--}}
|
||||
{{-- </div>--}}
|
||||
{{-- Consumables --}}
|
||||
{{--<div class="row">--}}
|
||||
{{-- <div class="col-md-12">--}}
|
||||
{{-- <div class="box box-default">--}}
|
||||
{{-- <div class="box-header with-border">--}}
|
||||
{{-- <h3 class="box-title">Consumables--}}{{-- TODO: trans --}}{{--</h3>--}}
|
||||
{{-- </div>--}}
|
||||
{{-- <div class="box-body">--}}
|
||||
{{-- <div class="table-responsive">--}}
|
||||
{{-- <table--}}
|
||||
{{-- data-cookie-id-table="kitConsumablesTable"--}}
|
||||
{{-- data-columns="{{ \App\Presenters\PredefinedKitPresenter::dataTableConsumables() }}"--}}
|
||||
{{-- data-pagination="true"--}}
|
||||
{{-- data-search="true"--}}
|
||||
{{-- data-side-pagination="server"--}}
|
||||
{{-- data-show-columns="true"--}}
|
||||
{{-- data-show-export="true"--}}
|
||||
{{-- data-show-refresh="true"--}}
|
||||
{{-- data-sort-order="asc"--}}
|
||||
{{-- data-sort-name="name"--}}
|
||||
{{-- id="kitConsumablesTable"--}}
|
||||
{{-- class="table table-striped snipe-table"--}}
|
||||
{{-- data-url="{{ route('api.kits.consumables.index', $item->id) }}"--}}
|
||||
{{-- data-export-options='{--}}
|
||||
{{-- "fileName": "export-kit-models-{{ date('Y-m-d') }}",--}}
|
||||
{{-- "ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]--}}
|
||||
{{-- }'>--}}
|
||||
{{-- </table>--}}
|
||||
{{-- <a href="{{ route('modal.show', ['type' => 'kit-consumable', 'itemId' => $item->id]) }}" data-refresh="kitConsumablesTable" data-toggle="modal" data-target="#createModal" class="btn btn-primary pull-right"><i class="fas fa-plus icon-white"></i> Append--}}{{-- TODO: trans --}}{{--</a>--}}
|
||||
{{-- </div>--}}
|
||||
{{-- </div> <!--.box-body-->--}}
|
||||
{{-- </div> <!-- /.box.box-default-->--}}
|
||||
{{-- </div> <!-- .col-md-12-->--}}
|
||||
{{-- </div>--}}
|
||||
{{-- Accessories --}}
|
||||
{{--<div class="row">--}}
|
||||
{{-- <div class="col-md-12">--}}
|
||||
{{-- <div class="box box-default">--}}
|
||||
{{-- <div class="box-header with-border">--}}
|
||||
{{-- <h3 class="box-title">Accessories--}}{{-- TODO: trans --}}{{--</h3>--}}
|
||||
{{-- </div>--}}
|
||||
{{-- <div class="box-body">--}}
|
||||
{{-- <div class="table-responsive">--}}
|
||||
{{-- <table--}}
|
||||
{{-- data-cookie-id-table="kitAccessoriesTable"--}}
|
||||
{{-- data-columns="{{ \App\Presenters\PredefinedKitPresenter::dataTableAccessories() }}"--}}
|
||||
{{-- data-pagination="true"--}}
|
||||
{{-- data-search="true"--}}
|
||||
{{-- data-side-pagination="server"--}}
|
||||
{{-- data-show-columns="true"--}}
|
||||
{{-- data-show-export="true"--}}
|
||||
{{-- data-show-refresh="true"--}}
|
||||
{{-- data-sort-order="asc"--}}
|
||||
{{-- data-sort-name="name"--}}
|
||||
{{-- id="kitAccessoriesTable"--}}
|
||||
{{-- class="table table-striped snipe-table"--}}
|
||||
{{-- data-url="{{ route('api.kits.accessories.index', $item->id) }}"--}}
|
||||
{{-- data-export-options='{--}}
|
||||
{{-- "fileName": "export-kit-models-{{ date('Y-m-d') }}",--}}
|
||||
{{-- "ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]--}}
|
||||
{{-- }'>--}}
|
||||
{{-- </table>--}}
|
||||
{{-- <a href="{{ route('modal.show', ['type' => 'kit-accessory', 'itemId' => $item->id]) }}" data-refresh="kitAccessoriesTable" data-toggle="modal" data-target="#createModal" class="btn btn-primary pull-right"><i class="fas fa-plus icon-white"></i> Append--}}{{-- TODO: trans --}}{{--</a>--}}
|
||||
{{-- </div>--}}
|
||||
{{-- </div> <!--.box-body-->--}}
|
||||
{{-- </div> <!-- /.box.box-default-->--}}
|
||||
{{-- </div> <!-- .col-md-12-->--}}
|
||||
{{-- </div>--}}
|
||||
@stop
|
||||
|
||||
@section('moar_scripts')
|
||||
@include ('partials.bootstrap-table')
|
||||
@stop
|
51
SNIPE-IT/resources/views/kits/index.blade.php
Normal file
51
SNIPE-IT/resources/views/kits/index.blade.php
Normal file
@ -0,0 +1,51 @@
|
||||
@extends('layouts/default', [
|
||||
'helpTitle' => trans('admin/kits/general.about_kits_title'),
|
||||
'helpText' => trans('admin/kits/general.about_kits_text')])
|
||||
|
||||
{{-- Web site Title --}}
|
||||
@section('title')
|
||||
{{ trans('general.kits') }}
|
||||
@parent
|
||||
@stop
|
||||
|
||||
@section('header_right')
|
||||
<a href="{{ route('kits.create') }}" class="btn btn-primary text-right">{{ trans('general.create') }}</a>
|
||||
@stop
|
||||
|
||||
|
||||
{{-- Content --}}
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box box-default">
|
||||
<div class="box-body">
|
||||
<div class="table-responsive">
|
||||
<table
|
||||
data-cookie-id-table="kitsTable"
|
||||
data-columns="{{ \App\Presenters\PredefinedKitPresenter::dataTableLayout() }}"
|
||||
data-pagination="true"
|
||||
data-search="true"
|
||||
data-side-pagination="server"
|
||||
data-show-columns="true"
|
||||
data-show-fullscreen="true"
|
||||
data-show-export="true"
|
||||
data-show-refresh="true"
|
||||
data-sort-order="asc"
|
||||
data-sort-name="name"
|
||||
id="kitsTable"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{ route('api.kits.index') }}"
|
||||
data-export-options='{
|
||||
"fileName": "export-kits-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'>
|
||||
</table>
|
||||
</div>
|
||||
</div> <!--.box-body-->
|
||||
</div> <!-- /.box.box-default-->
|
||||
</div> <!-- .col-md-12-->
|
||||
</div>
|
||||
@stop
|
||||
@section('moar_scripts')
|
||||
@include ('partials.bootstrap-table', ['exportFile' => 'kits-export', 'search' => true])
|
||||
@stop
|
23
SNIPE-IT/resources/views/kits/license-edit.blade.php
Normal file
23
SNIPE-IT/resources/views/kits/license-edit.blade.php
Normal file
@ -0,0 +1,23 @@
|
||||
@extends('layouts/edit-form', [
|
||||
'createText' => {{ trans('admin/kits/general.append_license') }},
|
||||
'updateText' => {{ trans('admin/kits/general.update_appended_license') }},
|
||||
'formAction' => (isset($item->id)) ? route('kits.licenses.update', ['kit_id' => $kit->id, 'license_id' => $item->license_id]) : route('kits.licenses.store', ['kit_id' => $kit->id]),
|
||||
])
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('inputFields')
|
||||
@include ('partials.forms.edit.license-select', ['translated_name' => trans('general.license'), 'fieldname' => 'license_id', 'required' => 'true'])
|
||||
<div class="form-group {{ $errors->has('quantity') ? ' has-error' : '' }}">
|
||||
<label for="quantity" class="col-md-3 control-label">{{ trans('general.quantity') }}</label>
|
||||
<div class="col-md-7 required">
|
||||
<div class="col-md-2" style="padding-left:0px">
|
||||
<input class="form-control" type="text" name="quantity" id="quantity" value="{{ Request::old('quantity', $item->quantity) }}" />
|
||||
</div>
|
||||
{!! $errors->first('quantity', '<span class="alert-msg"><i class="fas fa-times"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input type="hidden" name="pivot_id" value="{{$item->id}}">
|
||||
{{-- <input class="form-control" type="text" name="quantity" id="quantity" value="{{ Request::old('quantity', $item->quantity) }}" /> --}}
|
||||
|
||||
@stop
|
23
SNIPE-IT/resources/views/kits/model-edit.blade.php
Normal file
23
SNIPE-IT/resources/views/kits/model-edit.blade.php
Normal file
@ -0,0 +1,23 @@
|
||||
@extends('layouts/edit-form', [
|
||||
'createText' => trans('admin/kits/general.append_model'),
|
||||
'updateText' => trans('admin/kits/general.update_appended_model'),
|
||||
'formAction' => (isset($item->id)) ? route('kits.models.update', ['kit_id' => $kit->id, 'model_id' => $item->model_id]) : route('kits.models.store', ['kit_id' => $kit->id]),
|
||||
])
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('inputFields')
|
||||
@include ('partials.forms.edit.model-select', ['translated_name' => trans('admin/hardware/form.model'), 'fieldname' => 'model_id', 'required' => 'true'])
|
||||
<div class="form-group {{ $errors->has('quantity') ? ' has-error' : '' }}">
|
||||
<label for="quantity" class="col-md-3 control-label">{{ trans('general.quantity') }}</label>
|
||||
<div class="col-md-7 required">
|
||||
<div class="col-md-2" style="padding-left:0px">
|
||||
<input class="form-control" type="text" name="quantity" id="quantity" value="{{ Request::old('quantity', $item->quantity) }}" />
|
||||
</div>
|
||||
{!! $errors->first('quantity', '<span class="alert-msg"><i class="fas fa-times"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input type="hidden" name="pivot_id" value="{{$item->id}}">
|
||||
{{-- <input class="form-control" type="text" name="quantity" id="quantity" value="{{ Request::old('quantity', $item->quantity) }}" /> --}}
|
||||
|
||||
@stop
|
80
SNIPE-IT/resources/views/layouts/basic.blade.php
Normal file
80
SNIPE-IT/resources/views/layouts/basic.blade.php
Normal file
@ -0,0 +1,80 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
|
||||
|
||||
<head>
|
||||
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>{{ ($snipeSettings) && ($snipeSettings->site_name) ? $snipeSettings->site_name : 'Snipe-IT' }}</title>
|
||||
|
||||
<link rel="shortcut icon" type="image/ico" href="{{ ($snipeSettings) && ($snipeSettings->favicon!='') ? Storage::disk('public')->url(e($snipeSettings->favicon)) : config('app.url').'/favicon.ico' }}">
|
||||
{{-- stylesheets --}}
|
||||
<link rel="stylesheet" href="{{ url(mix('css/dist/all.css')) }}">
|
||||
|
||||
<script nonce="{{ csrf_token() }}">
|
||||
window.snipeit = {
|
||||
settings: {
|
||||
"per_page": 50
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@livewireStyles
|
||||
|
||||
|
||||
@if (($snipeSettings) && ($snipeSettings->header_color))
|
||||
<style>
|
||||
.main-header .navbar, .main-header .logo {
|
||||
background-color: {{ $snipeSettings->header_color }};
|
||||
background: -webkit-linear-gradient(top, {{ $snipeSettings->header_color }} 0%,{{ $snipeSettings->header_color }} 100%);
|
||||
background: linear-gradient(to bottom, {{ $snipeSettings->header_color }} 0%,{{ $snipeSettings->header_color }} 100%);
|
||||
border-color: {{ $snipeSettings->header_color }};
|
||||
}
|
||||
.skin-blue .sidebar-menu > li:hover > a, .skin-blue .sidebar-menu > li.active > a {
|
||||
border-left-color: {{ $snipeSettings->header_color }};
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
background-color: {{ $snipeSettings->header_color }};
|
||||
border-color: {{ $snipeSettings->header_color }};
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
@endif
|
||||
|
||||
@if (($snipeSettings) && ($snipeSettings->custom_css))
|
||||
<style>
|
||||
{!! $snipeSettings->show_custom_css() !!}
|
||||
</style>
|
||||
@endif
|
||||
|
||||
</head>
|
||||
|
||||
<body class="hold-transition login-page">
|
||||
|
||||
@if (($snipeSettings) && ($snipeSettings->logo!=''))
|
||||
<center>
|
||||
<a href="{{ config('app.url') }}"><img id="login-logo" src="{{ Storage::disk('public')->url('').e($snipeSettings->logo) }}"></a>
|
||||
</center>
|
||||
@endif
|
||||
<!-- Content -->
|
||||
@yield('content')
|
||||
|
||||
|
||||
|
||||
<div class="text-center" style="padding-top: 100px;">
|
||||
@if (($snipeSettings) && ($snipeSettings->privacy_policy_link!=''))
|
||||
<a target="_blank" rel="noopener" href="{{ $snipeSettings->privacy_policy_link }}" target="_new">{{ trans('admin/settings/general.privacy_policy') }}</a>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
{{-- Javascript files --}}
|
||||
<script src="{{ url(mix('js/dist/all.js')) }}" nonce="{{ csrf_token() }}"></script>
|
||||
|
||||
|
||||
@stack('js')
|
||||
@livewireScripts
|
||||
</body>
|
||||
|
||||
</html>
|
15
SNIPE-IT/resources/views/layouts/debug.blade.php
Normal file
15
SNIPE-IT/resources/views/layouts/debug.blade.php
Normal file
@ -0,0 +1,15 @@
|
||||
@extends('layouts/basic')
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
|
||||
<pre>
|
||||
<?php print_r($data); ?>
|
||||
</pre>
|
||||
|
||||
@stop
|
1116
SNIPE-IT/resources/views/layouts/default.blade.php
Normal file
1116
SNIPE-IT/resources/views/layouts/default.blade.php
Normal file
File diff suppressed because it is too large
Load Diff
79
SNIPE-IT/resources/views/layouts/edit-form.blade.php
Normal file
79
SNIPE-IT/resources/views/layouts/edit-form.blade.php
Normal file
@ -0,0 +1,79 @@
|
||||
@extends('layouts.default')
|
||||
|
||||
{{-- Page title --}}
|
||||
@section('title')
|
||||
@if ($item->id)
|
||||
{{ $updateText }}
|
||||
@else
|
||||
{{ $createText }}
|
||||
@endif
|
||||
@parent
|
||||
@stop
|
||||
|
||||
@section('header_right')
|
||||
<a href="{{ URL::previous() }}" class="btn btn-primary pull-right">
|
||||
{{ trans('general.back') }}</a>
|
||||
@stop
|
||||
|
||||
|
||||
|
||||
{{-- Page content --}}
|
||||
|
||||
@section('content')
|
||||
|
||||
<!-- row -->
|
||||
<div class="row">
|
||||
<!-- col-md-8 -->
|
||||
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1 col-sm-12 col-sm-offset-0">
|
||||
|
||||
<form id="create-form" class="form-horizontal" method="post" action="{{ (isset($formAction)) ? $formAction : \Request::url() }}" autocomplete="off" role="form" enctype="multipart/form-data">
|
||||
|
||||
<!-- box -->
|
||||
<div class="box box-default">
|
||||
<!-- box-header -->
|
||||
<div class="box-header with-border">
|
||||
|
||||
@if ((isset($topSubmit) && ($topSubmit=='true')) || (isset($item->id)))
|
||||
|
||||
<div class="col-md-12 box-title text-right" style="padding: 0px; margin: 0px;">
|
||||
<div class="col-md-9 text-left">
|
||||
@if ($item->id)
|
||||
<h2 class="box-title" style="padding-top: 8px; padding-bottom: 7px;">
|
||||
{{ $item->display_name }}
|
||||
</h2>
|
||||
@endif
|
||||
</div>
|
||||
@if (isset($topSubmit) && ($topSubmit=='true'))
|
||||
<div class="col-md-3 text-right" style="padding-right: 10px;">
|
||||
<button type="submit" class="btn btn-primary pull-right">
|
||||
<i class="fas fa-check icon-white" aria-hidden="true"></i>
|
||||
{{ trans('general.save') }}
|
||||
</button>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div><!-- /.box-header -->
|
||||
@endif
|
||||
|
||||
<!-- box-body -->
|
||||
<div class="box-body">
|
||||
|
||||
<div style="padding-top: 30px;">
|
||||
@if ($item->id)
|
||||
{{ method_field('PUT') }}
|
||||
@endif
|
||||
|
||||
<!-- CSRF Token -->
|
||||
{{ csrf_field() }}
|
||||
@yield('inputFields')
|
||||
@include('partials.forms.edit.submit')
|
||||
</div>
|
||||
|
||||
</div> <!-- ./box-body -->
|
||||
</div> <!-- box -->
|
||||
</form>
|
||||
</div> <!-- col-md-8 -->
|
||||
|
||||
</div><!-- ./row -->
|
||||
|
||||
@stop
|
132
SNIPE-IT/resources/views/layouts/setup.blade.php
Normal file
132
SNIPE-IT/resources/views/layouts/setup.blade.php
Normal file
@ -0,0 +1,132 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
|
||||
<html>
|
||||
<head>
|
||||
<title>
|
||||
@section('title')
|
||||
Snipe-IT {{ trans('general.setup') }}
|
||||
@show
|
||||
</title>
|
||||
<link rel="stylesheet" href="{{ url(mix('css/dist/all.css')) }}">
|
||||
|
||||
|
||||
|
||||
<script nonce="{{ csrf_token() }}">
|
||||
window.snipeit = {
|
||||
settings: {
|
||||
"per_page": 20
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
<style>
|
||||
td, th {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.preflight-success {
|
||||
color: green;
|
||||
}
|
||||
|
||||
.preflight-error {
|
||||
color: red;
|
||||
}
|
||||
|
||||
.preflight-warning {
|
||||
color: orange;
|
||||
}
|
||||
|
||||
.page-header {
|
||||
font-size: 280%;
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: 250%;
|
||||
}
|
||||
|
||||
.alert {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-10 col-lg-offset-1">
|
||||
<h1 class="page-header">Snipe-IT {{ trans('general.pre_flight') }}</h1>
|
||||
</div>
|
||||
<div class="col-lg-11 col-lg-offset-1">
|
||||
|
||||
<div class="row bs-wizard" style="border-bottom:0;">
|
||||
|
||||
<div class="col-xs-3 bs-wizard-step {{ ($step > 1) ? 'complete':'active' }}">
|
||||
<div class="text-center bs-wizard-stepnum">{{ trans('general.setup_step_1') }}</div>
|
||||
<div class="progress"><div class="progress-bar"></div></div>
|
||||
<a href="{{ route('setup') }}" class="bs-wizard-dot"></a>
|
||||
<div class="bs-wizard-info text-center">{{ trans('general.setup_config_check') }}</div>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-3 bs-wizard-step {{ ($step == 2) ? 'active': (($step < 2) ? 'disabled' : 'complete') }}"><!-- complete -->
|
||||
<div class="text-center bs-wizard-stepnum">{{ trans('general.setup_step_2') }}</div>
|
||||
<div class="progress"><div class="progress-bar"></div></div>
|
||||
<a href="{{ route('setup.migrate') }}" class="bs-wizard-dot"></a>
|
||||
<div class="bs-wizard-info text-center">{{ trans('general.setup_create_database') }}</div>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-3 bs-wizard-step {{ ($step == 3) ? 'active': (($step < 3) ? 'disabled' : 'complete') }}"><!-- complete -->
|
||||
<div class="text-center bs-wizard-stepnum">{{ trans('general.setup_step_3') }}</div>
|
||||
<div class="progress"><div class="progress-bar"></div></div>
|
||||
<a href="{{ route('setup.user') }}" class="bs-wizard-dot"></a>
|
||||
<div class="bs-wizard-info text-center">{{ trans('general.setup_create_admin') }}</div>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-3 bs-wizard-step {{ ($step == 4) ? 'active': (($step < 4) ? 'disabled' : 'complete') }}"><!-- active -->
|
||||
<div class="text-center bs-wizard-stepnum">{{ trans('general.setup_step_4') }}</div>
|
||||
<div class="progress"><div class="progress-bar"></div></div>
|
||||
<a href="#" class="bs-wizard-dot"></a>
|
||||
<div class="bs-wizard-info text-center">{{ trans('general.setup_done') }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-10 col-lg-offset-1" style="padding-top: 50px;">
|
||||
|
||||
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
{{ $section }}
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<!-- Content -->
|
||||
@yield('content')
|
||||
</div>
|
||||
<div class="panel-footer text-right">
|
||||
@section('button')
|
||||
@show
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- Javascript files --}}
|
||||
<script src="{{ url('js/dist/all.js') }}" nonce="{{ csrf_token() }}"></script>
|
||||
|
||||
<script nonce="{{ csrf_token() }}">
|
||||
$(function () {
|
||||
$(".select2").select2();
|
||||
});
|
||||
</script>
|
||||
@section('moar_scripts')
|
||||
@show
|
||||
|
||||
</body>
|
||||
</html>
|
69
SNIPE-IT/resources/views/licenses/checkin.blade.php
Normal file
69
SNIPE-IT/resources/views/licenses/checkin.blade.php
Normal file
@ -0,0 +1,69 @@
|
||||
@extends('layouts/default')
|
||||
|
||||
{{-- Page title --}}
|
||||
@section('title')
|
||||
{{ trans('admin/licenses/general.checkin') }}
|
||||
@parent
|
||||
@stop
|
||||
|
||||
|
||||
@section('header_right')
|
||||
<a href="{{ URL::previous() }}" class="btn btn-primary pull-right">
|
||||
{{ trans('general.back') }}</a>
|
||||
@stop
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<!-- left column -->
|
||||
<div class="col-md-7">
|
||||
<form class="form-horizontal" method="post" action="{{ route('licenses.checkin.save', ['licenseId'=>$licenseSeat->id, 'backTo'=>$backto] ) }}" autocomplete="off">
|
||||
{{csrf_field()}}
|
||||
|
||||
<div class="box box-default">
|
||||
<div class="box-header with-border">
|
||||
<h2 class="box-title"> {{ $licenseSeat->license->name }}</h2>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
|
||||
<!-- license name -->
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">{{ trans('admin/hardware/form.name') }}</label>
|
||||
<div class="col-md-6">
|
||||
<p class="form-control-static">{{ $licenseSeat->license->name }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Serial -->
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">{{ trans('admin/licenses/form.license_key') }}</label>
|
||||
<div class="col-md-6">
|
||||
<p class="form-control-static">
|
||||
@can('viewKeys', $licenseSeat->license)
|
||||
{{ $licenseSeat->license->serial }}
|
||||
@else
|
||||
------------
|
||||
@endcan
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Note -->
|
||||
<div class="form-group {{ $errors->has('notes') ? 'error' : '' }}">
|
||||
<label for="note" class="col-md-2 control-label">{{ trans('admin/hardware/form.notes') }}</label>
|
||||
<div class="col-md-7">
|
||||
<textarea class="col-md-6 form-control" id="notes" name="notes"></textarea>
|
||||
{!! $errors->first('notes', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
<a class="btn btn-link" href="{{ route('licenses.index') }}">{{ trans('button.cancel') }}</a>
|
||||
<button type="submit" class="btn btn-primary pull-right"><i class="fas fa-check icon-white" aria-hidden="true"></i> {{ trans('general.checkin') }}</button>
|
||||
</div>
|
||||
</div> <!-- /.box-->
|
||||
</form>
|
||||
</div> <!-- /.col-md-7-->
|
||||
</div>
|
||||
|
||||
|
||||
@stop
|
117
SNIPE-IT/resources/views/licenses/checkout.blade.php
Normal file
117
SNIPE-IT/resources/views/licenses/checkout.blade.php
Normal file
@ -0,0 +1,117 @@
|
||||
@extends('layouts/default')
|
||||
|
||||
{{-- Page title --}}
|
||||
@section('title')
|
||||
{{ trans('admin/licenses/general.checkout') }}
|
||||
@parent
|
||||
@stop
|
||||
|
||||
@section('header_right')
|
||||
<a href="{{ URL::previous() }}" class="btn btn-primary pull-right">
|
||||
{{ trans('general.back') }}</a>
|
||||
@stop
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<!-- left column -->
|
||||
<div class="col-md-7">
|
||||
<form class="form-horizontal" method="post" action="" autocomplete="off">
|
||||
{{csrf_field()}}
|
||||
|
||||
<div class="box box-default">
|
||||
<div class="box-header with-border">
|
||||
<h2 class="box-title"> {{ $license->name }} ({{ trans('admin/licenses/message.seats_available', ['seat_count' => $license->availCount()->count()]) }})</h2>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
|
||||
|
||||
<!-- Asset name -->
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">{{ trans('admin/hardware/form.name') }}</label>
|
||||
<div class="col-md-9">
|
||||
<p class="form-control-static">{{ $license->name }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Category -->
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">{{ trans('general.category') }}</label>
|
||||
<div class="col-md-9">
|
||||
<p class="form-control-static">{{ $license->category->name }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Serial -->
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">{{ trans('admin/licenses/form.license_key') }}</label>
|
||||
<div class="col-md-9">
|
||||
<p class="form-control-static" style="word-wrap: break-word;">
|
||||
@can('viewKeys', $license)
|
||||
{{ $license->serial }}
|
||||
@else
|
||||
------------
|
||||
@endcan
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@include ('partials.forms.checkout-selector', ['user_select' => 'true','asset_select' => 'true', 'location_select' => 'false'])
|
||||
|
||||
@include ('partials.forms.edit.user-select', ['translated_name' => trans('general.user'), 'fieldname' => 'assigned_to', 'required'=>'true'])
|
||||
|
||||
@include ('partials.forms.edit.asset-select', ['translated_name' => trans('admin/licenses/form.asset'), 'fieldname' => 'asset_id', 'style' => 'display:none;'])
|
||||
|
||||
|
||||
<!-- Note -->
|
||||
<div class="form-group {{ $errors->has('notes') ? 'error' : '' }}">
|
||||
<label for="note" class="col-md-3 control-label">{{ trans('admin/hardware/form.notes') }}</label>
|
||||
<div class="col-md-8">
|
||||
<textarea class="col-md-6 form-control" id="notes" name="notes" style="width: 100%">{{ old('note') }}</textarea>
|
||||
{!! $errors->first('note', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@if ($license->requireAcceptance() || $license->getEula() || ($snipeSettings->webhook_endpoint!=''))
|
||||
<div class="form-group notification-callout">
|
||||
<div class="col-md-8 col-md-offset-3">
|
||||
<div class="callout callout-info">
|
||||
|
||||
@if ($license->requireAcceptance())
|
||||
<i class="far fa-envelope"></i>
|
||||
{{ trans('admin/categories/general.required_acceptance') }}
|
||||
<br>
|
||||
@endif
|
||||
|
||||
@if ($license->getEula())
|
||||
<i class="far fa-envelope"></i>
|
||||
{{ trans('admin/categories/general.required_eula') }}
|
||||
<br>
|
||||
@endif
|
||||
|
||||
@if (($license->category) && ($license->category->checkin_email))
|
||||
<i class="far fa-envelope"></i>
|
||||
{{ trans('admin/categories/general.checkin_email_notification') }}
|
||||
<br>
|
||||
@endif
|
||||
|
||||
@if ($snipeSettings->webhook_endpoint!='')
|
||||
<i class="fab fa-slack"></i>
|
||||
{{ trans('general.webhook_msg_note') }}
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="box-footer">
|
||||
<a class="btn btn-link" href="{{ route('licenses.index') }}">{{ trans('button.cancel') }}</a>
|
||||
<button type="submit" class="btn btn-primary pull-right"><i class="fas fa-check icon-white" aria-hidden="true"></i> {{ trans('general.checkout') }}</button>
|
||||
</div>
|
||||
</div> <!-- /.box-->
|
||||
</form>
|
||||
</div> <!-- /.col-md-7-->
|
||||
</div>
|
||||
|
||||
@stop
|
130
SNIPE-IT/resources/views/licenses/edit.blade.php
Normal file
130
SNIPE-IT/resources/views/licenses/edit.blade.php
Normal file
@ -0,0 +1,130 @@
|
||||
@extends('layouts/edit-form', [
|
||||
'createText' => trans('admin/licenses/form.create'),
|
||||
'updateText' => trans('admin/licenses/form.update'),
|
||||
'topSubmit' => true,
|
||||
'formAction' => ($item->id) ? route('licenses.update', ['license' => $item->id]) : route('licenses.store'),
|
||||
])
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('inputFields')
|
||||
@include ('partials.forms.edit.name', ['translated_name' => trans('admin/licenses/form.name')])
|
||||
@include ('partials.forms.edit.category-select', ['translated_name' => trans('admin/categories/general.category_name'), 'fieldname' => 'category_id', 'required' => 'true', 'category_type' => 'license'])
|
||||
|
||||
|
||||
<!-- Serial-->
|
||||
@can('viewKeys', $item)
|
||||
<div class="form-group {{ $errors->has('serial') ? ' has-error' : '' }}">
|
||||
<label for="serial" class="col-md-3 control-label">{{ trans('admin/licenses/form.license_key') }}</label>
|
||||
<div class="col-md-7{{ (Helper::checkIfRequired($item, 'serial')) ? ' required' : '' }}">
|
||||
<textarea class="form-control" type="text" name="serial" id="serial">{{ old('serial', $item->serial) }}</textarea>
|
||||
{!! $errors->first('serial', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
@endcan
|
||||
|
||||
|
||||
<!-- Seats -->
|
||||
<div class="form-group {{ $errors->has('seats') ? ' has-error' : '' }}">
|
||||
<label for="seats" class="col-md-3 control-label">{{ trans('admin/licenses/form.seats') }}</label>
|
||||
<div class="col-md-7 col-sm-12 required">
|
||||
<div class="col-md-2" style="padding-left:0px">
|
||||
<input class="form-control" type="text" name="seats" id="seats" value="{{ Request::old('seats', $item->seats) }}" />
|
||||
</div>
|
||||
</div>
|
||||
{!! $errors->first('seats', '<div class="col-md-8 col-md-offset-3"><span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span></div>') !!}
|
||||
</div>
|
||||
@include ('partials.forms.edit.minimum_quantity')
|
||||
|
||||
@include ('partials.forms.edit.company-select', ['translated_name' => trans('general.company'), 'fieldname' => 'company_id'])
|
||||
@include ('partials.forms.edit.manufacturer-select', ['translated_name' => trans('general.manufacturer'), 'fieldname' => 'manufacturer_id',])
|
||||
|
||||
<!-- Licensed to name -->
|
||||
<div class="form-group {{ $errors->has('license_name') ? ' has-error' : '' }}">
|
||||
<label for="license_name" class="col-md-3 control-label">{{ trans('admin/licenses/form.to_name') }}</label>
|
||||
<div class="col-md-7">
|
||||
<input class="form-control" type="text" name="license_name" id="license_name" value="{{ old('license_name', $item->license_name) }}" />
|
||||
{!! $errors->first('license_name', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Licensed to email -->
|
||||
<div class="form-group {{ $errors->has('license_email') ? ' has-error' : '' }}">
|
||||
<label for="license_email" class="col-md-3 control-label">{{ trans('admin/licenses/form.to_email') }}</label>
|
||||
<div class="col-md-7">
|
||||
<input class="form-control" type="text" name="license_email" id="license_email" value="{{ old('license_email', $item->license_email) }}" />
|
||||
{!! $errors->first('license_email', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Reassignable -->
|
||||
<div class="form-group {{ $errors->has('reassignable') ? ' has-error' : '' }}">
|
||||
<div class="col-md-3 control-label">
|
||||
<strong>{{ trans('admin/licenses/form.reassignable') }}</strong>
|
||||
</div>
|
||||
<div class="col-md-7">
|
||||
<label class="form-control">
|
||||
{{ Form::Checkbox('reassignable', '1', old('reassignable', $item->id ? $item->reassignable : '1'),array('aria-label'=>'reassignable')) }}
|
||||
{{ trans('general.yes') }}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@include ('partials.forms.edit.supplier-select', ['translated_name' => trans('general.supplier'), 'fieldname' => 'supplier_id'])
|
||||
@include ('partials.forms.edit.order_number')
|
||||
@include ('partials.forms.edit.purchase_cost')
|
||||
@include ('partials.forms.edit.purchase_date')
|
||||
|
||||
<!-- Expiration Date -->
|
||||
<div class="form-group {{ $errors->has('expiration_date') ? ' has-error' : '' }}">
|
||||
<label for="expiration_date" class="col-md-3 control-label">{{ trans('admin/licenses/form.expiration') }}</label>
|
||||
|
||||
<div class="input-group col-md-4">
|
||||
<div class="input-group date" data-provide="datepicker" data-date-format="yyyy-mm-dd" data-autoclose="true" data-date-clear-btn="true">
|
||||
<input type="text" class="form-control" placeholder="{{ trans('general.select_date') }}" name="expiration_date" id="expiration_date" value="{{ old('expiration_date', ($item->expiration_date) ? $item->expiration_date->format('Y-m-d') : '') }}" maxlength="10">
|
||||
<span class="input-group-addon"><i class="fas fa-calendar" aria-hidden="true"></i></span>
|
||||
</div>
|
||||
{!! $errors->first('expiration_date', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Termination Date -->
|
||||
<div class="form-group {{ $errors->has('termination_date') ? ' has-error' : '' }}">
|
||||
<label for="termination_date" class="col-md-3 control-label">{{ trans('admin/licenses/form.termination_date') }}</label>
|
||||
|
||||
<div class="input-group col-md-4">
|
||||
<div class="input-group date" data-provide="datepicker" data-date-format="yyyy-mm-dd" data-autoclose="true" data-date-clear-btn="true">
|
||||
<input type="text" class="form-control" placeholder="{{ trans('general.select_date') }}" name="termination_date" id="termination_date" value="{{ old('termination_date', ($item->termination_date) ? $item->termination_date->format('Y-m-d') : '') }}" maxlength="10">
|
||||
<span class="input-group-addon"><i class="fas fa-calendar" aria-hidden="true"></i></span>
|
||||
</div>
|
||||
{!! $errors->first('termination_date', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- @TODO How does this differ from Order #? --}}
|
||||
<!-- Purchase Order -->
|
||||
<div class="form-group {{ $errors->has('purchase_order') ? ' has-error' : '' }}">
|
||||
<label for="purchase_order" class="col-md-3 control-label">{{ trans('admin/licenses/form.purchase_order') }}</label>
|
||||
<div class="col-md-3">
|
||||
<input class="form-control" type="text" name="purchase_order" id="purchase_order" value="{{ old('purchase_order', $item->purchase_order) }}" />
|
||||
{!! $errors->first('purchase_order', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@include ('partials.forms.edit.depreciation')
|
||||
|
||||
<!-- Maintained -->
|
||||
<div class="form-group {{ $errors->has('maintained') ? ' has-error' : '' }}">
|
||||
<div class="col-md-3 control-label"><strong>{{ trans('admin/licenses/form.maintained') }}</strong></div>
|
||||
<div class="col-md-7">
|
||||
<label class="form-control">
|
||||
{{ Form::Checkbox('maintained', '1', old('maintained', $item->maintained),array('aria-label'=>'maintained')) }}
|
||||
{{ trans('general.yes') }}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@include ('partials.forms.edit.notes')
|
||||
|
||||
@stop
|
61
SNIPE-IT/resources/views/licenses/index.blade.php
Normal file
61
SNIPE-IT/resources/views/licenses/index.blade.php
Normal file
@ -0,0 +1,61 @@
|
||||
@extends('layouts/default')
|
||||
|
||||
{{-- Page title --}}
|
||||
@section('title')
|
||||
{{ trans('admin/licenses/general.software_licenses') }}
|
||||
@parent
|
||||
@stop
|
||||
|
||||
|
||||
@section('header_right')
|
||||
@can('create', \App\Models\License::class)
|
||||
<a href="{{ route('licenses.create') }}" accesskey="n" class="btn btn-primary pull-right">
|
||||
{{ trans('general.create') }}
|
||||
</a>
|
||||
@endcan
|
||||
@stop
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="box">
|
||||
<div class="box-body">
|
||||
|
||||
<table
|
||||
data-columns="{{ \App\Presenters\LicensePresenter::dataTableLayout() }}"
|
||||
data-cookie-id-table="licensesTable"
|
||||
data-pagination="true"
|
||||
data-search="true"
|
||||
data-side-pagination="server"
|
||||
data-show-columns="true"
|
||||
data-show-fullscreen="true"
|
||||
data-show-export="true"
|
||||
data-show-footer="true"
|
||||
data-show-refresh="true"
|
||||
data-sort-order="asc"
|
||||
data-sort-name="name"
|
||||
id="licensesTable"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{ route('api.licenses.index') }}"
|
||||
data-export-options='{
|
||||
"fileName": "export-licenses-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'>
|
||||
</table>
|
||||
|
||||
</div><!-- /.box-body -->
|
||||
|
||||
<div class="box-footer clearfix">
|
||||
</div>
|
||||
</div><!-- /.box -->
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
||||
|
||||
@section('moar_scripts')
|
||||
@include ('partials.bootstrap-table')
|
||||
|
||||
@stop
|
716
SNIPE-IT/resources/views/licenses/view.blade.php
Normal file
716
SNIPE-IT/resources/views/licenses/view.blade.php
Normal file
@ -0,0 +1,716 @@
|
||||
@extends('layouts/default')
|
||||
|
||||
{{-- Page title --}}
|
||||
@section('title')
|
||||
{{ trans('admin/licenses/general.view') }}
|
||||
- {{ $license->name }}
|
||||
@parent
|
||||
@stop
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col-md-9">
|
||||
|
||||
<!-- Custom Tabs -->
|
||||
<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" aria-hidden="true"></i>
|
||||
</span>
|
||||
<span class="hidden-xs hidden-sm">{{ trans('admin/users/general.info') }}</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="#seats" data-toggle="tab">
|
||||
<span class="hidden-lg hidden-md">
|
||||
<i class="far fa-list-alt fa-2x" aria-hidden="true"></i>
|
||||
</span>
|
||||
<span class="hidden-xs hidden-sm">{{ trans('admin/licenses/form.seats') }}</span>
|
||||
<span class="badge badge-secondary">{{ number_format($license->availCount()->count()) }} / {{ number_format($license->seats) }}</span>
|
||||
|
||||
</a>
|
||||
</li>
|
||||
|
||||
@can('licenses.files', $license)
|
||||
<li>
|
||||
<a href="#files" data-toggle="tab">
|
||||
<span class="hidden-lg hidden-md">
|
||||
<i class="far fa-file fa-2x" aria-hidden="true"></i></span>
|
||||
<span class="hidden-xs hidden-sm">{{ trans('general.file_uploads') }}
|
||||
{!! ($license->uploads->count() > 0 ) ? '<badge class="badge badge-secondary">'.number_format($license->uploads->count()).'</badge>' : '' !!}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
@endcan
|
||||
|
||||
<li>
|
||||
<a href="#history" data-toggle="tab">
|
||||
<span class="hidden-lg hidden-md">
|
||||
<i class="fas fa-history fa-2x" aria-hidden="true"></i></span>
|
||||
<span class="hidden-xs hidden-sm">{{ trans('general.history') }}</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
@can('update', \App\Models\License::class)
|
||||
<li class="pull-right"><a href="#" data-toggle="modal" data-target="#uploadFileModal">
|
||||
<i class="fas fa-paperclip" aria-hidden="true"></i> {{ trans('button.upload') }}</a>
|
||||
</li>
|
||||
@endcan
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
|
||||
<div class="tab-pane active" id="details">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="container row-new-striped">
|
||||
|
||||
@if (!is_null($license->company))
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<strong>{{ trans('general.company') }}</strong>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
<a href="{{ route('companies.show', $license->company->id) }}">{{ $license->company->name }}</a>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if ($license->manufacturer)
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<strong>{{ trans('admin/hardware/form.manufacturer') }}</strong>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
@can('view', \App\Models\Manufacturer::class)
|
||||
<a href="{{ route('manufacturers.show', $license->manufacturer->id) }}">
|
||||
{{ $license->manufacturer->name }}
|
||||
</a>
|
||||
@else
|
||||
{{ $license->manufacturer->name }}
|
||||
@endcan
|
||||
|
||||
@if ($license->manufacturer->url)
|
||||
<br><i class="fas fa-globe-americas" aria-hidden="true"></i> <a href="{{ $license->manufacturer->url }}" rel="noopener">{{ $license->manufacturer->url }}</a>
|
||||
@endif
|
||||
|
||||
@if ($license->manufacturer->support_url)
|
||||
<br><i class="far fa-life-ring" aria-hidden="true"></i>
|
||||
<a href="{{ $license->manufacturer->support_url }}" rel="noopener">{{ $license->manufacturer->support_url }}</a>
|
||||
@endif
|
||||
|
||||
@if ($license->manufacturer->support_phone)
|
||||
<br><i class="fas fa-phone" aria-hidden="true"></i>
|
||||
<a href="tel:{{ $license->manufacturer->support_phone }}">{{ $license->manufacturer->support_phone }}</a>
|
||||
@endif
|
||||
|
||||
@if ($license->manufacturer->support_email)
|
||||
<br><i class="far fa-envelope" aria-hidden="true"></i> <a href="mailto:{{ $license->manufacturer->support_email }}">{{ $license->manufacturer->support_email }}</a>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
|
||||
@if (!is_null($license->serial))
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<strong>{{ trans('admin/licenses/form.license_key') }}</strong>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
@can('viewKeys', $license)
|
||||
<span class="js-copy">{!! nl2br(e($license->serial)) !!}</span>
|
||||
<i class="fa-regular fa-clipboard js-copy-link" data-clipboard-target=".js-copy" aria-hidden="true" data-tooltip="true" data-placement="top" title="{{ trans('general.copy_to_clipboard') }}">
|
||||
<span class="sr-only">{{ trans('general.copy_to_clipboard') }}</span>
|
||||
</i>
|
||||
@else
|
||||
------------
|
||||
@endcan
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
|
||||
@if ($license->category)
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<strong>{{ trans('general.category') }}</strong>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
<a href="{{ route('categories.show', $license->category->id) }}">{{ $license->category->name }}</a>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
|
||||
@if ($license->license_name!='')
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<strong>{{ trans('admin/licenses/form.to_name') }}</strong>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
{{ $license->license_name }}
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if ($license->license_email!='')
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<strong>
|
||||
{{ trans('admin/licenses/form.to_email') }}
|
||||
</strong>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
{{ $license->license_email }}
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
|
||||
@if ($license->supplier)
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<strong>{{ trans('general.supplier') }}</strong>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
@can('view', \App\Models\Supplier::class)
|
||||
<a href="{{ route('suppliers.show', $license->supplier->id) }}">
|
||||
{{ $license->supplier->name }}
|
||||
</a>
|
||||
@else
|
||||
{{ $license->supplier->name }}
|
||||
@endcan
|
||||
|
||||
@if ($license->supplier->url)
|
||||
<br><i class="fas fa-globe-americas" aria-hidden="true"></i> <a href="{{ $license->supplier->url }}" rel="noopener">{{ $license->supplier->url }}</a>
|
||||
@endif
|
||||
|
||||
@if ($license->supplier->phone)
|
||||
<br><i class="fas fa-phone" aria-hidden="true"></i>
|
||||
<a href="tel:{{ $license->supplier->phone }}">{{ $license->supplier->phone }}</a>
|
||||
@endif
|
||||
|
||||
@if ($license->supplier->email)
|
||||
<br><i class="far fa-envelope" aria-hidden="true"></i> <a href="mailto:{{ $license->supplier->email }}">{{ $license->supplier->email }}</a>
|
||||
@endif
|
||||
|
||||
@if ($license->supplier->address)
|
||||
<br>{{ $license->supplier->address }}
|
||||
@endif
|
||||
@if ($license->supplier->address2)
|
||||
<br>{{ $license->supplier->address2 }}
|
||||
@endif
|
||||
@if ($license->supplier->city)
|
||||
<br>{{ $license->supplier->city }},
|
||||
@endif
|
||||
@if ($license->supplier->state)
|
||||
{{ $license->supplier->state }}
|
||||
@endif
|
||||
@if ($license->supplier->country)
|
||||
{{ $license->supplier->country }}
|
||||
@endif
|
||||
@if ($license->supplier->zip)
|
||||
{{ $license->supplier->zip }}
|
||||
@endif
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@else
|
||||
{{ trans('general.deleted') }}
|
||||
@endif
|
||||
|
||||
|
||||
@if (isset($license->expiration_date))
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<strong>
|
||||
{{ trans('admin/licenses/form.expiration') }}
|
||||
</strong>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
{{ Helper::getFormattedDateObject($license->expiration_date, 'date', false) }}
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if ($license->termination_date)
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<strong>
|
||||
{{ trans('admin/licenses/form.termination_date') }}
|
||||
</strong>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
{{ Helper::getFormattedDateObject($license->termination_date, 'date', false) }}
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
|
||||
@if ($license->depreciation)
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<strong>
|
||||
{{ trans('admin/hardware/form.depreciation') }}
|
||||
</strong>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
{{ $license->depreciation->name }}
|
||||
({{ $license->depreciation->months }}
|
||||
{{ trans('admin/hardware/form.months') }}
|
||||
)
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<strong>
|
||||
{{ trans('admin/hardware/form.depreciates_on') }}
|
||||
</strong>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
{{ Helper::getFormattedDateObject($license->depreciated_date(), 'date', false) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<strong>
|
||||
{{ trans('admin/hardware/form.fully_depreciated') }}
|
||||
</strong>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
@if ($license->time_until_depreciated()->y > 0)
|
||||
{{ $license->time_until_depreciated()->y }}
|
||||
{{ trans('admin/hardware/form.years') }},
|
||||
@endif
|
||||
{{ $license->time_until_depreciated()->m }}
|
||||
{{ trans('admin/hardware/form.months') }}
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if ($license->purchase_order)
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<strong>
|
||||
{{ trans('admin/licenses/form.purchase_order') }}
|
||||
</strong>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
{{ $license->purchase_order }}
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
|
||||
@if (isset($license->purchase_date))
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<strong>{{ trans('general.purchase_date') }}</strong>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
{{ Helper::getFormattedDateObject($license->purchase_date, 'date', false) }}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if ($license->purchase_cost > 0)
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<strong>
|
||||
{{ trans('general.purchase_cost') }}
|
||||
</strong>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
{{ $snipeSettings->default_currency }}
|
||||
{{ Helper::formatCurrencyOutput($license->purchase_cost) }}
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if ($license->order_number)
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<strong>
|
||||
{{ trans('general.order_number') }}
|
||||
</strong>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
{{ $license->order_number }}
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<strong>
|
||||
{{ trans('admin/licenses/form.maintained') }}
|
||||
</strong>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
{!! $license->maintained ? '<i class="fas fa-check fa-fw text-success" aria-hidden="true"></i> '.trans('general.yes') : '<i class="fas fa-times fa-fw text-danger" aria-hidden="true"></i> '.trans('general.no') !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if (($license->seats) && ($license->seats) > 0)
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<strong>
|
||||
{{ trans('admin/licenses/form.seats') }}
|
||||
</strong>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
|
||||
@if ($license->remaincount() <= ($license->min_amt - \App\Models\Setting::getSettings()->alert_threshold))
|
||||
<span data-tooltip="true" title="{{ trans('admin/licenses/general.below_threshold', ['remaining_count' => $license->remaincount(), 'min_amt' => $license->min_amt]) }}"><i class="fas fa-exclamation-triangle text-danger" aria-hidden="true"></i>
|
||||
<span class="sr-only">{{ trans('general.warning') }}</span>
|
||||
</span>
|
||||
@endif
|
||||
|
||||
{{ $license->seats }}
|
||||
@if ($license->remaincount() <= ($license->min_amt - \App\Models\Setting::getSettings()->alert_threshold))
|
||||
|
||||
@endif
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<strong>
|
||||
{{ trans('admin/licenses/form.reassignable') }}
|
||||
</strong>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
{!! $license->reassignable ? '<i class="fas fa-check fa-fw text-success" aria-hidden="true"></i> '.trans('general.yes') : '<i class="fas fa-times fa-fw text-danger" aria-hidden="true"></i> '.trans('general.no') !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@if ($license->notes)
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<strong>
|
||||
{{ trans('general.notes') }}
|
||||
</strong>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
{!! nl2br(Helper::parseEscapedMarkedownInline($license->notes)) !!}
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
</div> <!-- end row-striped -->
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div> <!-- end tab-pane -->
|
||||
|
||||
|
||||
|
||||
<div class="tab-pane" id="seats">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<div class="table-responsive">
|
||||
|
||||
<table
|
||||
data-columns="{{ \App\Presenters\LicensePresenter::dataTableLayoutSeats() }}"
|
||||
data-cookie-id-table="seatsTable"
|
||||
data-id-table="seatsTable"
|
||||
id="seatsTable"
|
||||
data-pagination="true"
|
||||
data-search="false"
|
||||
data-side-pagination="server"
|
||||
data-show-columns="true"
|
||||
data-show-fullscreen="true"
|
||||
data-show-export="true"
|
||||
data-show-refresh="true"
|
||||
data-sort-order="asc"
|
||||
data-sort-name="name"
|
||||
class="table table-striped snipe-table"
|
||||
data-url="{{ route('api.licenses.seats.index', $license->id) }}"
|
||||
data-export-options='{
|
||||
"fileName": "export-seats-{{ str_slug($license->name) }}-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div> <!--/.row-->
|
||||
</div> <!-- /.tab-pane -->
|
||||
|
||||
@can('licenses.files', $license)
|
||||
<div class="tab-pane" id="files">
|
||||
<div class="table-responsive">
|
||||
<table
|
||||
data-cookie-id-table="licenseUploadsTable"
|
||||
data-id-table="licenseUploadsTable"
|
||||
id="licenseUploadsTable"
|
||||
data-search="true"
|
||||
data-pagination="true"
|
||||
data-side-pagination="client"
|
||||
data-show-columns="true"
|
||||
data-show-export="true"
|
||||
data-show-footer="true"
|
||||
data-toolbar="#upload-toolbar"
|
||||
data-show-refresh="true"
|
||||
data-sort-order="asc"
|
||||
data-sort-name="name"
|
||||
class="table table-striped snipe-table"
|
||||
data-export-options='{
|
||||
"fileName": "export-license-uploads-{{ str_slug($license->name) }}-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","delete","download","icon"]
|
||||
}'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-visible="true" data-field="icon" data-sortable="true">{{trans('general.file_type')}}</th>
|
||||
<th class="col-md-2" data-searchable="true" data-visible="true" data-field="image">{{ trans('general.image') }}</th>
|
||||
<th class="col-md-2" data-searchable="true" data-visible="true" data-field="filename" data-sortable="true">{{ trans('general.file_name') }}</th>
|
||||
<th class="col-md-1" data-searchable="true" data-visible="true" data-field="filesize">{{ trans('general.filesize') }}</th>
|
||||
<th class="col-md-2" data-searchable="true" data-visible="true" data-field="notes" data-sortable="true">{{ trans('general.notes') }}</th>
|
||||
<th class="col-md-1" data-searchable="true" data-visible="true" data-field="download">{{ trans('general.download') }}</th>
|
||||
<th class="col-md-2" data-searchable="true" data-visible="true" data-field="created_at" data-sortable="true">{{ trans('general.created_at') }}</th>
|
||||
<th class="col-md-1" data-searchable="true" data-visible="true" data-field="actions">{{ trans('table.actions') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if ($license->uploads->count() > 0)
|
||||
@foreach ($license->uploads as $file)
|
||||
<tr>
|
||||
<td>
|
||||
<i class="{{ Helper::filetype_icon($file->filename) }} icon-med" aria-hidden="true"></i>
|
||||
<span class="sr-only">{{ Helper::filetype_icon($file->filename) }}</span>
|
||||
|
||||
</td>
|
||||
<td>
|
||||
@if ($file->filename)
|
||||
@if ((Storage::exists('private_uploads/licenses/'.$file->filename)) && ( Helper::checkUploadIsImage($file->get_src('licenses'))))
|
||||
<a href="{{ route('show.licensefile', ['licenseId' => $license->id, 'fileId' => $file->id, 'download' => 'false']) }}" data-toggle="lightbox" data-type="image"><img src="{{ route('show.licensefile', ['licenseId' => $license->id, 'fileId' => $file->id]) }}" class="img-thumbnail" style="max-width: 50px;"></a>
|
||||
@endif
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if (Storage::exists('private_uploads/licenses/'.$file->filename))
|
||||
{{ $file->filename }}
|
||||
@else
|
||||
<del>{{ $file->filename }}</del>
|
||||
@endif
|
||||
</td>
|
||||
<td data-value="{{ (Storage::exists('private_uploads/licenses/'.$file->filename)) ? Storage::size('private_uploads/licenses/'.$file->filename) : '' }}">
|
||||
{{ (Storage::exists('private_uploads/licenses/'.$file->filename)) ? Helper::formatFilesizeUnits(Storage::size('private_uploads/licenses/'.$file->filename)) : '' }}
|
||||
</td>
|
||||
|
||||
<td>
|
||||
@if ($file->note)
|
||||
{{ $file->note }}
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if ($file->filename)
|
||||
<a href="{{ route('show.licensefile', [$license->id, $file->id]) }}" class="btn btn-sm btn-default">
|
||||
<i class="fas fa-download" aria-hidden="true"></i>
|
||||
<span class="sr-only">{{ trans('general.download') }}</span>
|
||||
</a>
|
||||
|
||||
<a href="{{ route('show.licensefile', [$license->id, $file->id, 'inline' => 'true']) }}" class="btn btn-sm btn-default" target="_blank">
|
||||
<i class="fa fa-external-link" aria-hidden="true"></i>
|
||||
</a>
|
||||
|
||||
@endif
|
||||
</td>
|
||||
<td>{{ $file->created_at }}</td>
|
||||
<td>
|
||||
<a class="btn delete-asset btn-danger btn-sm" href="{{ route('delete/licensefile', [$license->id, $file->id]) }}" data-content="{{ trans('general.delete_confirm', ['item' => $file->filename]) }}" data-title="{{ trans('general.delete') }}">
|
||||
<i class="fas fa-trash icon-white" aria-hidden="true"></i>
|
||||
<span class="sr-only">{{ trans('general.delete') }}</span>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@else
|
||||
<tr>
|
||||
<td colspan="8">{{ trans('general.no_results') }}</td>
|
||||
</tr>
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div> <!-- /.tab-pane -->
|
||||
@endcan
|
||||
|
||||
<div class="tab-pane" id="history">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="table-responsive">
|
||||
<table
|
||||
class="table table-striped snipe-table"
|
||||
data-cookie-id-table="licenseHistoryTable"
|
||||
data-id-table="licenseHistoryTable"
|
||||
id="licenseHistoryTable"
|
||||
data-pagination="true"
|
||||
data-show-columns="true"
|
||||
data-side-pagination="server"
|
||||
data-show-refresh="true"
|
||||
data-show-export="true"
|
||||
data-sort-order="desc"
|
||||
data-export-options='{
|
||||
"fileName": "export-{{ str_slug($license->name) }}-history-{{ date('Y-m-d') }}",
|
||||
"ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]
|
||||
}'
|
||||
data-url="{{ route('api.activity.index', ['item_id' => $license->id, 'item_type' => 'license']) }}">
|
||||
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="col-sm-2" data-visible="false" data-sortable="true" data-field="created_at" data-formatter="dateDisplayFormatter">{{ trans('general.record_created') }}</th>
|
||||
<th class="col-sm-2"data-visible="true" data-sortable="true" data-field="admin" data-formatter="usersLinkObjFormatter">{{ trans('general.admin') }}</th>
|
||||
<th class="col-sm-2" data-sortable="true" data-visible="true" data-field="action_type">{{ trans('general.action') }}</th>
|
||||
<th class="col-sm-2" data-field="file" data-visible="false" data-formatter="fileUploadNameFormatter">{{ trans('general.file_name') }}</th>
|
||||
<th class="col-sm-2" data-sortable="true" data-visible="true" data-field="item" data-formatter="polymorphicItemFormatter">{{ trans('general.item') }}</th>
|
||||
<th class="col-sm-2" data-visible="true" data-field="target" data-formatter="polymorphicItemFormatter">{{ trans('general.target') }}</th>
|
||||
<th class="col-sm-2" data-sortable="true" data-visible="true" data-field="note">{{ trans('general.notes') }}</th>
|
||||
<th class="col-sm-2" data-visible="true" data-field="action_date" data-formatter="dateDisplayFormatter">{{ trans('general.date') }}</th>
|
||||
@if ($snipeSettings->require_accept_signature=='1')
|
||||
<th class="col-md-3" data-field="signature_file" data-visible="false" data-formatter="imageFormatter">{{ trans('general.signature') }}</th>
|
||||
@endif
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div> <!-- /.col-md-12-->
|
||||
|
||||
|
||||
</div> <!-- /.row-->
|
||||
</div> <!-- /.tab-pane -->
|
||||
|
||||
</div> <!-- /.tab-content -->
|
||||
|
||||
</div> <!-- nav-tabs-custom -->
|
||||
</div> <!-- /.col -->
|
||||
<div class="col-md-3">
|
||||
|
||||
@can('update', $license)
|
||||
<a href="{{ route('licenses.edit', $license->id) }}" class="btn btn-block btn-primary" style="margin-bottom: 10px;">{{ trans('admin/licenses/general.edit') }}</a>
|
||||
<a href="{{ route('clone/license', $license->id) }}" class="btn btn-block btn-primary" style="margin-bottom: 10px;">{{ trans('admin/licenses/general.clone') }}</a>
|
||||
@endcan
|
||||
|
||||
@can('checkout', $license)
|
||||
|
||||
@if ($license->availCount()->count() > 0)
|
||||
<a href="{{ route('licenses.checkout', $license->id) }}" class="btn-block btn bg-maroon" style="margin-bottom: 10px;">
|
||||
{{ trans('general.checkout') }}
|
||||
</a>
|
||||
<a href="#" class="btn-block btn bg-maroon" style="margin-bottom: 10px;" data-toggle="modal" data-tooltip="true" title="{{ trans('admin/licenses/general.bulk.checkout_all.enabled_tooltip') }}" data-target="#checkoutFromAllModal">
|
||||
{{ trans('admin/licenses/general.bulk.checkout_all.button') }}
|
||||
</a>
|
||||
|
||||
@else
|
||||
<a href="{{ route('licenses.checkout', $license->id) }}" class="btn btn-block bg-maroon disabled" style="margin-bottom: 10px;">
|
||||
{{ trans('general.checkout') }}
|
||||
</a>
|
||||
<span data-tooltip="true" title=" {{ trans('admin/licenses/general.bulk.checkout_all.disabled_tooltip') }}">
|
||||
<a href="#" class="btn btn-block bg-maroon disabled" style="margin-bottom: 10px;" data-tooltip="true" title="{{ trans('general.checkout') }}">
|
||||
{{ trans('admin/licenses/general.bulk.checkout_all.button') }}
|
||||
</a>
|
||||
</span>
|
||||
@endif
|
||||
@endcan
|
||||
|
||||
@can('checkin', $license)
|
||||
|
||||
@if (($license->seats - $license->availCount()->count()) <= 0 )
|
||||
<span data-tooltip="true" title=" {{ trans('admin/licenses/general.bulk.checkin_all.disabled_tooltip') }}">
|
||||
<a href="#" class="btn btn-block bg-purple disabled" style="margin-bottom: 25px;">
|
||||
{{ trans('admin/licenses/general.bulk.checkin_all.button') }}
|
||||
</a>
|
||||
</span>
|
||||
@elseif (! $license->reassignable)
|
||||
<span data-tooltip="true" title=" {{ trans('admin/licenses/general.bulk.checkin_all.disabled_tooltip_reassignable') }}">
|
||||
<a href="#" class="btn btn-block bg-purple disabled" style="margin-bottom: 25px;">
|
||||
{{ trans('admin/licenses/general.bulk.checkin_all.button') }}
|
||||
</a>
|
||||
</span>
|
||||
@else
|
||||
<a href="#" class="btn btn-block bg-purple" style="margin-bottom: 25px;" data-toggle="modal" data-tooltip="true" data-target="#checkinFromAllModal" data-content="{{ trans('general.sure_to_delete') }} data-title="{{ trans('general.delete') }}" onClick="return false;">
|
||||
{{ trans('admin/licenses/general.bulk.checkin_all.button') }}
|
||||
</a>
|
||||
@endif
|
||||
@endcan
|
||||
|
||||
@can('delete', $license)
|
||||
|
||||
@if ($license->availCount()->count() == $license->seats)
|
||||
<button class="btn btn-block btn-danger delete-asset" data-toggle="modal" data-title="{{ trans('general.delete') }}" data-content="{{ trans('general.delete_confirm', ['item' => $license->name]) }}" data-target="#dataConfirmModal">
|
||||
{{ trans('general.delete') }}
|
||||
</button>
|
||||
@else
|
||||
<span data-tooltip="true" title=" {{ trans('admin/licenses/general.delete_disabled') }}">
|
||||
<a href="#" class="btn btn-block btn-danger disabled">
|
||||
{{ trans('general.delete') }}
|
||||
</a>
|
||||
</span>
|
||||
@endif
|
||||
@endcan
|
||||
</div>
|
||||
|
||||
</div> <!-- /.row -->
|
||||
|
||||
|
||||
@can('checkin', \App\Models\License::class)
|
||||
@include ('modals.confirm-action',
|
||||
[
|
||||
'modal_name' => 'checkinFromAllModal',
|
||||
'route' => route('licenses.bulkcheckin', $license->id),
|
||||
'title' => trans('general.modal_confirm_generic'),
|
||||
'body' => trans_choice('admin/licenses/general.bulk.checkin_all.modal', 2, ['checkedout_seats_count' => $checkedout_seats_count])
|
||||
])
|
||||
@endcan
|
||||
|
||||
@can('checkout', \App\Models\License::class)
|
||||
@include ('modals.confirm-action',
|
||||
[
|
||||
'modal_name' => 'checkoutFromAllModal',
|
||||
'route' => route('licenses.bulkcheckout', $license->id),
|
||||
'title' => trans('general.modal_confirm_generic'),
|
||||
'body' => trans_choice('admin/licenses/general.bulk.checkout_all.modal', 2, ['available_seats_count' => $available_seats_count])
|
||||
])
|
||||
@endcan
|
||||
|
||||
|
||||
|
||||
@can('update', \App\Models\License::class)
|
||||
@include ('modals.upload-file', ['item_type' => 'license', 'item_id' => $license->id])
|
||||
@endcan
|
||||
|
||||
@stop
|
||||
|
||||
|
||||
@section('moar_scripts')
|
||||
<script>
|
||||
|
||||
$('#dataConfirmModal').on('show.bs.modal', function (event) {
|
||||
var content = $(event.relatedTarget).data('content');
|
||||
var title = $(event.relatedTarget).data('title');
|
||||
$(this).find(".modal-body").text(content);
|
||||
$(this).find(".modal-header").text(title);
|
||||
});
|
||||
|
||||
</script>
|
||||
@include ('partials.bootstrap-table')
|
||||
@stop
|
@ -0,0 +1,61 @@
|
||||
<div>
|
||||
<!-- EULA text -->
|
||||
<div class="form-group {{ $errors->has('eula_text') ? 'error' : '' }}">
|
||||
<label for="eula_text" class="col-md-3 control-label">{{ trans('admin/categories/general.eula_text') }}</label>
|
||||
<div class="col-md-7">
|
||||
{{ Form::textarea('eula_text', null, ['wire:model' => 'eulaText', 'class' => 'form-control', 'aria-label'=>'eula_text', 'disabled' => $this->eulaTextDisabled]) }}
|
||||
<p class="help-block">{!! trans('admin/categories/general.eula_text_help') !!} </p>
|
||||
<p class="help-block">{!! trans('admin/settings/general.eula_markdown') !!} </p>
|
||||
{!! $errors->first('eula_text', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
||||
</div>
|
||||
@if ($this->eulaTextDisabled)
|
||||
<input type="hidden" name="eula_text" wire:model="eulaText" />
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<!-- Use default checkbox -->
|
||||
<div class="form-group">
|
||||
<div class="col-md-9 col-md-offset-3">
|
||||
@if ($defaultEulaText!='')
|
||||
<label class="form-control">
|
||||
{{ Form::checkbox('use_default_eula', '1', null, ['wire:model' => 'useDefaultEula', 'aria-label'=>'use_default_eula']) }}
|
||||
<span>{!! trans('admin/categories/general.use_default_eula') !!}</span>
|
||||
</label>
|
||||
@else
|
||||
<label class="form-control form-control--disabled">
|
||||
{{ Form::checkbox('use_default_eula', '0', null, ['wire:model' => 'useDefaultEula', 'class'=>'disabled','disabled' => 'disabled', 'aria-label'=>'use_default_eula']) }}
|
||||
<span>{!! trans('admin/categories/general.use_default_eula_disabled') !!}</span>
|
||||
</label>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Require Acceptance -->
|
||||
<div class="form-group">
|
||||
<div class="col-md-9 col-md-offset-3">
|
||||
<label class="form-control">
|
||||
{{ Form::checkbox('require_acceptance', '1', null, ['wire:model' => 'requireAcceptance', 'aria-label'=>'require_acceptance']) }}
|
||||
{{ trans('admin/categories/general.require_acceptance') }}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Email on Checkin -->
|
||||
<div class="form-group">
|
||||
<div class="col-md-9 col-md-offset-3">
|
||||
<label class="form-control">
|
||||
{{ Form::checkbox('checkin_email', '1', null, ['wire:model' => 'sendCheckInEmail', 'aria-label'=>'checkin_email', 'disabled' => $this->sendCheckInEmailDisabled]) }}
|
||||
{{ trans('admin/categories/general.checkin_email') }}
|
||||
</label>
|
||||
@if ($this->shouldDisplayEmailMessage)
|
||||
<div class="callout callout-info">
|
||||
<i class="far fa-envelope"></i>
|
||||
<span>{{ $this->emailMessage }}</span>
|
||||
</div>
|
||||
@endif
|
||||
@if ($this->sendCheckInEmailDisabled)
|
||||
<input type="hidden" name="checkin_email" wire:model="sendCheckInEmail" />
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,91 @@
|
||||
<span>
|
||||
|
||||
<div class="form-group{{ $errors->has('custom_fieldset') ? ' has-error' : '' }}">
|
||||
<label for="custom_fieldset" class="col-md-3 control-label">
|
||||
{{ trans('admin/models/general.fieldset') }}
|
||||
</label>
|
||||
<div class="col-md-5">
|
||||
{{ Form::select('fieldset_id', Helper::customFieldsetList(), old('fieldset_id', $fieldset_id), array('class'=>'select2 js-fieldset-field livewire-select2', 'style'=>'width:100%; min-width:350px', 'aria-label'=>'custom_fieldset', 'data-livewire-component' => $_instance->id)) }}
|
||||
{!! $errors->first('custom_fieldset', '<span class="alert-msg" aria-hidden="true"><br><i class="fas fa-times"></i> :message</span>') !!}
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label class="form-control">
|
||||
{{ Form::checkbox('add_default_values', 1, old('add_default_values', $add_default_values), ['data-livewire-component' => $_instance->id, 'id' => 'add_default_values', 'wire:model' => 'add_default_values']) }}
|
||||
{{ trans('admin/models/general.add_default_values') }}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if ($this->add_default_values ) {{-- 'if the checkbox is enabled *AND* there are more than 0 fields in the fieldsset' --}}
|
||||
@if ($fields)
|
||||
|
||||
@foreach ($fields as $field)
|
||||
<div class="form-group">
|
||||
|
||||
<label class="col-md-3 control-label{{ $errors->has($field->name) ? ' has-error' : '' }}">{{ $field->name }}</label>
|
||||
|
||||
<div class="col-md-7">
|
||||
|
||||
@if ($field->format == "DATE")
|
||||
|
||||
<div class="input-group col-md-4" style="padding-left: 0px;">
|
||||
<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.select_date') }}" name="default_values[{{ $field->id }}]" id="default-value{{ $field->id }}" value="{{ $field->defaultValue($model_id) }}">
|
||||
<span class="input-group-addon"><i class="fas fa-calendar" aria-hidden="true"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@elseif ($field->element == "text")
|
||||
|
||||
|
||||
<input class="form-control" type="text" value="{{ $field->defaultValue($model_id) }}" id="default-value{{ $field->id }}" name="default_values[{{ $field->id }}]">
|
||||
|
||||
|
||||
@elseif($field->element == "textarea")
|
||||
|
||||
|
||||
<textarea class="form-control" style="width: 100%;" id="default-value{{ $field->id }}" name="default_values[{{ $field->id }}]">{{ $field->defaultValue($model_id) }}</textarea>
|
||||
|
||||
|
||||
@elseif($field->element == "listbox")
|
||||
|
||||
|
||||
<select class="form-control" name="default_values[{{ $field->id }}]">
|
||||
<option value=""></option>
|
||||
@foreach(explode("\r\n", $field->field_values) as $field_value)
|
||||
<option value="{{$field_value}}" {{ $field->defaultValue($model_id) == $field_value ? 'selected="selected"': '' }}>{{ $field_value }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
|
||||
|
||||
@elseif($field->element == "radio")
|
||||
|
||||
@foreach(explode("\r\n", $field->field_values) as $field_value)
|
||||
<label class="col-md-3 form-control" for="{{ str_slug($field_value) }}">
|
||||
<input id="{{ str_slug($field_value) }}" aria-label="{{ str_slug($field->name) }}" type='radio' name="default_values[{{ $field->id }}]" value="{{$field_value}}" {{ $field->defaultValue($model_id) == $field_value ? 'checked="checked"': '' }} />{{ $field_value }}
|
||||
</label>
|
||||
@endforeach
|
||||
|
||||
@elseif($field->element == "checkbox")
|
||||
|
||||
@foreach(explode("\r\n", $field->field_values) as $field_value)
|
||||
<label class="col-md-3 form-control" for="{{ str_slug($field_value) }}">
|
||||
<input id="{{ str_slug($field_value) }}" type="checkbox" aria-label="{{ str_slug($field->name) }}" name="default_values[{{ $field->id }}][]" value="{{ $field_value }}"{{ in_array($field_value, explode(', ',$field->defaultValue($model_id))) ? ' checked="checked"': '' }}> {{ $field_value }}
|
||||
</label>
|
||||
@endforeach
|
||||
|
||||
|
||||
@else
|
||||
<span class="help-block form-error">
|
||||
Unknown field element: {{ $field->element }}
|
||||
</span>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endforeach
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@endif
|
||||
</span>
|
402
SNIPE-IT/resources/views/livewire/importer.blade.php
Normal file
402
SNIPE-IT/resources/views/livewire/importer.blade.php
Normal file
@ -0,0 +1,402 @@
|
||||
@section('title')
|
||||
{{ trans('general.import') }}
|
||||
@parent
|
||||
@stop
|
||||
<div>
|
||||
{{-- Livewire requires a 'master' <div>, above --}}
|
||||
<div class="row">
|
||||
|
||||
{{-- alert --}}
|
||||
@if($message != '')
|
||||
<div class="col-md-12" class="{{ $message_type }}">
|
||||
<div class="alert alert-{{ $this->message_type }}">
|
||||
<button type="button" class="close" wire:click="$set('message','')">×</button>
|
||||
@if($message_type == 'success')
|
||||
<i class="fas fa-check faa-pulse animated" aria-hidden="true"></i>
|
||||
@endif
|
||||
<strong>{{-- title --}} </strong>
|
||||
{{ $message }}
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if($import_errors)
|
||||
<div class="col-md-12">
|
||||
<div class="box">
|
||||
<div class="box-body">
|
||||
<div class="alert alert-warning">
|
||||
|
||||
<i class="fa fa-warning info" aria-hidden="true"></i> <strong>{{ trans('general.warning', ['warning'=> trans('general.errors_importing')]) }}</strong>
|
||||
</div>
|
||||
|
||||
<div class="errors-table">
|
||||
<table class="table table-striped table-bordered" id="errors-table">
|
||||
<thead>
|
||||
<th>{{ trans('general.item') }}</th>
|
||||
<th>{{ trans('general.error') }}</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php \Log::debug("import errors are: ".print_r($import_errors,true)); @endphp
|
||||
@foreach($import_errors AS $key => $actual_import_errors)
|
||||
@php \Log::debug("Key is: $key"); @endphp
|
||||
@foreach($actual_import_errors AS $table => $error_bag)
|
||||
@php \Log::debug("Table is: $table"); @endphp
|
||||
@foreach($error_bag as $field => $error_list)
|
||||
@php \Log::debug("Field is: $field"); @endphp
|
||||
<tr>
|
||||
<td>{{ $activeFile->file_path ?? "Unknown File" }}</td>
|
||||
<td>
|
||||
<b>{{ $field }}:</b>
|
||||
<span>{{ implode(", ",$error_list) }}</span>
|
||||
<br />
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@endforeach
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="col-md-9">
|
||||
<div class="box">
|
||||
<div class="box-body">
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-12">
|
||||
|
||||
@if($progress != -1)
|
||||
<div class="col-md-10 col-sm-5 col-xs-12" style="height: 35px;" id='progress-container'>
|
||||
<div class="progress progress-striped-active" style="height: 100%;">
|
||||
<div id='progress-bar' class="progress-bar {{ $progress_bar_class }}" role="progressbar" style="width: {{ $progress }}%">
|
||||
<h4 id="progress-text">{!! $progress_message !!}</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="col-md-2 col-sm-5 col-xs-12 text-right pull-right">
|
||||
|
||||
<!-- The fileinput-button span is used to style the file input field as button -->
|
||||
@if (!config('app.lock_passwords'))
|
||||
<span class="btn btn-primary fileinput-button">
|
||||
<span>{{ trans('button.select_file') }}</span>
|
||||
<!-- The file input field used as target for the file upload widget -->
|
||||
<label for="files[]"><span class="sr-only">{{ trans('admin/importer/general.select_file') }}</span></label>
|
||||
<input id="fileupload" type="file" name="files[]" data-url="{{ route('api.imports.index') }}" accept="text/csv" aria-label="files[]">
|
||||
</span>
|
||||
@endif
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12 table-responsive" style="padding-top: 30px;">
|
||||
<table data-pagination="true"
|
||||
data-id-table="upload-table"
|
||||
data-search="true"
|
||||
data-side-pagination="client"
|
||||
id="upload-table"
|
||||
class="col-md-12 table table-striped snipe-table">
|
||||
|
||||
<tr>
|
||||
<th class="col-md-6">
|
||||
{{ trans('general.file_name') }}
|
||||
</th>
|
||||
<th class="col-md-3">
|
||||
{{ trans('general.created_at') }}
|
||||
</th>
|
||||
<th class="col-md-1">
|
||||
{{ trans('general.filesize') }}
|
||||
</th>
|
||||
<th class="col-md-1 text-right">
|
||||
<span class="sr-only">{{ trans('general.actions') }}</span>
|
||||
</th>
|
||||
</tr>
|
||||
|
||||
@foreach($files as $currentFile)
|
||||
|
||||
<tr style="{{ ($activeFile && ($currentFile->id == $activeFile->id)) ? 'font-weight: bold' : '' }}" class="{{ ($activeFile && ($currentFile->id == $activeFile->id)) ? 'warning' : '' }}">
|
||||
<td class="col-md-6">{{ $currentFile->file_path }}</td>
|
||||
<td class="col-md-3">{{ Helper::getFormattedDateObject($currentFile->created_at, 'datetime', false) }}</td>
|
||||
<td class="col-md-1">{{ Helper::formatFilesizeUnits($currentFile->filesize) }}</td>
|
||||
<td class="col-md-1 text-right" style="white-space: nowrap;">
|
||||
<button class="btn btn-sm btn-info" wire:click="selectFile({{ $currentFile->id }})" data-tooltip="true" title="{{ trans('general.import_this_file') }}">
|
||||
<i class="fa-solid fa-list-check" aria-hidden="true"></i>
|
||||
<span class="sr-only">{{ trans('general.import') }}</span>
|
||||
</button>
|
||||
<a href="#" wire:click="$set('activeFile',null)">
|
||||
<button class="btn btn-sm btn-danger" wire:click="destroy({{ $currentFile->id }})">
|
||||
<i class="fas fa-trash icon-white" aria-hidden="true"></i><span class="sr-only"></span></button>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@if( $currentFile && $activeFile && ($currentFile->id == $activeFile->id))
|
||||
<tr class="warning">
|
||||
<td colspan="4">
|
||||
|
||||
<div class="form-group">
|
||||
|
||||
<label for="activeFile.import_type" class="col-md-3 col-xs-12">
|
||||
{{ trans('general.import_type') }}
|
||||
</label>
|
||||
|
||||
<div class="col-md-9 col-xs-12">
|
||||
{{ Form::select('activeFile.import_type', $importTypes, $activeFile->import_type, [
|
||||
'id' => 'import_type',
|
||||
'class' => 'livewire-select2',
|
||||
'style' => 'min-width: 350px',
|
||||
'data-placeholder' => trans('general.select_var', ['thing' => trans('general.import_type')]),
|
||||
'placeholder' => '', //needed so that the form-helper will put an empty option first
|
||||
'data-minimum-results-for-search' => '-1', // Remove this if the list gets long enough that we need to search
|
||||
'data-livewire-component' => $_instance->id
|
||||
]) }}
|
||||
@if ($activeFile->import_type === 'asset' && $snipeSettings->auto_increment_assets == 0)
|
||||
<p class="help-block">
|
||||
{{ trans('general.auto_incrementing_asset_tags_disabled_so_tags_required') }}
|
||||
</p>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-9 col-md-offset-3">
|
||||
<label class="form-control">
|
||||
<input type="checkbox" name="update" data-livewire-component="{{ $_instance->id }}" wire:model="update">
|
||||
{{ trans('general.update_existing_values') }}
|
||||
</label>
|
||||
@if ($activeFile->import_type === 'asset' && $snipeSettings->auto_increment_assets == 1 && $update)
|
||||
<p class="help-block">
|
||||
{{ trans('general.auto_incrementing_asset_tags_enabled_so_now_assets_will_be_created') }}
|
||||
</p>
|
||||
@endif
|
||||
|
||||
<label class="form-control">
|
||||
<input type="checkbox" name="send_welcome" data-livewire-component="{{ $_instance->id }}" wire:model="send_welcome">
|
||||
{{ trans('general.send_welcome_email_to_users') }}
|
||||
</label>
|
||||
|
||||
<label class="form-control">
|
||||
<input type="checkbox" name="run_backup" data-livewire-component="{{ $_instance->id }}" wire:model="run_backup">
|
||||
{{ trans('general.back_before_importing') }}
|
||||
</label>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@if($statusText)
|
||||
<div class="alert col-md-8 col-md-offset-3{{ $statusType == 'success' ? ' alert-success' : ($statusType == 'error' ? ' alert-danger' : ' alert-info') }}" style="padding-top: 20px;">
|
||||
{!! $statusText !!}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
|
||||
@if ($activeFile->import_type)
|
||||
<div class="form-group col-md-12">
|
||||
<hr style="border-top: 1px solid lightgray">
|
||||
<h3><i class="{{ Helper::iconTypeByItem($activeFile->import_type) }}"></i> Map {{ ucwords($activeFile->import_type) }} Import Fields</h3>
|
||||
<hr style="border-top: 1px solid lightgray">
|
||||
</div>
|
||||
<div class="form-group col-md-12">
|
||||
<div class="col-md-3 text-right">
|
||||
<strong>{{ trans('general.csv_header_field') }}</strong>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<strong>{{ trans('general.import_field') }}</strong>
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
<strong>{{ trans('general.sample_value') }}</strong>
|
||||
</div>
|
||||
</div><!-- /div row -->
|
||||
|
||||
@if($activeFile->header_row)
|
||||
|
||||
@foreach($activeFile->header_row as $index => $header)
|
||||
|
||||
<div class="form-group col-md-12" wire:key="header-row-{{ $index }}">
|
||||
|
||||
<label for="field_map.{{ $index }}" class="col-md-3 control-label text-right">{{ $header }}</label>
|
||||
<div class="col-md-4">
|
||||
|
||||
{{ Form::select('field_map.'.$index, $columnOptions[$activeFile->import_type], @$field_map[$index],
|
||||
[
|
||||
'class' => 'mappings livewire-select2',
|
||||
'placeholder' => trans('general.importer.do_not_import'),
|
||||
'style' => 'min-width: 100%',
|
||||
'data-livewire-component' => $_instance->id
|
||||
],[
|
||||
'-' => ['disabled' => true] // this makes the "-----" line unclickable
|
||||
])
|
||||
}}
|
||||
</div>
|
||||
@if (($activeFile->first_row) && (array_key_exists($index, $activeFile->first_row)))
|
||||
<div class="col-md-5">
|
||||
<p class="form-control-static">{{ str_limit($activeFile->first_row[$index], 50, '...') }}</p>
|
||||
</div>
|
||||
@else
|
||||
@php
|
||||
$statusText = trans('help.empty_file');
|
||||
$statusType = 'info';
|
||||
@endphp
|
||||
@endif
|
||||
</div><!-- /div row -->
|
||||
@endforeach
|
||||
@else
|
||||
{{ trans('general.no_headers') }}
|
||||
@endif
|
||||
|
||||
<div class="form-group col-md-12">
|
||||
<div class="col-md-3 text-left">
|
||||
<a href="#" wire:click="$set('activeFile',null)">{{ trans('general.cancel') }}</a>
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
<button type="submit" class="btn btn-primary col-md-5" id="import">Import</button>
|
||||
<br><br>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if($statusText)
|
||||
<div class="alert col-md-8 col-md-offset-3{{ $statusType == 'success' ? ' alert-success' : ($statusType == 'error' ? ' alert-danger' : ' alert-info') }}" style="padding-top: 20px;">
|
||||
{!! $statusText !!}
|
||||
</div>
|
||||
@endif
|
||||
@else
|
||||
<div class="form-group col-md-10">
|
||||
<div class="col-md-3 text-left">
|
||||
<a href="#" wire:click="$set('activeFile',null)">{{ trans('general.cancel') }}</a>
|
||||
</div>
|
||||
</div>
|
||||
@endif {{-- end of if ... activeFile->import_type --}}
|
||||
|
||||
</div><!-- /div v-show --> </td>
|
||||
</tr>
|
||||
@endif
|
||||
</tr>
|
||||
@endforeach
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<h2>{{ trans('general.importing') }}</h2>
|
||||
<p>{!! trans('general.importing_help') !!}</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@push('js')
|
||||
<script>
|
||||
|
||||
{{-- TODO: Maybe change this to the file upload thing that's baked-in to Livewire? --}}
|
||||
$('#fileupload').fileupload({
|
||||
dataType: 'json',
|
||||
done: function(e, data) {
|
||||
@this.progress_bar_class = 'progress-bar-success';
|
||||
@this.progress_message = '<i class="fas fa-check faa-pulse animated"></i> {{ trans('general.notification_success') }}';
|
||||
@this.progress = 100;
|
||||
},
|
||||
add: function(e, data) {
|
||||
data.headers = {
|
||||
"X-Requested-With": 'XMLHttpRequest',
|
||||
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr('content')
|
||||
};
|
||||
data.process().done( function () {data.submit();});
|
||||
@this.progress = 0;
|
||||
@this.clearMessage();
|
||||
},
|
||||
progress: function(e, data) {
|
||||
@this.progress = parseInt((data.loaded / data.total * 100, 10));
|
||||
@this.progress_message = '{{ trans('general.uploading') }}';
|
||||
},
|
||||
fail: function() {
|
||||
@this.progress_bar_class = "progress-bar-danger";
|
||||
@this.progress = 100;
|
||||
@this.progress_message = '<i class="fas fa-exclamation-triangle faa-pulse animated"></i> {{ trans('general.upload_error') }}';
|
||||
}
|
||||
})
|
||||
|
||||
// For the importFile part:
|
||||
$(function () {
|
||||
|
||||
|
||||
// we have to hook up to the `<tr id='importer-file'>` at the root of this display,
|
||||
// because the #import button isn't visible until you click an import_type
|
||||
$('#upload-table').on('click', '#import', function () {
|
||||
if(!@this.activeFile.import_type) {
|
||||
@this.statusType='error';
|
||||
@this.statusText= "An import type is required... "; //TODO: translate?
|
||||
return;
|
||||
}
|
||||
@this.statusType ='pending';
|
||||
@this.statusText = '<i class="fa fa-spinner fa-spin" aria-hidden="true"></i> {{ trans('admin/hardware/form.processing_spinner') }}';
|
||||
@this.generate_field_map().then(function (mappings_raw) {
|
||||
var mappings = JSON.parse(mappings_raw)
|
||||
// console.warn("Here is the mappings:")
|
||||
// console.dir(mappings)
|
||||
// console.warn("Uh, active file id is, I guess: "+@this.activeFile.id)
|
||||
var this_file = @this.file_id; // okay, I actually don't know what I'm doing here.
|
||||
$.post({
|
||||
{{-- I want to do something like: route('api.imports.importFile', $activeFile->id) }} --}}
|
||||
url: "api/v1/imports/process/"+this_file, // maybe? Good a guess as any..FIXME. HARDCODED DUMB FILE
|
||||
contentType: 'application/json',
|
||||
data: JSON.stringify({
|
||||
'import-update': !!@this.update,
|
||||
'send-welcome': !!@this.send_welcome,
|
||||
'import-type': @this.activeFile.import_type,
|
||||
'run-backup': !!@this.run_backup,
|
||||
'column-mappings': mappings
|
||||
}),
|
||||
headers: {
|
||||
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr('content')
|
||||
}
|
||||
}).done( function (body) {
|
||||
// Success
|
||||
@this.statusType="success";
|
||||
@this.statusText = "{{ trans('general.success_redirecting') }}";
|
||||
// console.dir(body)
|
||||
window.location.href = body.messages.redirect_url;
|
||||
}).fail( function (jqXHR, textStatus, error) {
|
||||
// Failure
|
||||
var body = jqXHR.responseJSON
|
||||
if((body) && (body.status) && body.status == 'import-errors') {
|
||||
@this.emit('importError', body.messages);
|
||||
@this.import_errors = body.messages
|
||||
|
||||
@this.statusType='error';
|
||||
@this.statusText = "Error";
|
||||
|
||||
// If Slack/notifications hits API thresholds, we *do* 500, but we never
|
||||
// actually surface that info.
|
||||
//
|
||||
// A 500 on notifications doesn't mean your import failed, so this is a confusing state.
|
||||
//
|
||||
// Ideally we'd have a message like "Your import worked, but not all
|
||||
// notifications could be sent".
|
||||
} else {
|
||||
console.warn("Not import-errors, just regular errors - maybe API limits")
|
||||
@this.message_type="warning"
|
||||
if ((body) && (error in body)) {
|
||||
@this.message = body.error ? body.error:"Unknown error - might just be throttling by notifications."
|
||||
} else {
|
||||
@this.message = "{{ trans('general.importer_generic_error') }}"
|
||||
}
|
||||
|
||||
}
|
||||
@this.activeFile = null; //@this.set('hideDetails')
|
||||
});
|
||||
})
|
||||
return false;
|
||||
});})
|
||||
|
||||
</script>
|
||||
@endpush
|
106
SNIPE-IT/resources/views/livewire/login-form.blade.php
Normal file
106
SNIPE-IT/resources/views/livewire/login-form.blade.php
Normal file
@ -0,0 +1,106 @@
|
||||
<div>
|
||||
<form role="form" method="POST" action="{{ route('login') }}" autocomplete="false" wire:submit.prevent="submitForm">
|
||||
<input type="hidden" name="_token" value="{{ csrf_token() }}" />
|
||||
|
||||
<!-- this is a hack to prevent Chrome from trying to autocomplete fields -->
|
||||
<input type="text" name="prevent_autofill" id="prevent_autofill" value="" style="display:none;" aria-hidden="true">
|
||||
<input type="password" name="password_fake" id="password_fake" value="" style="display:none;" aria-hidden="true">
|
||||
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-4 col-md-offset-4">
|
||||
|
||||
<div class="box login-box">
|
||||
<div class="box-header with-border">
|
||||
<h1 class="box-title"> {{ trans('auth/general.login_prompt') }}</h1>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="login-box-body">
|
||||
<div class="row">
|
||||
|
||||
@if ($snipeSettings->login_note)
|
||||
<div class="col-md-12">
|
||||
<div class="alert alert-info">
|
||||
{!! Parsedown::instance()->text(e($snipeSettings->login_note)) !!}
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Notifications -->
|
||||
@include('notifications')
|
||||
|
||||
<div class="col-md-12">
|
||||
<!-- CSRF Token -->
|
||||
|
||||
<fieldset>
|
||||
|
||||
<div class="form-group{{ $errors->has('username') ? ' has-error' : '' }}">
|
||||
<label for="username">
|
||||
<i class="fas fa-user" aria-hidden="true"></i>
|
||||
{{ trans('admin/users/table.username') }}
|
||||
</label>
|
||||
<input class="form-control" placeholder="{{ trans('admin/users/table.username') }}" name="username" type="text" autocomplete="off" wire:model="username">
|
||||
@error('username')
|
||||
<span class="alert-msg">
|
||||
{{ $message }}
|
||||
</span>
|
||||
@enderror
|
||||
</div>
|
||||
<div class="form-group{{ $errors->has('password') ? ' has-error' : '' }}">
|
||||
<label for="password">
|
||||
<i class="fas fa-key" aria-hidden="true"></i>
|
||||
{{ trans('admin/users/table.password') }}
|
||||
</label>
|
||||
<input class="form-control" placeholder="{{ trans('admin/users/table.password') }}" name="password" type="password" wire:model="password" autocomplete="off">
|
||||
@error('password')
|
||||
<span class="alert-msg">
|
||||
{{ $message }}
|
||||
</span>
|
||||
@enderror
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="checkbox">
|
||||
<label class="form-control">
|
||||
<input name="remember" type="checkbox" value="1">
|
||||
{{ trans('auth/general.remember_me') }}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div> <!-- end col-md-12 -->
|
||||
|
||||
</div> <!-- end row -->
|
||||
|
||||
@if ($snipeSettings->saml_enabled)
|
||||
<div class="row">
|
||||
<div class="text-right col-md-12">
|
||||
<a href="{{ route('saml.login') }}">{{ trans('auth/general.saml_login') }}</a>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
<button class="btn btn-lg btn-primary btn-block" type="submit"{{ $can_submit ? '' : ' disabled' }}>
|
||||
<i wire:loading wire:target='submitForm' class="fas fa-spin fa-spinner"></i> {{ trans('auth/general.login') }}</button>
|
||||
</div>
|
||||
<div class="text-right col-md-12 col-sm-12 col-xs-12" style="padding-top: 10px;">
|
||||
@if ($snipeSettings->custom_forgot_pass_url)
|
||||
<a href="{{ $snipeSettings->custom_forgot_pass_url }}" rel="noopener">{{ trans('auth/general.forgot_password') }}</a>
|
||||
@else
|
||||
<a href="{{ route('password.request') }}">{{ trans('auth/general.forgot_password') }}</a>
|
||||
@endif
|
||||
|
||||
|
||||
</div>
|
||||
</div> <!-- end login box -->
|
||||
|
||||
</div> <!-- col-md-4 -->
|
||||
|
||||
</div> <!-- end row -->
|
||||
</div> <!-- end container -->
|
||||
</form>
|
||||
|
||||
</div>
|
189
SNIPE-IT/resources/views/livewire/slack-settings-form.blade.php
Normal file
189
SNIPE-IT/resources/views/livewire/slack-settings-form.blade.php
Normal file
@ -0,0 +1,189 @@
|
||||
{{-- Page title --}}
|
||||
@section('title')
|
||||
{{ trans('admin/settings/general.webhook_title') }}
|
||||
@parent
|
||||
@stop
|
||||
|
||||
@section('header_right')
|
||||
<a href="{{ route('settings.index') }}" class="btn btn-primary"> {{ trans('general.back') }}</a>
|
||||
@stop
|
||||
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
|
||||
<div><!-- livewire div - do not remove -->
|
||||
<form class="form-horizontal" role="form" wire:submit.prevent="submit">
|
||||
{{csrf_field()}}
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-sm-10 col-sm-offset-1 col-md-8 col-md-offset-2">
|
||||
|
||||
<div class="panel box box-default">
|
||||
|
||||
<div class="box-header with-border">
|
||||
<h2 class="box-title">
|
||||
<i class="{{$webhook_icon}}"></i> {{ trans('admin/settings/general.webhook', ['app' => $webhook_name] ) }}
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
<div class="box-body">
|
||||
@if($webhook_selected != 'general')
|
||||
<div class="col-md-12">
|
||||
<p>
|
||||
{!! trans('admin/settings/general.webhook_integration_help',array('webhook_link' => $webhook_link, 'app' => $webhook_name)) !!}
|
||||
</p>
|
||||
<br>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="col-md-12" style="border-top: 0px;">
|
||||
|
||||
@if(session()->has('success'))
|
||||
<div class="alert alert-success fade in">
|
||||
{{session('success')}}
|
||||
</div>
|
||||
@endif
|
||||
@if(session()->has('error'))
|
||||
<div class="alert alert-danger fade in">
|
||||
{{session('error')}}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-md-2">
|
||||
<label for="webhook_selected">
|
||||
{{ trans('general.integration_option') }}
|
||||
|
||||
</label>
|
||||
</div>
|
||||
<div class="col-md-9 required" wire:ignore>
|
||||
|
||||
@if (Helper::isDemoMode())
|
||||
{{ Form::select('webhook_selected', array('slack' => trans('admin/settings/general.slack'), 'general' => trans('admin/settings/general.general_webhook'),'google' => trans('admin/settings/general.google_workspaces'), 'microsoft' => trans('admin/settings/general.ms_teams')), old('webhook_selected', $webhook_selected), array('class'=>'select2 form-control', 'aria-label' => 'webhook_selected', 'id' => 'select2', 'style'=>'width:100%', 'disabled')) }}
|
||||
@else
|
||||
{{ Form::select('webhook_selected', array('slack' => trans('admin/settings/general.slack'), 'general' => trans('admin/settings/general.general_webhook'),'google' => trans('admin/settings/general.google_workspaces'), 'microsoft' => trans('admin/settings/general.ms_teams')), old('webhook_selected', $webhook_selected), array('class'=>'select2 form-control', 'aria-label' => 'webhook_selected', 'id' => 'select2', 'data-minimum-results-for-search' => '-1', 'style'=>'width:100%')) }}
|
||||
@endif
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if (Helper::isDemoMode())
|
||||
@include('partials.forms.demo-mode')
|
||||
@endif
|
||||
|
||||
<!--Webhook endpoint-->
|
||||
<div class="form-group{{ $errors->has('webhook_endpoint') ? ' error' : '' }}">
|
||||
<div class="col-md-2">
|
||||
{{ Form::label('webhook_endpoint', trans('admin/settings/general.webhook_endpoint',['app' => $webhook_name ])) }}
|
||||
</div>
|
||||
<div class="col-md-9 required">
|
||||
<input type="text" wire:model.lazy="webhook_endpoint" class="form-control" placeholder="{{$webhook_placeholder}}" value="{{old('webhook_endpoint', $webhook_endpoint)}}"{{ Helper::isDemoMode() ? ' disabled' : ''}}>
|
||||
{!! $errors->first('webhook_endpoint', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if (Helper::isDemoMode())
|
||||
@include('partials.forms.demo-mode')
|
||||
@endif
|
||||
|
||||
|
||||
<!-- Webhook channel -->
|
||||
@if($webhook_selected != 'microsoft' && $webhook_selected!= 'google')
|
||||
<div class="form-group{{ $errors->has('webhook_channel') ? ' error' : '' }}">
|
||||
<div class="col-md-2">
|
||||
{{ Form::label('webhook_channel', trans('admin/settings/general.webhook_channel',['app' => $webhook_name ])) }}
|
||||
</div>
|
||||
<div class="col-md-9 required">
|
||||
<input type="text" wire:model.lazy="webhook_channel" class="form-control" placeholder="#IT-Ops" value="{{ old('webhook_channel', $webhook_channel) }}"{{ Helper::isDemoMode() ? ' disabled' : ''}}>
|
||||
|
||||
{!! $errors->first('webhook_channel', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if (Helper::isDemoMode())
|
||||
@include('partials.forms.demo-mode')
|
||||
@endif
|
||||
|
||||
<!-- Webhook botname -->
|
||||
@if($webhook_selected != 'microsoft' && $webhook_selected != 'google')
|
||||
<div class="form-group{{ $errors->has('webhook_botname') ? ' error' : '' }}">
|
||||
<div class="col-md-2">
|
||||
{{ Form::label('webhook_botname', trans('admin/settings/general.webhook_botname',['app' => $webhook_name ])) }}
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
<input type="text" wire:model.lazy="webhook_botname" class='form-control' placeholder="Snipe-Bot" {{ old('webhook_botname', $webhook_botname)}}{{ Helper::isDemoMode() ? ' disabled' : ''}}>
|
||||
{!! $errors->first('webhook_botname', '<span class="alert-msg" aria-hidden="true">:message</span>') !!}
|
||||
</div><!--col-md-10-->
|
||||
</div>
|
||||
@endif
|
||||
@if (!Helper::isDemoMode())
|
||||
@include('partials.forms.demo-mode')
|
||||
@endif
|
||||
|
||||
<!--Webhook Integration Test-->
|
||||
|
||||
@if($webhook_endpoint != null && $webhook_channel != null)
|
||||
<div class="form-group">
|
||||
<div class="col-md-offset-2 col-md-9">
|
||||
<a href="#" wire:click.prevent="{{$webhook_test}}"
|
||||
class="btn btn-default btn-sm pull-left">
|
||||
<i class="{{$webhook_icon}}" aria-hidden="true"></i>
|
||||
{!! trans('admin/settings/general.webhook_test',['app' => ucwords($webhook_selected) ]) !!}
|
||||
</a>
|
||||
<div wire:loading>
|
||||
<span style="padding-left: 5px; font-size: 20px">
|
||||
<i class="fas fa-spinner fa-spin" aria-hidden="true"></i>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div><!-- /.col-md-12 -->
|
||||
</div><!-- /.box-body -->
|
||||
|
||||
<div class="box-footer">
|
||||
<div class="text-right col-md-12">
|
||||
|
||||
<button type="reset" wire:click.prevent="clearSettings" class="col-md-2 text-left btn btn-danger pull-left"{{ Helper::isDemoMode() ? ' disabled' : ''}}>{{ trans('general.clear_and_save') }}</button>
|
||||
|
||||
<a class="btn btn-link pull-left" href="{{ route('settings.index') }}">{{ trans('button.cancel') }}</a>
|
||||
|
||||
|
||||
<button type="submit" {{$isDisabled}} class="btn btn-primary"{{ Helper::isDemoMode() ? ' disabled' : ''}}>
|
||||
<i class="fas fa-check icon-white" aria-hidden="true"></i> {{ $save_button }}</button>
|
||||
|
||||
</div> <!-- /.col-md-12 -->
|
||||
</div><!--box-footer-->
|
||||
|
||||
</div> <!-- /.box -->
|
||||
</div> <!-- /.col-md-8-->
|
||||
</div> <!-- /.row -->
|
||||
</form>
|
||||
</div> <!-- /livewire div -->
|
||||
|
||||
|
||||
|
||||
|
||||
@section('moar_scripts')
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$('#select2').select2();
|
||||
$('#select2').on('change', function (e) {
|
||||
var data = $('#select2').select2("val");
|
||||
@this.set('webhook_selected', data);
|
||||
});
|
||||
|
||||
// Re-render select2
|
||||
window.livewire.hook('message.processed', function (el, component) {
|
||||
$('.select2').select2();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
@endsection
|
||||
|
||||
|
70
SNIPE-IT/resources/views/locations/bulk-delete.blade.php
Normal file
70
SNIPE-IT/resources/views/locations/bulk-delete.blade.php
Normal file
@ -0,0 +1,70 @@
|
||||
@extends('layouts/default')
|
||||
|
||||
{{-- Page title --}}
|
||||
@section('title')
|
||||
{{ trans('general.bulk.delete.header', ['object_type' => trans_choice('general.location_plural', $valid_count)]) }}
|
||||
@parent
|
||||
@stop
|
||||
|
||||
@section('header_right')
|
||||
<a href="{{ URL::previous() }}" class="btn btn-primary pull-right">
|
||||
{{ trans('general.back') }}</a>
|
||||
@stop
|
||||
|
||||
{{-- Page content --}}
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<!-- left column -->
|
||||
<div class="col-md-8 col-md-offset-2">
|
||||
<form class="form-horizontal" method="post" action="{{ route('locations.bulkdelete.store') }}" autocomplete="off" role="form">
|
||||
{{csrf_field()}}
|
||||
<div class="box box-default">
|
||||
<div class="box-header with-border">
|
||||
<h2 class="box-title" style="color: red">{{ trans_choice('general.bulk.delete.warn', $valid_count, ['count' => $valid_count,'object_type' => trans_choice('general.location_plural', $valid_count)]) }}</h2>
|
||||
</div>
|
||||
|
||||
<div class="box-body">
|
||||
<table class="table table-striped table-condensed">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="col-md-1">
|
||||
<label>
|
||||
<input type="checkbox" id="checkAll" checked="checked">
|
||||
</label>
|
||||
</td>
|
||||
<td class="col-md-10">{{ trans('general.name') }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($locations as $location)
|
||||
<tr{!! (($location->assets_count > 0 ) ? ' class="danger"' : '') !!}>
|
||||
<td>
|
||||
<input type="checkbox" name="ids[]" class="{ ($location->isDeletable() ? '' : ' disabled') }}" value="{{ $location->id }}" {!! (($location->isDeletable()) ? ' checked="checked"' : ' disabled') !!}>
|
||||
</td>
|
||||
<td>{{ $location->name }}</td>
|
||||
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div><!-- /.box-body -->
|
||||
|
||||
<div class="box-footer text-right">
|
||||
<a class="btn btn-link pull-left" href="{{ URL::previous() }}">{{ trans('button.cancel') }}</a>
|
||||
<button type="submit" class="btn btn-success" id="submit-button"><i class="fas fa-check icon-white" aria-hidden="true"></i> {{ trans('general.delete') }}</button>
|
||||
</div><!-- /.box-footer -->
|
||||
</div><!-- /.box -->
|
||||
</form>
|
||||
</div> <!-- .col-md-12-->
|
||||
</div><!--.row-->
|
||||
@stop
|
||||
@section('moar_scripts')
|
||||
<script>
|
||||
|
||||
|
||||
$("#checkAll").change(function () {
|
||||
$("input:checkbox").prop('checked', $(this).prop("checked"));
|
||||
});
|
||||
|
||||
</script>
|
||||
@stop
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user