mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-25 20:51:30 -08:00
Added location to checkout method
This commit is contained in:
parent
1c12b6e13b
commit
b786791401
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue