commit for testing

This commit is contained in:
akemidx 2024-11-21 19:01:27 -05:00
parent 9cb411c500
commit dd223fc215
6 changed files with 5 additions and 24 deletions

View file

@ -116,12 +116,6 @@ class AssetCheckinController extends Controller
$seat->update(['assigned_to' => null]); $seat->update(['assigned_to' => null]);
}); });
$settings = \App\Models\Setting::getSettings();
if($settings->require_checkinout_notes && (is_null($request->note))) {
return redirect()->to("hardware/$assetId/checkin")->with('error', trans('admin/hardware/message.update.no_note'));
}
// 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],

View file

@ -102,10 +102,6 @@ class AssetCheckoutController extends Controller
$settings = \App\Models\Setting::getSettings(); $settings = \App\Models\Setting::getSettings();
if($settings->require_checkinout_notes && (is_null($request->note))) {
return redirect()->to("hardware/$assetId/checkout")->with('error', trans('admin/hardware/message.update.no_note'));
}
// We have to check whether $target->company_id is null here since locations don't have a company yet // We have to check whether $target->company_id is null here since locations don't have a company yet
if (($settings->full_multiple_companies_support) && ((!is_null($target->company_id)) && (!is_null($asset->company_id)))) { if (($settings->full_multiple_companies_support) && ((!is_null($target->company_id)) && (!is_null($asset->company_id)))) {
if ($target->company_id != $asset->company_id){ if ($target->company_id != $asset->company_id){

View file

@ -26,7 +26,7 @@ class AssetCheckinRequest extends Request
$rules = []; $rules = [];
if($settings->require_checkinout_notes) { if($settings->require_checkinout_notes) {
$rules['notes'] = 'string|nullable'; $rules['note'] = 'string|nullable';
} }
return $rules; return $rules;
} }

View file

@ -40,7 +40,7 @@ class AssetCheckoutRequest extends Request
]; ];
if($settings->require_checkinout_notes) { if($settings->require_checkinout_notes) {
$rules['notes'] = 'required|string|nullable'; $rules['note'] = 'required|string';
} }
return $rules; return $rules;

View file

@ -118,13 +118,11 @@
<label for="note" class="col-md-3 control-label"> <label for="note" class="col-md-3 control-label">
{{ trans('general.notes') }} {{ trans('general.notes') }}
</label> </label>
@if($snipeSettings->require_checkinout_notes=="1")
<div class="col-md-8"> <div class="col-md-8">
<textarea class="col-md-6 form-control" id="note" required="true" <textarea class="col-md-6 form-control" id="note" @required($snipeSettings->require_checkinout_notes)
name="note">{{ old('note', $asset->note) }}</textarea> name="note">{{ old('note', $asset->note) }}</textarea>
{!! $errors->first('note', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!} {!! $errors->first('note', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
</div> </div>
@endif
</div> </div>
</div> <!--/.box-body--> </div> <!--/.box-body-->
</div> <!--/.box-body--> </div> <!--/.box-body-->

View file

@ -141,19 +141,12 @@
<label for="note" class="col-md-3 control-label"> <label for="note" class="col-md-3 control-label">
{{ trans('general.notes') }} {{ trans('general.notes') }}
</label> </label>
@if($snipeSettings->require_checkinout_notes=="1")
<div class="col-md-8"> <div class="col-md-8">
<textarea class="col-md-6 form-control" id="note" required="true" <textarea class="col-md-6 form-control" id="note" @required($snipeSettings->require_checkinout_notes)
name="note">{{ old('note', $asset->note) }}</textarea> name="note">{{ old('note', $asset->note) }}</textarea>
{!! $errors->first('note', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!} {!! $errors->first('note', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
</div> </div>
@else
<div class="col-md-8">
<textarea class="col-md-6 form-control" id="note"
name="note">{{ old('note', $asset->note) }}</textarea>
{!! $errors->first('note', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
</div>
@endif
</div> </div>
@if ($asset->requireAcceptance() || $asset->getEula() || ($snipeSettings->webhook_endpoint!='')) @if ($asset->requireAcceptance() || $asset->getEula() || ($snipeSettings->webhook_endpoint!=''))