Fixed #6911 - note must be a string on license checkin

This commit is contained in:
snipe 2019-05-02 15:20:47 -07:00
parent 25884a893e
commit dc73dbfbfd
3 changed files with 6 additions and 18 deletions

View file

@ -227,7 +227,8 @@ class LicensesController extends Controller
$seats = LicenseSeat::where('license_id', $licenseId)->with('license', 'user', 'asset');
$offset = request('offset', 0);
$offset = (($seats) && (request('offset') > $seats->count())) ? 0 : request('offset', 0);
$limit = request('limit', 50);
$order = $request->input('order') === 'asc' ? 'asc' : 'desc';

View file

@ -413,20 +413,7 @@ class LicensesController extends Controller
return redirect()->back()->withInput();
}
// Declare the rules for the form validation
$rules = array(
'note' => 'string',
'notes' => 'string',
);
// Create a new validator instance from our validation rules
$validator = Validator::make(Input::all(), $rules);
// If validation fails, we'll exit the operation now.
if ($validator->fails()) {
// Ooops.. something went wrong
return redirect()->back()->withInput()->withErrors($validator);
}
$return_to = User::find($licenseSeat->assigned_to);
if (!$return_to) {
$return_to = Asset::find($licenseSeat->asset_id);
@ -438,7 +425,7 @@ class LicensesController extends Controller
// Was the asset updated?
if ($licenseSeat->save()) {
$licenseSeat->logCheckin($return_to, e(request('note')));
$licenseSeat->logCheckin($license, e(request('note')));
if ($backTo=='user') {
return redirect()->route("users.show", $return_to->id)->with('success', trans('admin/licenses/message.checkin.success'));
}

View file

@ -44,9 +44,9 @@
<table
data-columns="{{ \App\Presenters\LicensePresenter::dataTableLayoutSeats() }}"
data-cookie-id-table="seatsTable"
data-id-table="seatsTable"
id="seatsTable"
data-cookie-id-table="seatsTable-{{ $license->id }}"
data-id-table="seatsTable-{{ $license->id }}"
id="seatsTable-{{$license->id}}"
data-pagination="true"
data-search="true"
data-side-pagination="server"