mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-12 22:37:28 -08:00
wireframed, needs a view and should work
This commit is contained in:
parent
c9d1274edc
commit
162b70d5a9
|
@ -56,6 +56,14 @@ class BulkAssetsController extends Controller
|
||||||
});
|
});
|
||||||
|
|
||||||
return view('hardware/bulk-delete')->with('assets', $assets);
|
return view('hardware/bulk-delete')->with('assets', $assets);
|
||||||
|
|
||||||
|
case 'restore':
|
||||||
|
$assets = Asset::with('assignedTo', 'location')->find($asset_ids);
|
||||||
|
$assets->each(function ($asset) {
|
||||||
|
$this->authorize('restore', $asset);
|
||||||
|
});
|
||||||
|
|
||||||
|
return view('hardware/bulk-restore')->with('assets', $assets);
|
||||||
case 'edit':
|
case 'edit':
|
||||||
return view('hardware/bulk')
|
return view('hardware/bulk')
|
||||||
->with('assets', $asset_ids)
|
->with('assets', $asset_ids)
|
||||||
|
@ -320,5 +328,13 @@ class BulkAssetsController extends Controller
|
||||||
} catch (ModelNotFoundException $e) {
|
} catch (ModelNotFoundException $e) {
|
||||||
return redirect()->route('hardware.bulkcheckout.show')->with('error', $e->getErrors());
|
return redirect()->route('hardware.bulkcheckout.show')->with('error', $e->getErrors());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
public function restore(Request $request) {
|
||||||
|
$assetIds = $request->get('ids');
|
||||||
|
foreach ($assetIds as $key => $assetId) {
|
||||||
|
$asset = Asset::withTrashed()->find($assetId);
|
||||||
|
$asset->restore();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,14 +62,16 @@
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@if (Request::get('status')!='Deleted')
|
{{-- @if (Request::get('status')!='Deleted') --}}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@include('partials.asset-bulk-actions')
|
@include('partials.asset-bulk-actions', ['status' => Request::get('status')])
|
||||||
|
|
||||||
@endif
|
{{-- @endif --}}
|
||||||
|
|
||||||
<table
|
<table
|
||||||
data-advanced-search="true"
|
data-advanced-search="true"
|
||||||
|
|
|
@ -13,6 +13,9 @@
|
||||||
</span>
|
</span>
|
||||||
</label>
|
</label>
|
||||||
<select name="bulk_actions" class="form-control select2" aria-label="bulk_actions" style="min-width: 350px;">
|
<select name="bulk_actions" class="form-control select2" aria-label="bulk_actions" style="min-width: 350px;">
|
||||||
|
@if($status == 'Deleted')
|
||||||
|
<option value="restore">{{trans('button.restore')}}</option>
|
||||||
|
@else
|
||||||
@can('update', \App\Models\Asset::class)
|
@can('update', \App\Models\Asset::class)
|
||||||
<option value="edit">{{ trans('button.edit') }}</option>
|
<option value="edit">{{ trans('button.edit') }}</option>
|
||||||
@endcan
|
@endcan
|
||||||
|
@ -20,6 +23,7 @@
|
||||||
<option value="delete">{{ trans('button.delete') }}</option>
|
<option value="delete">{{ trans('button.delete') }}</option>
|
||||||
@endcan
|
@endcan
|
||||||
<option value="labels" accesskey="l">{{ trans_choice('button.generate_labels', 2) }}</option>
|
<option value="labels" accesskey="l">{{ trans_choice('button.generate_labels', 2) }}</option>
|
||||||
|
@endif
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<button class="btn btn-primary" id="{{ (isset($id_button)) ? $id_button : 'bulkAssetEditButton' }}" disabled>{{ trans('button.go') }}</button>
|
<button class="btn btn-primary" id="{{ (isset($id_button)) ? $id_button : 'bulkAssetEditButton' }}" disabled>{{ trans('button.go') }}</button>
|
||||||
|
|
Loading…
Reference in a new issue