Added more company_id filtering, more transformers

This commit is contained in:
snipe 2017-02-08 08:48:41 -08:00
parent 2986747fd7
commit 86198badbb
17 changed files with 17387 additions and 87 deletions

View file

@ -2,6 +2,7 @@
namespace App\Http\Controllers\Api;
use App\Http\Transformers\DatatablesTransformer;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Helpers\Helper;
@ -16,11 +17,28 @@ class CompaniesController extends Controller
* @since [v4.0]
* @return \Illuminate\Http\Response
*/
public function index()
public function index(Request $request)
{
$this->authorize('view', Company::class);
$companies = Company::all();
return $companies;
$allowed_columns = ['id','name'];
$companies = Company::withCount('assets','licenses','accessories','consumables','components','users');
if ($request->has('search')) {
$companies->TextSearch($request->input('search'));
}
$offset = $request->input('offset', 0);
$limit = $request->input('limit', 50);
$order = $request->input('order') === 'asc' ? 'asc' : 'desc';
$sort = in_array($request->input('sort'), $allowed_columns) ? $request->input('sort') : 'created_at';
$companies->orderBy($sort, $order);
$total = $companies->count();
$companies = $companies->skip($offset)->take($limit)->get();
return (new DatatablesTransformer)->transformDatatables($companies, $total);
}

View file

@ -47,6 +47,10 @@ class UsersController extends Controller
$users = $users->TextSearch($request->input('search'));
}
if ($request->has('company_id')) {
$users = $users->where('company_id','=',$request->input('company_id'));
}
$order = $request->input('order') === 'asc' ? 'asc' : 'desc';
$offset = request('offset', 0);
$limit = request('limit', 50);

View file

@ -66,10 +66,15 @@ class AssetsController extends Controller
* @since [v1.0]
* @return View
*/
public function index()
public function index(Request $request)
{
$this->authorize('index', Asset::class);
return View::make('hardware/index');
if ($request->has('company_id')) {
$company = Company::find($request->input('company_id'));
} else {
$company = null;
}
return View::make('hardware/index')->with('company',$company);
}
/**

View file

@ -137,4 +137,16 @@ final class CompaniesController extends Controller
}
}
}
public function show($id) {
$this->authorize('view', Company::class);
if (is_null($company = Company::find($id))) {
return redirect()->route('companies.index')
->with('error', trans('admin/companies/message.not_found'));
} else {
return View::make('companies/view')->with('company',$company);
}
}
}

View file

@ -43,6 +43,7 @@ class AssetsTransformer
'created_at' => $asset->created_at,
'purchase_date' => $asset->purchase_date,
'purchase_cost' => $asset->purchase_cost,
'can_checkout' => $asset->availableForCheckout(),
];

View file

@ -40,6 +40,7 @@ class UsersTransformer
'licenses_count' => $user->licenses_count,
'accessories_count' => $user->accessories_count,
'consumables_count' => $user->consumables_count,
'company' => ($user->company) ? ['id' => $user->company->id,'name'=> e($user->company->name)] : null,
];
return $array;

View file

@ -21,13 +21,13 @@ class AssetPresenter extends Presenter
[
"field" => "checkbox",
"checkbox" => true
],[
], [
"field" => "id",
"searchable" => false,
"sortable" => true,
"switchable" => true,
"title" => trans('general.id'),
"visible" => false,
"formatter" => null
"visible" => false
], [
"field" => "company",
"searchable" => true,
@ -35,7 +35,7 @@ class AssetPresenter extends Presenter
"switchable" => true,
"title" => trans('general.company'),
"visible" => false,
"formatter" => "companiesLinkObjFormatter"
"formatter" => 'assetCompanyObjFilterFormatter'
], [
"field" => "name",
"searchable" => true,
@ -138,6 +138,7 @@ class AssetPresenter extends Presenter
"sortable" => true,
"visible" => false,
"title" => trans('general.order_number'),
'formatter' => "orderNumberObjFilterFormatter"
], [
"field" => "notes",
"searchable" => true,
@ -157,6 +158,15 @@ class AssetPresenter extends Presenter
'<i class="fa fa-lock"></i> '.e($field->name) : e($field->name),
"formatter" => null ];
}
$layout[] = [
"field" => "checkincheckout",
"searchable" => false,
"sortable" => false,
"switchable" => true,
"title" => 'Checkin/Checkout',
"formatter" => "hardwareInOutFormatter",
];
$layout[] = [
"field" => "actions",

View file

@ -33,11 +33,12 @@ class UserPresenter extends Presenter
],
[
"field" => "id",
"searchable" => false,
"searchable" => true,
"sortable" => true,
"switchable" => true,
"title" => trans('general.id'),
"visible" => false
"visible" => false,
"formatter" => null
],
[
"field" => "company",

7
public/assets/js/FileSaver.min.js vendored Normal file
View file

@ -0,0 +1,7 @@
/*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */
var saveAs=saveAs||"undefined"!==typeof navigator&&navigator.msSaveOrOpenBlob&&navigator.msSaveOrOpenBlob.bind(navigator)||function(a){"use strict";if("undefined"===typeof navigator||!/MSIE [1-9]\./.test(navigator.userAgent)){var k=a.document,n=k.createElementNS("http://www.w3.org/1999/xhtml","a"),w="download"in n,x=function(c){var e=k.createEvent("MouseEvents");e.initMouseEvent("click",!0,!1,a,0,0,0,0,0,!1,!1,!1,!1,0,null);c.dispatchEvent(e)},q=a.webkitRequestFileSystem,u=a.requestFileSystem||q||a.mozRequestFileSystem,
y=function(c){(a.setImmediate||a.setTimeout)(function(){throw c;},0)},r=0,s=function(c){var e=function(){"string"===typeof c?(a.URL||a.webkitURL||a).revokeObjectURL(c):c.remove()};a.chrome?e():setTimeout(e,500)},t=function(c,a,d){a=[].concat(a);for(var b=a.length;b--;){var l=c["on"+a[b]];if("function"===typeof l)try{l.call(c,d||c)}catch(f){y(f)}}},m=function(c,e){var d=this,b=c.type,l=!1,f,p,k=function(){t(d,["writestart","progress","write","writeend"])},g=function(){if(l||!f)f=(a.URL||a.webkitURL||
a).createObjectURL(c);p?p.location.href=f:void 0==a.open(f,"_blank")&&"undefined"!==typeof safari&&(a.location.href=f);d.readyState=d.DONE;k();s(f)},h=function(a){return function(){if(d.readyState!==d.DONE)return a.apply(this,arguments)}},m={create:!0,exclusive:!1},v;d.readyState=d.INIT;e||(e="download");if(w)f=(a.URL||a.webkitURL||a).createObjectURL(c),n.href=f,n.download=e,x(n),d.readyState=d.DONE,k(),s(f);else{a.chrome&&b&&"application/octet-stream"!==b&&(v=c.slice||c.webkitSlice,c=v.call(c,0,
c.size,"application/octet-stream"),l=!0);q&&"download"!==e&&(e+=".download");if("application/octet-stream"===b||q)p=a;u?(r+=c.size,u(a.TEMPORARY,r,h(function(a){a.root.getDirectory("saved",m,h(function(a){var b=function(){a.getFile(e,m,h(function(a){a.createWriter(h(function(b){b.onwriteend=function(b){p.location.href=a.toURL();d.readyState=d.DONE;t(d,"writeend",b);s(a)};b.onerror=function(){var a=b.error;a.code!==a.ABORT_ERR&&g()};["writestart","progress","write","abort"].forEach(function(a){b["on"+
a]=d["on"+a]});b.write(c);d.abort=function(){b.abort();d.readyState=d.DONE};d.readyState=d.WRITING}),g)}),g)};a.getFile(e,{create:!1},h(function(a){a.remove();b()}),h(function(a){a.code===a.NOT_FOUND_ERR?b():g()}))}),g)}),g)):g()}},b=m.prototype;b.abort=function(){this.readyState=this.DONE;t(this,"abort")};b.readyState=b.INIT=0;b.WRITING=1;b.DONE=2;b.error=b.onwritestart=b.onprogress=b.onwrite=b.onabort=b.onerror=b.onwriteend=null;return function(a,b){return new m(a,b)}}}("undefined"!==typeof self&&
self||"undefined"!==typeof window&&window||this.content);"undefined"!==typeof module&&null!==module?module.exports=saveAs:"undefined"!==typeof define&&null!==define&&null!=define.amd&&define([],function(){return saveAs});

View file

@ -43,13 +43,13 @@
if (!$export.length) {
$export = $([
'<div class="export btn-group">',
'<button class="btn btn-default dropdown-toggle" ' +
'data-toggle="dropdown" type="button">',
'<i class="fa fa-download"></i> ',
'<span class="caret"></span>',
'</button>',
'<ul class="dropdown-menu" role="menu">',
'</ul>',
'<button class="btn btn-default dropdown-toggle" ' +
'data-toggle="dropdown" type="button">',
'<i class="fa fa-download"></i> ',
'<span class="caret"></span>',
'</button>',
'<ul class="dropdown-menu" role="menu">',
'</ul>',
'</div>'].join('')).appendTo($btnGroup);
var $menu = $export.find('.dropdown-menu'),
@ -66,9 +66,9 @@
$.each(exportTypes, function (i, type) {
if (TYPE_NAME.hasOwnProperty(type)) {
$menu.append(['<li data-type="' + type + '">',
'<a href="javascript:void(0)">',
TYPE_NAME[type],
'</a>',
'<a href="javascript:void(0)">',
TYPE_NAME[type],
'</a>',
'</li>'].join(''));
}
});

17003
public/assets/js/jspdf.min.js vendored Normal file

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

View file

@ -2,68 +2,75 @@
{{-- Page title --}}
@section('title')
{{ trans('admin/companies/table.companies') }}
@parent
{{ trans('general.companies') }}
@parent
@stop
@section('header_right')
<a href="{{ route('companies.create') }}" class="btn btn-primary pull-right">
{{ trans('general.create') }}</a>
<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 class="table table-striped" name="companies">
<thead>
<div class="row">
<div class="col-md-9">
<div class="box box-default">
<div class="box-body">
<div class="table-responsive">
<table
name="companies"
class="table table-striped snipe-table"
id="table"
data-url="{{ route('api.companies.index') }}"
data-cookie="true"
data-click-to-select="true"
data-cookie-id-table="companiesTable-{{ config('version.hash_version') }}">
<thead>
<tr>
<th class="col-md-1">{{ trans('general.id') }}</th>
<th class="col-md-9">{{ trans('admin/companies/table.name') }}</th>
<th class="col-md-2">{{ trans('table.actions') }}</th>
<th data-sortable="true" data-field="id" data-visible="false">{{ trans('general.id') }}</th>
<th data-sortable="true" data-formatter="companiesLinkFormatter" data-field="name" data-searchable="true">{{ trans('admin/companies/table.name') }}</th>
<th data-sortable="false" data-field="users_count" data-formatter="usersCompanyObjFilterFormatter" data-searchable="false">
<span class="hidden-xs"><i class="fa fa-users"></i></span>
<span class="hidden-md hidden-lg">{{ trans('general.users') }}</span></th>
<th data-sortable="false" data-field="assets_count" data-searchable="false" data-formatter="assetCompanyFilterFormatter">
<span class="hidden-xs"><i class="fa fa-barcode"></i></span>
<span class="hidden-md hidden-lg">{{ trans('general.assets') }}</span></th>
</th>
<th data-sortable="false" data-field="licenses_count" data-searchable="false">
<span class="hidden-xs"><i class="fa fa-floppy-o"></i></span>
<span class="hidden-md hidden-lg">{{ trans('general.licenses') }}</span></th>
</th>
<th data-sortable="false" data-field="accessories_count" data-searchable="false">
<span class="hidden-xs"><i class="fa fa-keyboard-o"></i></span>
<span class="hidden-md hidden-lg">{{ trans('general.accessories') }}</span></th>
</th>
<th data-sortable="false" data-field="consumables_count" data-searchable="false">
<span class="hidden-xs"><i class="fa fa-tint"></i></span>
<span class="hidden-md hidden-lg">{{ trans('general.consumables') }}</span></th>
</th>
<th data-sortable="false" data-field="components_count" data-searchable="false">
<span class="hidden-xs"><i class="fa fa-hdd-o"></i></span>
<span class="hidden-md hidden-lg">{{ trans('general.users') }}</span></th>
</th>
<th data-switchable="false" data-formatter="companiesActionsFormatter" data-searchable="false" data-sortable="false" data-field="actions">{{ trans('table.actions') }}</th>
</tr>
</thead>
<tbody>
@foreach ($companies as $company)
<tr>
<td>{{ $company->id }}</td>
<td>{{ $company->name }}</td>
<td>
<form method="POST" action="{{ route('companies.destroy', $company->id) }}" role="form">
<input type="hidden" name="_token" value="{{ csrf_token() }}" />
<a href="{{ route('companies.edit', $company->id) }}" class="btn btn-sm btn-warning"
title="{{ trans('button.edit') }}">
<i class="fa fa-pencil icon-white"></i>
</a>
<button type="submit" class="btn btn-sm btn-danger" title="{{ trans('button.delete') }}">
<i class="fa fa-trash icon-white"></i>
</button>
</form>
</td>
</tr>
@endforeach
</tbody>
</table>
</div><!-- /.box-body -->
</div><!-- /.box -->
</thead>
</table>
</div>
</div>
</div>
</div>
<!-- side address column -->
<div class="col-md-3">
<h4>About Companies</h4>
<p>
You can use companies as a simple informative field, or you can use them to restrict asset visibility and availability to users with a specific company by enabling Full Company Support in your Admin Settings.
</p>
</div>
<!-- side address column -->
<div class="col-md-3">
<h4>About Companies</h4>
<p>
You can use companies as a simple placeholder, or you can use them to restrict asset visibility and availability to users with a specific company.
</p>
</div>
</div>
@stop
@section('moar_scripts')
@include ('partials.bootstrap-table', ['exportFile' => 'companies-export', 'search' => true])
@stop

View file

@ -0,0 +1,157 @@
@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="fa fa-barcode"></i>
</span>
<span class="hidden-xs hidden-sm">{{ trans('general.assets') }}</span>
</a>
</li>
<li>
<a href="#licenses_tab" data-toggle="tab">
<span class="hidden-lg hidden-md">
<i class="fa fa-floppy-o"></i>
</span>
<span class="hidden-xs hidden-sm">{{ trans('general.licenses') }}</span>
</a>
</li>
<li>
<a href="#accessories_tab" data-toggle="tab">
<span class="hidden-lg hidden-md">
<i class="fa fa-keyboard-o"></i>
</span> <span class="hidden-xs hidden-sm">{{ trans('general.accessories') }}</span>
</a>
</li>
<li>
<a href="#consumables_tab" data-toggle="tab">
<span class="hidden-lg hidden-md">
<i class="fa fa-tint"></i></span>
<span class="hidden-xs hidden-sm">{{ trans('general.consumables') }}</span>
</a>
</li>
</ul>
<div class="tab-content">
<div class="tab-pane" id="asset_tab">
<!-- checked out assets table -->
<div class="table-responsive">
<table
name="companyAssets"
class="table table-striped snipe-table"
id="table"
data-url="{{route('api.assets.index',['company_id' => $company->id]) }}"
data-cookie="true"
data-click-to-select="true"
data-cookie-id-table="lcompanyAssetsTable-{{ config('version.hash_version') }}">
<thead>
<tr>
<th data-sortable="true" data-field="id" data-visible="false">{{ trans('general.id') }}</th>
<th data-sortable="true" data-formatter="locationsLinkFormatter" data-field="name" data-searchable="true">{{ trans('admin/locations/table.name') }}</th>
<th data-sortable="true" data-field="parent">{{ trans('admin/locations/table.parent') }}</th>
<th data-searchable="false" data-sortable="false" data-field="assets_default">{{ trans('admin/locations/table.assets_rtd') }}</th>
<th data-searchable="false" data-sortable="false" data-field="assets_checkedout">{{ trans('admin/locations/table.assets_checkedout') }}</th>
<th data-searchable="true" data-sortable="true" data-field="currency">{{ App\Models\Setting::first()->default_currency }}</th>
<th data-searchable="true" data-sortable="true" data-field="address">{{ trans('admin/locations/table.address') }}</th>
<th data-searchable="true" data-sortable="true" data-field="city">{{ trans('admin/locations/table.city') }}
</th>
<th data-searchable="true" data-sortable="true" data-field="state">
{{ trans('admin/locations/table.state') }}
</th>
<th data-searchable="true" data-sortable="true" data-field="zip">
{{ trans('admin/locations/table.zip') }}
</th>
<th data-searchable="true" data-sortable="true" data-field="country">
{{ trans('admin/locations/table.country') }}</th>
<th data-switchable="false" data-formatter="locationsActionsFormatter" data-searchable="false" data-sortable="false" data-field="actions">{{ trans('table.actions') }}</th>
</tr>
</thead>
</table>
</div>
</div><!-- /asset_tab -->
<div class="tab-pane" id="licenses_tab">
<div class="table-responsive">
<table class="display table table-hover">
<thead>
<tr>
<th class="col-md-5">{{ trans('general.name') }}</th>
<th class="col-md-6">{{ trans('admin/hardware/form.serial') }}</th>
<th class="col-md-1 hidden-print">{{ trans('general.action') }}</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div><!-- /licenses-tab -->
<div class="tab-pane" id="accessories_tab">
<div class="table-responsive">
<table class="display table table-hover">
<thead>
<tr>
<th class="col-md-5">Name</th>
<th class="col-md-1 hidden-print">Actions</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div><!-- /accessories-tab -->
<div class="tab-pane" id="consumables_tab">
<div class="table-responsive">
<table class="display table table-striped">
<thead>
<tr>
<th class="col-md-8">{{ trans('general.name') }}</th>
<th class="col-md-4">{{ trans('general.date') }}</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div><!-- /consumables-tab -->
</div><!-- /.tab-content -->
</div><!-- nav-tabs-custom -->
</div>
</div>
@stop
@section('moar_scripts')
@include ('partials.bootstrap-table', ['exportFile' => 'companies-export', 'search' => true])
@stop

View file

@ -2,6 +2,12 @@
@section('title0')
@if ((Input::get('company_id')) && ($company))
{{ $company->name }}
@endif
@if (Input::get('status'))
@if (Input::get('status')=='Pending')
{{ trans('general.pending') }}
@ -22,6 +28,10 @@
{{ trans('general.all') }}
@endif
{{ trans('general.assets') }}
@if (Input::has('order_number'))
: Order #{{ Input::get('order_number') }}
@endif
@stop
{{-- Page title --}}
@ -64,8 +74,11 @@
data-toolbar="#toolbar"
class="table table-striped snipe-table"
id="table"
data-url="{{route('api.assets.index', array('status' => e(Input::get('status')),'order_number'=>e(Input::get('order_number')), 'status_id'=>e(Input::get('status_id'))))}}"
data-cookie="true"
data-url="{{ route('api.assets.index',
array('status' => e(Input::get('status')),
'order_number'=>e(Input::get('order_number')),
'company_id'=>e(Input::get('company_id')),
'status_id'=>e(Input::get('status_id'))))}}"
data-click-to-select="true"
data-cookie-id-table="{{ e(Input::get('status')) }}assetTable-{{ config('version.hash_version') }}">
</table>

View file

@ -4,7 +4,11 @@
<script src="{{ asset('assets/js/extensions/export/bootstrap-table-export.js?v=1') }}"></script>
<script src="{{ asset('assets/js/extensions/cookie/bootstrap-table-cookie.js?v=1') }}"></script>
<script src="{{ asset('assets/js/extensions/export/tableExport.js') }}"></script>
<script src="{{ asset('assets/js/FileSaver.min.js') }}"></script>
<script src="{{ asset('assets/js/jspdf.min.js') }}"></script>
<script src="{{ asset('assets/js/jspdf.plugin.autotable.js') }}"></script>
<script src="{{ asset('assets/js/extensions/export/jquery.base64.js') }}"></script>
<script>
$('.snipe-table').bootstrapTable({
classes: 'table table-responsive table-no-bordered',
@ -32,10 +36,22 @@ $('.snipe-table').bootstrapTable({
showColumns: true,
trimOnSearch: false,
exportDataType: 'all',
exportTypes: ['csv', 'excel', 'txt','json', 'xml'],
exportTypes: ['csv', 'excel', 'doc', 'txt','json', 'xml', 'pdf'],
exportOptions: {
fileName: '{{ $exportFile . "-" }}' + (new Date()).toISOString().slice(0,10),
ignoreColumn: ['actions','change','checkbox']
ignoreColumn: ['actions','change','checkbox','checkincheckout'],
worksheetName: "Snipe-IT Export",
jspdf: {
autotable: {
styles: {
rowHeight: 20,
fontSize: 10,
overflow: 'linebreak',
},
headerStyles: {fillColor: 255, textColor: 0},
//alternateRowStyles: {fillColor: [60, 69, 79], textColor: 255}
}
}
},
maintainSelected: true,
paginationFirstText: "{{ trans('general.first') }}",
@ -111,12 +127,16 @@ $('.snipe-table').bootstrapTable({
function genericCheckinCheckoutFormatter(destination) {
return function (value,row) {
return '<nobr><a href="{{ url('/') }}/' + destination + '/' + row.id + '/edit" class="btn btn-sm btn-warning"><i class="fa fa-pencil"></i></a> '
+ '<a data-html="false" class="btn delete-asset btn-danger btn-sm" ' +
+ 'data-toggle="modal" href="" data-content="Are you sure you wish to delete this?" '
+ 'data-title="{{ trans('general.delete') }}?" onClick="return false;">'
+ '<i class="fa fa-trash"></i></a></nobr>';
};
if (row.can_checkout === true) {
return '<a href="{{ url('/') }}/' + destination + '/' + row.id + '/checkout" class="btn btn-sm btn-primary">{{ trans('general.checkout') }}</a>';
} else if (((row.can_checkout === false)) && (row.assigned_to == null)) {
return '<a class="btn btn-sm btn-primary disabled">{{ trans('general.checkout') }}</a>';
} else {
return '<nobr><a href="{{ url('/') }}/' + destination + '/' + row.id + '/checkin" class="btn btn-sm btn-primary">{{ trans('general.checkin') }}</a>';
}
}
}
@ -144,6 +164,7 @@ $('.snipe-table').bootstrapTable({
window[formatters[i] + 'LinkFormatter'] = genericRowLinkFormatter(formatters[i]);
window[formatters[i] + 'LinkObjFormatter'] = genericColumnObjLinkFormatter(formatters[i]);
window[formatters[i] + 'ActionsFormatter'] = genericActionsFormatter(formatters[i]);
window[formatters[i] + 'InOutFormatter'] = genericCheckinCheckoutFormatter(formatters[i]);
}
@ -169,7 +190,34 @@ $('.snipe-table').bootstrapTable({
}
}
function imageFormatter(value, row) {
function assetCompanyFilterFormatter(value, row) {
if (value) {
return '<a href="{{ url('/') }}/hardware/?company_id=' + row.id + '"> ' + value + '</a>';
}
}
function assetCompanyObjFilterFormatter(value, row) {
if (row.company) {
return '<a href="{{ url('/') }}/hardware/?company_id=' + row.company.id + '"> ' + row.company.name + '</a>';
}
}
function usersCompanyObjFilterFormatter(value, row) {
if (value) {
return '<a href="{{ url('/') }}/users/?company_id=' + row.id + '"> ' + value + '</a>';
} else {
return value;
}
}
function orderNumberObjFilterFormatter(value, row) {
if (value) {
return '<a href="{{ url('/') }}/hardware/?order_number=' + row.order_number + '"> ' + row.order_number + '</a>';
}
}
function imageFormatter(value, row) {
if (value) {
return '<img src="' + value + '" height="50" width="50">';
}
@ -184,4 +232,6 @@ $('.snipe-table').bootstrapTable({
});
});
</script>

View file

@ -49,7 +49,7 @@
@can('delete', \App\Models\User::class)
<div id="toolbar">
<select name="bulk_actions" class="form-control select2" style="width: 200px;">
<option value="delete">Bulk Checkin &amp; Delete</option>
<option value="delete">Bulk Checkin &amp;amp; Delete</option>
</select>
<button class="btn btn-default" id="bulkEdit" disabled>Go</button>
</div>
@ -63,7 +63,8 @@
id="table"
data-maintain-selected="true"
data-toggle="table"
data-url="{{ route('api.users.index', array(''=>e(Input::get('status')))) }}"
data-url="{{ route('api.users.index',
array(''=>e(Input::get('status')),'company_id'=>e(Input::get('company_id')))) }}"
data-cookie="true"
data-click-to-select="true"
data-cookie-id-table="userTableDisplay-{{ config('version.hash_version') }}">