mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-12 22:37:28 -08:00
Implements #8155 to improve the workflow during asset creation
- adding 2 options to hide optional information
This commit is contained in:
parent
d55c176199
commit
dafe353050
|
@ -46,4 +46,6 @@ return [
|
||||||
'asset_not_deployable' => 'That asset status is not deployable. This asset cannot be checked out.',
|
'asset_not_deployable' => 'That asset status is not deployable. This asset cannot be checked out.',
|
||||||
'asset_deployable' => 'That status is deployable. This asset can be checked out.',
|
'asset_deployable' => 'That status is deployable. This asset can be checked out.',
|
||||||
'processing_spinner' => 'Processing...',
|
'processing_spinner' => 'Processing...',
|
||||||
|
'optional_infos' => 'Optional Information',
|
||||||
|
'order_details' => 'Order Related Information'
|
||||||
];
|
];
|
||||||
|
|
|
@ -15,7 +15,6 @@
|
||||||
|
|
||||||
@include ('partials.forms.edit.company-select', ['translated_name' => trans('general.company'), 'fieldname' => 'company_id'])
|
@include ('partials.forms.edit.company-select', ['translated_name' => trans('general.company'), 'fieldname' => 'company_id'])
|
||||||
|
|
||||||
|
|
||||||
<!-- Asset Tag -->
|
<!-- Asset Tag -->
|
||||||
<div class="form-group {{ $errors->has('asset_tag') ? ' has-error' : '' }}">
|
<div class="form-group {{ $errors->has('asset_tag') ? ' has-error' : '' }}">
|
||||||
<label for="asset_tag" class="col-md-3 control-label">{{ trans('admin/hardware/form.tag') }}</label>
|
<label for="asset_tag" class="col-md-3 control-label">{{ trans('admin/hardware/form.tag') }}</label>
|
||||||
|
@ -41,30 +40,16 @@
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
@include ('partials.forms.edit.serial', ['fieldname'=> 'serials[1]', 'translated_serial' => trans('admin/hardware/form.serial')])
|
|
||||||
|
|
||||||
<div class="input_fields_wrap">
|
<div class="input_fields_wrap">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
@include ('partials.forms.edit.model-select', ['translated_name' => trans('admin/hardware/form.model'), 'fieldname' => 'model_id', 'field_req' => true])
|
@include ('partials.forms.edit.model-select', ['translated_name' => trans('admin/hardware/form.model'), 'fieldname' => 'model_id', 'field_req' => true])
|
||||||
|
@include ('partials.forms.edit.serial', ['fieldname'=> 'serials[1]', 'translated_serial' => trans('admin/hardware/form.serial')])
|
||||||
|
|
||||||
|
|
||||||
<div id='custom_fields_content'>
|
|
||||||
<!-- Custom Fields -->
|
|
||||||
@if ($item->model && $item->model->fieldset)
|
|
||||||
<?php $model=$item->model; ?>
|
|
||||||
@endif
|
|
||||||
@if (Request::old('model_id'))
|
|
||||||
<?php $model=\App\Models\AssetModel::find(Request::old('model_id')); ?>
|
|
||||||
@elseif (isset($selected_model))
|
|
||||||
<?php $model=$selected_model; ?>
|
|
||||||
@endif
|
|
||||||
@if (isset($model) && $model)
|
|
||||||
@include("models/custom_fields_form",["model" => $model])
|
|
||||||
@endif
|
|
||||||
</div>
|
|
||||||
|
|
||||||
@include ('partials.forms.edit.status', [ 'required' => 'true'])
|
@include ('partials.forms.edit.status', [ 'required' => 'true'])
|
||||||
@if (!$item->id)
|
@if (!$item->id)
|
||||||
@include ('partials.forms.checkout-selector', ['user_select' => 'true','asset_select' => 'true', 'location_select' => 'true', 'style' => 'display:none;'])
|
@include ('partials.forms.checkout-selector', ['user_select' => 'true','asset_select' => 'true', 'location_select' => 'true', 'style' => 'display:none;'])
|
||||||
|
@ -76,23 +61,8 @@
|
||||||
@include ('partials.forms.edit.datepicker', ['translated_name' => trans('admin/hardware/form.expected_checkin'),'fieldname' => 'expected_checkin'])
|
@include ('partials.forms.edit.datepicker', ['translated_name' => trans('admin/hardware/form.expected_checkin'),'fieldname' => 'expected_checkin'])
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
@include ('partials.forms.edit.name', ['translated_name' => trans('admin/hardware/form.name')])
|
|
||||||
@include ('partials.forms.edit.purchase_date')
|
|
||||||
@include ('partials.forms.edit.supplier-select', ['translated_name' => trans('general.supplier'), 'fieldname' => 'supplier_id'])
|
|
||||||
@include ('partials.forms.edit.order_number')
|
|
||||||
<?php
|
|
||||||
$currency_type=null;
|
|
||||||
if ($item->id && $item->location) {
|
|
||||||
$currency_type = $item->location->currency;
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
@include ('partials.forms.edit.purchase_cost', ['currency_type' => $currency_type])
|
|
||||||
@include ('partials.forms.edit.warranty')
|
|
||||||
@include ('partials.forms.edit.notes')
|
@include ('partials.forms.edit.notes')
|
||||||
|
|
||||||
@include ('partials.forms.edit.location-select', ['translated_name' => trans('admin/hardware/form.default_location'), 'fieldname' => 'rtd_location_id'])
|
@include ('partials.forms.edit.location-select', ['translated_name' => trans('admin/hardware/form.default_location'), 'fieldname' => 'rtd_location_id'])
|
||||||
|
|
||||||
|
|
||||||
@include ('partials.forms.edit.requestable', ['requestable_text' => trans('admin/hardware/general.requestable')])
|
@include ('partials.forms.edit.requestable', ['requestable_text' => trans('admin/hardware/general.requestable')])
|
||||||
|
|
||||||
<!-- Image -->
|
<!-- Image -->
|
||||||
|
@ -113,6 +83,61 @@
|
||||||
|
|
||||||
@include ('partials.forms.edit.image-upload')
|
@include ('partials.forms.edit.image-upload')
|
||||||
|
|
||||||
|
<div id='custom_fields_content'>
|
||||||
|
<!-- Custom Fields -->
|
||||||
|
@if ($item->model && $item->model->fieldset)
|
||||||
|
<?php $model=$item->model; ?>
|
||||||
|
@endif
|
||||||
|
@if (Request::old('model_id'))
|
||||||
|
<?php $model=\App\Models\AssetModel::find(Request::old('model_id')); ?>
|
||||||
|
@elseif (isset($selected_model))
|
||||||
|
<?php $model=$selected_model; ?>
|
||||||
|
@endif
|
||||||
|
@if (isset($model) && $model)
|
||||||
|
@include("models/custom_fields_form",["model" => $model])
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group" >
|
||||||
|
<label class="col-md-3 control-label"></label>
|
||||||
|
<div class="col-md-2 col-sm-2 text-left form-check" style="z-index:1;">
|
||||||
|
<input class="form-check-input" type="checkbox" id="optional_info" >
|
||||||
|
<label class="form-check-label" for="flexCheckDefault">
|
||||||
|
{{ trans('admin/hardware/form.optional_infos') }}
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="optional_details" class="col-md-12">
|
||||||
|
@include ('partials.forms.edit.name', ['translated_name' => trans('admin/hardware/form.name')])
|
||||||
|
@include ('partials.forms.edit.warranty')
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-md-3 control-label"></label>
|
||||||
|
<div class="col-md-2 col-sm-2 text-left form-check" style="z-index:2;">
|
||||||
|
<input class="form-check-input" type="checkbox" id="order_info" >
|
||||||
|
<label class="form-check-label" for="flexCheckDefault">
|
||||||
|
{{ trans('admin/hardware/form.order_details') }}
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id='order_details' class="col-md-12" style="z-index:1;">
|
||||||
|
@include ('partials.forms.edit.order_number')
|
||||||
|
@include ('partials.forms.edit.purchase_date')
|
||||||
|
@include ('partials.forms.edit.supplier-select', ['translated_name' => trans('general.supplier'), 'fieldname' => 'supplier_id'])
|
||||||
|
|
||||||
|
<?php
|
||||||
|
$currency_type=null;
|
||||||
|
if ($item->id && $item->location) {
|
||||||
|
$currency_type = $item->location->currency;
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
@include ('partials.forms.edit.purchase_cost', ['currency_type' => $currency_type])
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
@stop
|
@stop
|
||||||
|
|
||||||
@section('moar_scripts')
|
@section('moar_scripts')
|
||||||
|
@ -278,6 +303,32 @@
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$( document ).ready(function() {
|
||||||
|
checkOrderDetailOption();
|
||||||
|
checkOptionalOption();
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#order_info').change(function(){
|
||||||
|
checkOrderDetailOption();
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#optional_info').change(function(){
|
||||||
|
checkOptionalOption();
|
||||||
|
});
|
||||||
|
|
||||||
|
function checkOptionalOption(){
|
||||||
|
if ($("#optional_info").prop('checked')==true) {
|
||||||
|
$('#optional_details').fadeIn('slow');
|
||||||
|
} else {
|
||||||
|
$('#optional_details').fadeOut('slow');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function checkOrderDetailOption(){
|
||||||
|
if ($("#order_info").prop('checked')==true) {
|
||||||
|
$('#order_details').fadeIn('slow');
|
||||||
|
} else {
|
||||||
|
$('#order_details').fadeOut('slow');
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
@stop
|
@stop
|
||||||
|
|
Loading…
Reference in a new issue