diff --git a/app/Http/Transformers/AssetsTransformer.php b/app/Http/Transformers/AssetsTransformer.php index 1e2629d438..fccf89b0f1 100644 --- a/app/Http/Transformers/AssetsTransformer.php +++ b/app/Http/Transformers/AssetsTransformer.php @@ -116,7 +116,7 @@ class AssetsTransformer $permissions_array['available_actions'] = [ 'checkout' => Gate::allows('checkout', Asset::class), 'checkin' => Gate::allows('checkin', Asset::class), - 'clone' => Gate::allows('create', Asset::class), + 'clone' => false, 'restore' => false, 'update' => (bool) Gate::allows('update', Asset::class), 'delete' => ($asset->assigned_to=='' && Gate::allows('delete', Asset::class)), diff --git a/resources/views/hardware/index.blade.php b/resources/views/hardware/index.blade.php index fe21801e68..2cdad5e6bf 100755 --- a/resources/views/hardware/index.blade.php +++ b/resources/views/hardware/index.blade.php @@ -57,23 +57,29 @@
- {{ Form::open([ - 'method' => 'POST', - 'route' => ['hardware/bulkedit'], - 'class' => 'form-inline', - 'id' => 'bulkForm']) }} +
@if (Request::get('status')!='Deleted') -
- - - -
+ {{ Form::open([ + 'method' => 'POST', + 'route' => ['hardware/bulkedit'], + 'class' => 'form-inline', + 'id' => 'bulkForm']) }} +
+ + + + + + +
+ {{ Form::close() }} + @endif - {{ Form::close() }} + diff --git a/resources/views/partials/bootstrap-table.blade.php b/resources/views/partials/bootstrap-table.blade.php index 3d90ff4d89..1799241501 100644 --- a/resources/views/partials/bootstrap-table.blade.php +++ b/resources/views/partials/bootstrap-table.blade.php @@ -81,6 +81,18 @@ } }); + + $('.snipe-table').on('check.bs.table .btSelectItem', function (row, $element) { + $('#bulkEdit').before(''); + }); + + + $('.snipe-table').on('uncheck.bs.table .btSelectItem', function (row, $element) { + $( "#checkbox_" + $element.id).remove(); + }); + + + }); @@ -209,7 +221,7 @@ } if ((row.available_actions) && (row.available_actions.update === true)) { - actions += 'Update '; + actions += '{{ trans('general.update') }} '; } if ((row.available_actions) && (row.available_actions.delete === true)) { @@ -218,13 +230,17 @@ + ' data-toggle="modal" ' + ' data-content="{{ trans('general.sure_to_delete') }} ' + row.name + '?" ' + ' data-title="{{ trans('general.delete') }}" onClick="return false;">' - + 'Delete '; + + '{{ trans('general.delete') }} '; } else { actions += ' '; } + if ((row.available_actions) && (row.available_actions.restore === true)) { - actions += ' '; + actions += ' '; + actions += '@csrf'; + actions += ' '; } actions +='';