mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-10 23:54:12 -08:00
Merge remote-tracking branch 'origin/develop'
This commit is contained in:
commit
ff341caf34
|
@ -121,7 +121,7 @@ class AssetImporter extends ItemImporter
|
||||||
|
|
||||||
// If we have a target to checkout to, lets do so.
|
// If we have a target to checkout to, lets do so.
|
||||||
if(isset($target)) {
|
if(isset($target)) {
|
||||||
$asset->fresh()->checkOut($target, $this->user_id);
|
$asset->fresh()->checkOut($target);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -279,7 +279,7 @@ class Asset extends Depreciable
|
||||||
* @since [v3.0]
|
* @since [v3.0]
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public function checkOut($target, $admin_id = null, $checkout_at = null, $expected_checkin = null, $note = null, $name = null, $location = null)
|
public function checkOut($target, $admin = null, $checkout_at = null, $expected_checkin = null, $note = null, $name = null, $location = null)
|
||||||
{
|
{
|
||||||
if (!$target) {
|
if (!$target) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -313,13 +313,8 @@ class Asset extends Depreciable
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->save()) {
|
if ($this->save()) {
|
||||||
if(isset($admin_id)){
|
|
||||||
$checkedOutBy = User::find($admin_id);
|
|
||||||
|
|
||||||
event(new CheckoutableCheckedOut($this, $target, $checkedOutBy, $note));
|
|
||||||
} else {
|
|
||||||
event(new CheckoutableCheckedOut($this, $target, Auth::user(), $note));
|
event(new CheckoutableCheckedOut($this, $target, Auth::user(), $note));
|
||||||
}
|
|
||||||
|
|
||||||
$this->increment('checkout_counter', 1);
|
$this->increment('checkout_counter', 1);
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in a new issue