[Feature Request] Fixes #2030 - allow asset name change on checkin

This commit is contained in:
snipe 2016-05-12 12:34:44 -07:00
parent a96947efa9
commit 6d91774943
2 changed files with 7 additions and 5 deletions

View file

@ -524,6 +524,7 @@ class AssetsController extends Controller
$asset->last_checkout = null;
$asset->assigned_to = null;
$asset->accepted = null;
$asset->name = e(Input::get('name'));
if (Input::has('status_id')) {

View file

@ -29,6 +29,7 @@
</div><!-- /.box-header -->
<div class="box-body">
<div class="col-md-12">
@if ($backto=='user')
<form class="form-horizontal" method="post" action="{{ route('checkin/hardware', array('assetId'=> $asset->id, 'backto'=>'user')) }}" autocomplete="off">
@ -50,17 +51,17 @@
</div>
@endif
@if ($asset->name)
<!-- Asset name -->
<!-- Asset Name -->
<div class="form-group {{ $errors->has('name') ? 'error' : '' }}">
<div class="col-md-3">
{{ Form::label('name', trans('admin/hardware/form.name')) }}
</div>
<div class="col-md-9">
<p class="form-control-static">{{ $asset->name }}</p>
<input class="form-control" type="text" name="name" id="name" value="{{ Input::old('name', $asset->name) }}" />
{!! $errors->first('name', '<span class="alert-msg"><i class="fa fa-times"></i> :message</span>') !!}
</div>
</div>
@endif
<!-- Status -->
<div class="form-group {{ $errors->has('status_id') ? 'error' : '' }}">
@ -101,7 +102,7 @@
</div>
</div>
</div>
<div class="box-footer">
<a class="btn btn-link" href="{{ URL::previous() }}"> {{ trans('button.cancel') }}</a>