Move notes above custom fields
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
89a52b7551
commit
d1085a0f46
3 changed files with 39 additions and 32 deletions
|
@ -73,18 +73,26 @@ class CustomFieldset extends Model
|
||||||
|
|
||||||
public function displayAnyFieldsInForm($form_type = null)
|
public function displayAnyFieldsInForm($form_type = null)
|
||||||
{
|
{
|
||||||
|
if ($this->fields) {
|
||||||
|
// \Log::error(print_r($this->fields, true));
|
||||||
|
\Log::error($this->fields->where('display_audit', '1')->count());
|
||||||
|
\Log::error($this->fields->where('display_checkin', '1')->count());
|
||||||
|
\Log::error($this->fields->where('display_checkout', '1')->count());
|
||||||
switch ($form_type) {
|
switch ($form_type) {
|
||||||
case 'audit':
|
case 'audit':
|
||||||
return $this->displayFieldInAuditForm();
|
return $this->fields->where('display_audit', '1')->count() > 0;
|
||||||
case 'checkin':
|
case 'checkin':
|
||||||
return $this->displayFieldInCheckinForm();
|
return $this->fields->where('display_checkin', '1')->count() > 0;
|
||||||
case 'checkout':
|
case 'checkout':
|
||||||
return $this->displayFieldInCheckoutForm();
|
return $this->fields->where('display_checkout', '1')->count() > 0;
|
||||||
default:
|
default:
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determine the validation rules we should apply based on the
|
* Determine the validation rules we should apply based on the
|
||||||
* custom field format
|
* custom field format
|
||||||
|
|
|
@ -139,18 +139,6 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Custom fields -->
|
|
||||||
@include("models/custom_fields_form", [
|
|
||||||
'model' => $asset->model,
|
|
||||||
'show_custom_fields_type' => 'checkin'
|
|
||||||
])
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Note -->
|
<!-- Note -->
|
||||||
<div class="form-group {{ $errors->has('note') ? 'error' : '' }}">
|
<div class="form-group {{ $errors->has('note') ? 'error' : '' }}">
|
||||||
<label for="note" class="col-md-3 control-label">
|
<label for="note" class="col-md-3 control-label">
|
||||||
|
@ -162,6 +150,15 @@
|
||||||
{!! $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>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Custom fields -->
|
||||||
|
@include("models/custom_fields_form", [
|
||||||
|
'model' => $asset->model,
|
||||||
|
'show_custom_fields_type' => 'checkin'
|
||||||
|
])
|
||||||
|
|
||||||
|
|
||||||
</div> <!--/.box-body-->
|
</div> <!--/.box-body-->
|
||||||
</div> <!--/.box-body-->
|
</div> <!--/.box-body-->
|
||||||
|
|
||||||
|
|
|
@ -142,12 +142,6 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Custom fields -->
|
|
||||||
@include("models/custom_fields_form", [
|
|
||||||
'model' => $asset->model,
|
|
||||||
'show_custom_fields_type' => 'checkout'
|
|
||||||
])
|
|
||||||
|
|
||||||
<!-- Note -->
|
<!-- Note -->
|
||||||
<div class="form-group {{ $errors->has('note') ? 'error' : '' }}">
|
<div class="form-group {{ $errors->has('note') ? 'error' : '' }}">
|
||||||
<label for="note" class="col-md-3 control-label">
|
<label for="note" class="col-md-3 control-label">
|
||||||
|
@ -161,6 +155,14 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Custom fields -->
|
||||||
|
@include("models/custom_fields_form", [
|
||||||
|
'model' => $asset->model,
|
||||||
|
'show_custom_fields_type' => 'checkout'
|
||||||
|
])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@if ($asset->requireAcceptance() || $asset->getEula() || ($snipeSettings->webhook_endpoint!=''))
|
@if ($asset->requireAcceptance() || $asset->getEula() || ($snipeSettings->webhook_endpoint!=''))
|
||||||
<div class="form-group notification-callout">
|
<div class="form-group notification-callout">
|
||||||
<div class="col-md-8 col-md-offset-3">
|
<div class="col-md-8 col-md-offset-3">
|
||||||
|
|
Loading…
Add table
Reference in a new issue