A free open source IT asset/license management system
Added default tab to locations
snipe4eed2baa3133
diff --git a/app/Http/Controllers/Assets/BulkAssetsController.php b/app/Http/Controllers/Assets/BulkAssetsController.phpindex 52f3588e9a..ca48d91f43 100644--- a/app/Http/Controllers/Assets/BulkAssetsController.php+++ b/app/Http/Controllers/Assets/BulkAssetsController.php@@ -33,7 +33,6 @@ class BulkAssetsController extends Controllerif (! $request->filled('ids')) {return redirect()->back()->with('error', trans('admin/hardware/message.update.no_assets_selected'));-}// Figure out where we need to send the user after the update is complete, and store that in the sessiondiff --git a/resources/views/locations/view.blade.php b/resources/views/locations/view.blade.phpindex 9f6cf3304f..1f7a84c913 100644--- a/resources/views/locations/view.blade.php+++ b/resources/views/locations/view.blade.php@@ -43,6 +43,19 @@</a></li>+ <li>+ <a href="#rtd_assets" 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('admin/hardware/form.default_location') }}+ {!! (($location->rtd_assets) && ($location->rtd_assets()->AssetsForShow()->count() > 0 )) ? '<badge class="badge badge-secondary">'.number_format($location->rtd_assets()->AssetsForShow()->count()).'</badge>' : '' !!}+ </span>+ </a>+ </li>++<li><a href="#accessories" data-toggle="tab"><span class="hidden-lg hidden-md">@@ -144,6 +157,38 @@</div><!-- /.table-responsive --></div><!-- /.tab-pane -->++ <div class="tab-pane" id="rtd_assets">+ <h2 class="box-title">{{ trans('admin/hardware/form.default_location') }}</h2>++ <div class="table table-responsive">+ @include('partials.asset-bulk-actions', ['id_divname' => 'RTDassetsBulkEditToolbar', 'id_formname' => 'RTDassets', 'id_button' => 'RTDbulkAssetEditButton'])+ <table+ data-columns="{{ \App\Presenters\AssetPresenter::dataTableLayout() }}"+ data-cookie-id-table="RTDassetsListingTable"+ data-pagination="true"+ data-id-table="RTDassetsListingTable"+ 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="#RTDassetsBulkEditToolbar"+ data-bulk-button-id="#RTDbulkAssetEditButton"+ data-bulk-form-id="#RTDassetsBulkEditToolbar"+ data-click-to-select="true"+ id="RTDassetsListingTable"+ class="table table-striped snipe-table"+ data-url="{{route('api.assets.index', ['rtd_location_id' => $location->id]) }}"+ data-export-options='{+ "fileName": "export-rtd-locations-{{ str_slug($location->name) }}-assets-{{ date('Y-m-d') }}",+ "ignoreColumn": ["actions","image","change","checkbox","checkincheckout","icon"]+ }'>+ </table>++ </div><!-- /.table-responsive -->+ </div><!-- /.tab-pane -->diff --git a/resources/views/partials/asset-bulk-actions.blade.php b/resources/views/partials/asset-bulk-actions.blade.phpindex 3ee60cbc58..4d38078e0b 100644--- a/resources/views/partials/asset-bulk-actions.blade.php+++ b/resources/views/partials/asset-bulk-actions.blade.php@@ -1,9 +1,10 @@-<div id="assetsBulkEditToolbar" style="min-width:400px">- {{ Form::open([+<div id="{{ (isset($id_divname)) ? $id_divname : 'assetsBulkEditToolbar' }}" style="min-width:400px">+{{ Form::open(['method' => 'POST','route' => ['hardware/bulkedit'],'class' => 'form-inline',- 'id' => 'assetsBulkForm']) }}+ 'id' => (isset($id_formname)) ? $id_formname : 'assetsBulkForm',+ ]) }}<label for="bulk_actions">@@ -21,6 +22,6 @@<option value="labels">{{ trans_choice('button.generate_labels', 2) }}</option></select>- <button class="btn btn-primary" id="bulkAssetEditButton" disabled>{{ trans('button.go') }}</button>+ <button class="btn btn-primary" id="{{ (isset($id_button)) ? $id_button : 'bulkAssetEditButton' }}" disabled>{{ trans('button.go') }}</button>{{ Form::close() }}</div>diff --git a/resources/views/partials/bootstrap-table.blade.php b/resources/views/partials/bootstrap-table.blade.phpindex 2b32c4d6f8..c9e682dc87 100644--- a/resources/views/partials/bootstrap-table.blade.php+++ b/resources/views/partials/bootstrap-table.blade.php@@ -120,7 +120,7 @@var tableId = $(this).data('id-table');$(buttonName).removeAttr('disabled');- $(formName).prepend('<input id="' + tableId + '_checkbox_' + $element.id + '" type="hidden" name="ids[]" value="' + $element.id + '">');+ $(formName).append('<input id="' + tableId + '_checkbox_' + $element.id + '" type="hidden" name="ids[]" value="' + $element.id + '">');});$('.snipe-table').on('uncheck.bs.table .btSelectItem', function (row, $element) {@@ -129,7 +129,7 @@});- $('.snipe-table').on('check-all.bs.table', function (event, rowsAfter, rowsBefore) {+ $('.snipe-table').on('check-all.bs.table', function (event, rowsAfter) {var buttonName = $(this).data('bulk-button-id');$(buttonName).removeAttr('disabled');@@ -137,7 +137,7 @@var tableId = $(this).data('id-table');for (var i in rowsAfter) {- $(formName).prepend('<input id="' + tableId + '_checkbox_' + rowsAfter[i].id + '" type="hidden" name="ids[]" value="' + rowsAfter[i].id + '">');+ $(formName).append('<input id="' + tableId + '_checkbox_' + rowsAfter[i].id + '" type="hidden" name="ids[]" value="' + rowsAfter[i].id + '">');}});