From b78679140132686da93359cf2a03399b99cb3023 Mon Sep 17 00:00:00 2001 From: snipe Date: Fri, 3 Nov 2017 19:39:48 -0700 Subject: [PATCH] Added location to checkout method --- app/Models/Asset.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/Models/Asset.php b/app/Models/Asset.php index df0905ba52..89735ad999 100644 --- a/app/Models/Asset.php +++ b/app/Models/Asset.php @@ -144,7 +144,7 @@ class Asset extends Depreciable * @return bool */ //FIXME: The admin parameter is never used. Can probably be removed. - public function checkOut($target, $admin = null, $checkout_at = null, $expected_checkin = null, $note = null, $name = null) + public function checkOut($target, $admin = null, $checkout_at = null, $expected_checkin = null, $note = null, $name = null, $location = null) { if (!$target) { return false; @@ -163,6 +163,10 @@ class Asset extends Depreciable $this->name = $name; } + if ($location != null) { + $this->location_id = $location; + } + if ($this->requireAcceptance()) { if(get_class($target) != User::class) { throw new CheckoutNotAllowed;