mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-24 21:24:13 -08:00
Component checkout/checkin fixes.
- Provide proper translated messages for checkin vs checkout - Pass appropriate methods to the Checkout event, fixes an error on checkin. - Default to a value of 1 on checkin in UI to save a click sometimes.
This commit is contained in:
parent
c34650458f
commit
358609720a
|
@ -8,6 +8,7 @@ use App\Http\Controllers\Controller;
|
||||||
use App\Models\Asset;
|
use App\Models\Asset;
|
||||||
use App\Models\Component;
|
use App\Models\Component;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Support\Carbon;
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
use Illuminate\Support\Facades\Validator;
|
use Illuminate\Support\Facades\Validator;
|
||||||
|
@ -96,12 +97,12 @@ class ComponentCheckinController extends Controller
|
||||||
|
|
||||||
$asset = Asset::find($component_assets->asset_id);
|
$asset = Asset::find($component_assets->asset_id);
|
||||||
|
|
||||||
event(new CheckoutableCheckedIn($component, $asset, Auth::user(), $request->input('note')));
|
event(new CheckoutableCheckedIn($component, $asset, Auth::user(), $request->input('note'), Carbon::now()));
|
||||||
|
|
||||||
return redirect()->route('components.index')->with('success',
|
return redirect()->route('components.index')->with('success',
|
||||||
trans('admin/components/message.checkout.success'));
|
trans('admin/components/message.checkin.success'));
|
||||||
}
|
}
|
||||||
return redirect()->route('components.index')->with('error', trans('admin/components/message.not_found'));
|
return redirect()->route('components.index')->with('error', trans('admin/components/message.does_not_exist'));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,7 +42,7 @@
|
||||||
<label for="assigned_qty" class="col-md-3 control-label">{{ trans('general.qty') }}
|
<label for="assigned_qty" class="col-md-3 control-label">{{ trans('general.qty') }}
|
||||||
<i class='icon-asterisk'></i></label>
|
<i class='icon-asterisk'></i></label>
|
||||||
<div class="col-md-9">
|
<div class="col-md-9">
|
||||||
<input class="form-control" type="text" name="assigned_qty" id="assigned_qty" style="width: 70px;" value="{{ old('assigned_qty') }}" />
|
<input class="form-control" type="text" name="assigned_qty" id="assigned_qty" style="width: 70px;" value="{{ old('assigned_qty') ?? 1 }}" />
|
||||||
{!! $errors->first('assigned_qty', '<br><span class="alert-msg" aria-hidden="true"><i class="fa fa-times" aria-hidden="true"></i> :message</span>') !!}
|
{!! $errors->first('assigned_qty', '<br><span class="alert-msg" aria-hidden="true"><i class="fa fa-times" aria-hidden="true"></i> :message</span>') !!}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue