mirror of
https://github.com/snipe/snipe-it.git
synced 2025-03-05 20:52:15 -08:00
Merge 716f508067
into c9f55bfd94
This commit is contained in:
commit
65bd44a9fb
|
@ -562,7 +562,7 @@ class BulkAssetsController extends Controller
|
||||||
public function showCheckout() : View
|
public function showCheckout() : View
|
||||||
{
|
{
|
||||||
$this->authorize('checkout', Asset::class);
|
$this->authorize('checkout', Asset::class);
|
||||||
return view('hardware/bulk-checkout');
|
return view('hardware/bulk-checkout')->with('statusLabel_list', Helper::deployableStatusLabelList());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -591,6 +591,7 @@ class BulkAssetsController extends Controller
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$checkout_at = date('Y-m-d H:i:s');
|
$checkout_at = date('Y-m-d H:i:s');
|
||||||
if (($request->filled('checkout_at')) && ($request->get('checkout_at') != date('Y-m-d'))) {
|
if (($request->filled('checkout_at')) && ($request->get('checkout_at') != date('Y-m-d'))) {
|
||||||
$checkout_at = e($request->get('checkout_at'));
|
$checkout_at = e($request->get('checkout_at'));
|
||||||
|
@ -603,11 +604,15 @@ class BulkAssetsController extends Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
$errors = [];
|
$errors = [];
|
||||||
DB::transaction(function () use ($target, $admin, $checkout_at, $expected_checkin, &$errors, $asset_ids, $request) { //NOTE: $errors is passsed by reference!
|
DB::transaction(function () use ($target, $admin, $checkout_at, $expected_checkin, &$errors, $asset_ids, $request) { //NOTE: $errors is passed by reference!
|
||||||
foreach ($asset_ids as $asset_id) {
|
foreach ($asset_ids as $asset_id) {
|
||||||
$asset = Asset::findOrFail($asset_id);
|
$asset = Asset::findOrFail($asset_id);
|
||||||
$this->authorize('checkout', $asset);
|
$this->authorize('checkout', $asset);
|
||||||
|
|
||||||
|
if ($request->filled('status_id')) {
|
||||||
|
$asset->status_id = $request->input('status_id');
|
||||||
|
}
|
||||||
|
|
||||||
$checkout_success = $asset->checkOut($target, $admin, $checkout_at, $expected_checkin, e($request->get('note')), $asset->name, null);
|
$checkout_success = $asset->checkOut($target, $admin, $checkout_at, $expected_checkin, e($request->get('note')), $asset->name, null);
|
||||||
|
|
||||||
//TODO - I think this logic is duplicated in the checkOut method?
|
//TODO - I think this logic is duplicated in the checkOut method?
|
||||||
|
|
|
@ -47,6 +47,17 @@
|
||||||
@include ('partials.forms.edit.asset-select', ['translated_name' => trans('general.asset'), 'asset_selector_div_id' => 'assigned_asset', 'fieldname' => 'assigned_asset', 'unselect' => 'true', 'style' => 'display:none;'])
|
@include ('partials.forms.edit.asset-select', ['translated_name' => trans('general.asset'), 'asset_selector_div_id' => 'assigned_asset', 'fieldname' => 'assigned_asset', 'unselect' => 'true', 'style' => 'display:none;'])
|
||||||
@include ('partials.forms.edit.location-select', ['translated_name' => trans('general.location'), 'fieldname' => 'assigned_location', 'style' => 'display:none;'])
|
@include ('partials.forms.edit.location-select', ['translated_name' => trans('general.location'), 'fieldname' => 'assigned_location', 'style' => 'display:none;'])
|
||||||
|
|
||||||
|
<!-- Status -->
|
||||||
|
<div class="form-group {{ $errors->has('status_id') ? '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, '', 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>
|
||||||
|
|
||||||
<!-- Checkout/Checkin Date -->
|
<!-- Checkout/Checkin Date -->
|
||||||
<div class="form-group {{ $errors->has('checkout_at') ? 'error' : '' }}">
|
<div class="form-group {{ $errors->has('checkout_at') ? 'error' : '' }}">
|
||||||
<label for="checkout_at" class="col-sm-3 control-label">
|
<label for="checkout_at" class="col-sm-3 control-label">
|
||||||
|
|
Loading…
Reference in a new issue