Skip to content

Commit

Permalink
Fixed #8726 - disallow archived assets to be checked out
Browse files Browse the repository at this point in the history
  • Loading branch information
snipe committed Nov 12, 2020
1 parent 8a65081 commit f0e04ab
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/Models/Asset.php
Original file line number Diff line number Diff line change
Expand Up @@ -244,11 +244,12 @@ public function company()
*/
public function availableForCheckout()
{
\Log::debug($this->assetstatus);
if (
(!$this->assignedTo) ||
((!$this->assignedTo) && ($this->assetstatus->archived == 0)) ||
((empty($this->assigned_to)) &&
(empty($this->deleted_at)) &&
(($this->assetstatus) && ($this->assetstatus->deployable == 1))))
(($this->assetstatus) && ($this->assetstatus->deployable == 1))))
{
return true;
}
Expand Down

1 comment on commit f0e04ab

@magiausde
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can confirm this working for archived assets, but undeployable assets can still be checked out

Please sign in to comment.