mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-02 08:21:09 -08:00
Merge branch 'develop' into feature/sc-18937/add-manager-to-ldap-sync
This commit is contained in:
commit
55680762de
|
@ -111,6 +111,13 @@ class AssetCheckinController extends Controller
|
||||||
$checkin_at = $request->input('checkin_at');
|
$checkin_at = $request->input('checkin_at');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!empty($asset->licenseseats->all())){
|
||||||
|
foreach ($asset->licenseseats as $seat){
|
||||||
|
$seat->assigned_to = null;
|
||||||
|
$seat->save();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Get all pending Acceptances for this asset and delete them
|
// Get all pending Acceptances for this asset and delete them
|
||||||
$acceptances = CheckoutAcceptance::pending()->whereHasMorph('checkoutable',
|
$acceptances = CheckoutAcceptance::pending()->whereHasMorph('checkoutable',
|
||||||
[Asset::class],
|
[Asset::class],
|
||||||
|
|
|
@ -80,6 +80,15 @@ class AssetCheckoutController extends Controller
|
||||||
$asset->status_id = $request->get('status_id');
|
$asset->status_id = $request->get('status_id');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!empty($asset->licenseseats->all())){
|
||||||
|
if(request('checkout_to_type') == 'user') {
|
||||||
|
foreach ($asset->licenseseats as $seat){
|
||||||
|
$seat->assigned_to = $target->id;
|
||||||
|
$seat->save();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ($asset->checkOut($target, $admin, $checkout_at, $expected_checkin, e($request->get('note')), $request->get('name'))) {
|
if ($asset->checkOut($target, $admin, $checkout_at, $expected_checkin, e($request->get('note')), $request->get('name'))) {
|
||||||
return redirect()->route('hardware.index')->with('success', trans('admin/hardware/message.checkout.success'));
|
return redirect()->route('hardware.index')->with('success', trans('admin/hardware/message.checkout.success'));
|
||||||
}
|
}
|
||||||
|
|
|
@ -196,14 +196,14 @@ class Asset extends Depreciable
|
||||||
|
|
||||||
if (($model) && ($model->fieldset)) {
|
if (($model) && ($model->fieldset)) {
|
||||||
$this->rules += $model->fieldset->validation_rules();
|
$this->rules += $model->fieldset->validation_rules();
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach ($this->model->fieldset->fields as $field){
|
foreach ($this->model->fieldset->fields as $field){
|
||||||
if($field->format == 'BOOLEAN'){
|
if($field->format == 'BOOLEAN'){
|
||||||
$this->{$field->db_column} = filter_var($this->{$field->db_column}, FILTER_VALIDATE_BOOLEAN);
|
$this->{$field->db_column} = filter_var($this->{$field->db_column}, FILTER_VALIDATE_BOOLEAN);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return parent::save($params);
|
return parent::save($params);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue