Log checkouts (#2772)

* Ensure the log has a target before trying to fetch the associated company

* Log creation of items, both in importer and manually
This commit is contained in:
Daniel Meltzer
2016-10-12 20:45:32 -05:00
committed by snipe
parent 219ef23126
commit e85241af6a
9 changed files with 37 additions and 3 deletions
@@ -100,6 +100,7 @@ class AccessoriesController extends Controller
// Was the accessory created?
if ($accessory->save()) {
$accessory->logCreate();
// Redirect to the new accessory page
return redirect()->to("admin/accessories")->with('success', trans('admin/accessories/message.create.success'));
}
+1 -1
View File
@@ -264,7 +264,7 @@ class AssetsController extends Controller
// Was the asset created?
if ($asset->save()) {
$asset->logCreate();
if (Input::get('assigned_to')!='') {
$user = User::find(e(Input::get('assigned_to')));
$asset->checkOutToUser($user, Auth::user(), date('Y-m-d H:i:s'), '', 'Checked out on asset creation', e(Input::get('name')));
@@ -107,6 +107,7 @@ class ComponentsController extends Controller
// Was the component created?
if ($component->save()) {
$component->logCreate();
// Redirect to the new component page
return redirect()->to("admin/components")->with('success', trans('admin/components/message.create.success'));
}
@@ -105,6 +105,7 @@ class ConsumablesController extends Controller
// Was the consumable created?
if ($consumable->save()) {
$consumable->logCreate();
// Redirect to the new consumable page
return redirect()->to("admin/consumables")->with('success', trans('admin/consumables/message.create.success'));
}
+1 -1
View File
@@ -155,7 +155,7 @@ class LicensesController extends Controller
// Was the license created?
if ($license->save()) {
$license->logCreate();
$insertedId = $license->id;
// Save the license seat data
DB::transaction(function () use (&$insertedId, &$license) {