From f363e742e69f03eef0c90227d6c7ac361bacb09a Mon Sep 17 00:00:00 2001 From: madd15 Date: Tue, 7 Jul 2015 12:30:55 +0930 Subject: [PATCH] Add getFreeLicense Picks free seat for license and redirects to checkout specific seat --- app/controllers/admin/LicensesController.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/controllers/admin/LicensesController.php b/app/controllers/admin/LicensesController.php index bcdbdca1c7..f27993133d 100755 --- a/app/controllers/admin/LicensesController.php +++ b/app/controllers/admin/LicensesController.php @@ -908,4 +908,14 @@ class LicensesController extends AdminController ->orderColumns('name','serial','totalSeats','remaining','purchase_date','actions') ->make(); } + + public function getFreeLicense($licenseId) { + // Check if the asset exists + if (is_null($license = License::find($licenseId))) { + // Redirect to the asset management page with error + return Redirect::to('admin/licenses')->with('error', Lang::get('admin/licenses/message.not_found')); + } + $seatId = $license->freeSeat($licenseId); + return Redirect::to('admin/licenses/'.$seatId.'/checkout'); + } }