From f5efc368a58e1b26689dadb285918b090b66eb59 Mon Sep 17 00:00:00 2001 From: snipe Date: Wed, 4 Feb 2015 08:51:03 -0800 Subject: [PATCH] Fixes #487 - maintained and purchase order in strict mode --- app/controllers/admin/LicensesController.php | 24 ++++++++++++++++++++ app/views/backend/licenses/edit.blade.php | 12 +++++++--- 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/app/controllers/admin/LicensesController.php b/app/controllers/admin/LicensesController.php index e9cc28a58f22..6bb1194a6ad2 100755 --- a/app/controllers/admin/LicensesController.php +++ b/app/controllers/admin/LicensesController.php @@ -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')); @@ -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'))) { diff --git a/app/views/backend/licenses/edit.blade.php b/app/views/backend/licenses/edit.blade.php index baa1442aa629..6c4ba3db78b4 100755 --- a/app/views/backend/licenses/edit.blade.php +++ b/app/views/backend/licenses/edit.blade.php @@ -155,9 +155,15 @@
-
- {{ Form::select('maintained', $maintained_list , Input::old('maintained', $license->maintained), array('class'=>'select2', 'style'=>'min-width:350px')) }} - {{ $errors->first('maintained', ' :message') }} + + +
+ {{ Form::Checkbox('maintained', '1', Input::old('maintained', $license->maintained)) }} + @lang('general.yes') + + + +