Skip to content

Commit

Permalink
Fixes #487 - maintained and purchase order in strict mode
Browse files Browse the repository at this point in the history
  • Loading branch information
snipe committed Feb 4, 2015
1 parent 1db806f commit f5efc36
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 3 deletions.
24 changes: 24 additions & 0 deletions app/controllers/admin/LicensesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,18 @@ public function postCreate()
$license->supplier_id = e(Input::get('supplier_id'));
}

if ( e(Input::get('maintained')) == '') {
$license->maintained = 0;
} else {
$license->maintained = e(Input::get('maintained'));
}

if ( e(Input::get('purchase_order')) == '') {
$license->purchase_order = '';
} else {
$license->purchase_order = e(Input::get('purchase_order'));
}

// Save the license data
$license->name = e(Input::get('name'));
$license->serial = e(Input::get('serial'));
Expand Down Expand Up @@ -252,6 +264,18 @@ public function postEdit($licenseId = null)
//$license->purchase_cost = e(Input::get('purchase_cost'));
}

if ( e(Input::get('maintained')) == '') {
$license->maintained = 0;
} else {
$license->maintained = e(Input::get('maintained'));
}

if ( e(Input::get('purchase_order')) == '') {
$license->purchase_order = '';
} else {
$license->purchase_order = e(Input::get('purchase_order'));
}


//Are we changing the total number of seats?
if( $license->seats != e(Input::get('seats'))) {
Expand Down
12 changes: 9 additions & 3 deletions app/views/backend/licenses/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,15 @@
<!-- Maintained -->
<div class="form-group {{ $errors->has('maintained') ? ' has-error' : '' }}">
<label for="maintained" class="col-md-3 control-label">@lang('admin/licenses/form.maintained')</label>
<div class="col-md-7">
{{ Form::select('maintained', $maintained_list , Input::old('maintained', $license->maintained), array('class'=>'select2', 'style'=>'min-width:350px')) }}
{{ $errors->first('maintained', '<span class="alert-msg"><i class="icon-remove-sign"></i> :message</span>') }}


<div class="col-md-7 input-group">
{{ Form::Checkbox('maintained', '1', Input::old('maintained', $license->maintained)) }}
@lang('general.yes')




</div>
</div>

Expand Down

0 comments on commit f5efc36

Please sign in to comment.