From 4a77dee79c18f0e2ab155c7024234150ce98b808 Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 22 Jan 2015 14:16:09 -0800 Subject: [PATCH] Fixes #447 - added asset log entry on save --- app/controllers/admin/AssetsController.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/controllers/admin/AssetsController.php b/app/controllers/admin/AssetsController.php index d5d731bcffaf..0649e987834f 100755 --- a/app/controllers/admin/AssetsController.php +++ b/app/controllers/admin/AssetsController.php @@ -212,6 +212,15 @@ public function postCreate() // Was the asset created? if($asset->save()) { + + $logaction = new Actionlog(); + $logaction->asset_id = $asset->id; + $logaction->checkedout_to = $asset->assigned_to; + $logaction->asset_type = 'hardware'; + $logaction->user_id = Sentry::getUser()->id; + $logaction->note = e(Input::get('note')); + $log = $logaction->logaction('checkout'); + // Redirect to the asset listing page return Redirect::to("hardware")->with('success', Lang::get('admin/hardware/message.create.success')); }