Feature Request: Toggle Requestable Asset Upon Check In/Out
Server (please complete the following information):
- Snipe-IT Version: v4.7.7
- OS: Ubuntu 18.04
- Web Server: Apache2
- PHP Version: v7.2.19
Is your feature request related to a problem? Please describe.
It is frustrating to have a user request an item that is already checked out.
Describe the solution you'd like
I would like to see the Requestable checkbox toggle when an asset is checked in/out.
Describe alternatives you've considered
As a workaround I go to the asset after it has been checked out and uncheck the Requestable checkbox. Once it is checked back in I will go back to the asset and check the Requestable checkbox.
I think that’s the wrong feature to request. An item is requestable or not, and that asset state shouldn’t change. We could consider adding a toggle that disallows people from requesting assets that are currently checked out, but in most of our use cases, that’s exactly the point of requesting an item. It’s not available now, but I want it when it becomes available.
In my situation, I have a room full of computers and hardware. If it is available, I want the user to be able to request the item, I approve the request (checkout), and then I go get the item and deliver it to them. Once the item is out of the inventory room and checked out in the Snipe-IT app, no other user can request that item.
Basically, if it is available, it is requestable. If has been checked out, then they can't even see that it exists.
My permission settings for users are "View Requestable...Granted" and all other permissions Denied.
But if it’s not available, wouldn’t you want the user to be able to request it so they get it when it becomes available? That was the spirit behind requestable assets when I wrote it.
In my case, no.
I can see your point of why it works that way now.
However, in my situation, there will be years that a person will hold onto a computer before they check it back in for an upgrade or if they leave the company. Then, if someone would like that computer for office use, they can request it and take possession of it. Other times, someone might need the computer for a single experiment and then turn it back in when they are done.
What I'm getting at with this feature is, I don't want someone to call "dibs" on a computer and then I have to stare at a request for years on someone else's computer.
That’s a fair request, and I thank you for sharing your use case. I’m not sure toggling requestable state on checkout is the right solution here, but let me chew on it a bit. This feels more like a general setting to me, but needs more thinking.
That would be awesome if you figured out a solution. It doesn't necessarily have to be toggling the Requestable state. Just some way that a user can only request items that are not checked out by another user already. In other words, they can only request items that are sitting in my inventory room. Only when an item gets checked back into the inventory room can a user request that item.
I think an “only free assets can be requested” toggle in settings might be a better solution. Lots of code needs to be changed to accommodate that (also use cases - if something is requested by 10 people, should the requests be cleared once it’s checked out? Would work for your use case but not everyone’s) but I think we could implement this.
Is this still relevant? We haven't heard from anyone in a bit. If so, please comment with any updates or additional detail. This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Don't take it personally, we just need to keep a handle on things. Thank you for your contributions!
Still interested
Okay, it looks like this issue or feature request might still be important. We'll re-open it for now. Thank you for letting us know!
I actually added a few lines of code to get around this exact issue for my company's needs.
BEFORE DOING THIS BACKUP THE FILES.
Also, you may need to add:
use App\models\AssetModel;
To each file at the top with the other "use" helpers. I cannot remember if I added it myself.
In the files for checkout and checkin controller i added the following:
file: ~\snipeit\app\Http\Controllers\AssetCheckinController.php: placed on line 70 right after $asset->name = $request->get('name');
$model = AssetModel::find(e($asset->model_id)); if($model->category_id == 2){ $asset->requestable = '1'; }
This says that if the model is a specific category, that when you press the checkin button to make the item requestable again.
Alternatively, the opposite would be this for checkout: file: ~\snipeit\app\Http\Controllers\AssetCheckinController.php: placed on line 84 right after $expected_checkin = $request->get('expected_checkin');
$model = AssetModel::find(e($asset->model_id)); if($model->category_id == 2){ $asset->requestable = '1'; }
This will make items of category id 2 no longer requestable once the checkout button is pressed.
This has worked great for us so far and only does it for items under a specific category. To get the category ID I went into the SQL Database and just checked the id code there.
Is this still relevant? We haven't heard from anyone in a bit. If so, please comment with any updates or additional detail. This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Don't take it personally, we just need to keep a handle on things. Thank you for your contributions!
Still interested
Okay, it looks like this issue or feature request might still be important. We'll re-open it for now. Thank you for letting us know!
Still interested
Did you see my reply?
Is this still relevant? We haven't heard from anyone in a bit. If so, please comment with any updates or additional detail. This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Don't take it personally, we just need to keep a handle on things. Thank you for your contributions!
Still interested
Okay, it looks like this issue or feature request might still be important. We'll re-open it for now. Thank you for letting us know!
Is this still relevant? We haven't heard from anyone in a bit. If so, please comment with any updates or additional detail. This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Don't take it personally, we just need to keep a handle on things. Thank you for your contributions!
Still interested.
Okay, it looks like this issue or feature request might still be important. We'll re-open it for now. Thank you for letting us know!
Is this still relevant? We haven't heard from anyone in a bit. If so, please comment with any updates or additional detail. This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Don't take it personally, we just need to keep a handle on things. Thank you for your contributions!
Still interested
Okay, it looks like this issue or feature request might still be important. We'll re-open it for now. Thank you for letting us know!
Is this still relevant? We haven't heard from anyone in a bit. If so, please comment with any updates or additional detail. This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Don't take it personally, we just need to keep a handle on things. Thank you for your contributions!
Still interested
Okay, it looks like this issue or feature request might still be important. We'll re-open it for now. Thank you for letting us know!
I think an “only free assets can be requested” toggle in settings might be a better solution. Lots of code needs to be changed to accommodate that (also use cases - if something is requested by 10 people, should the requests be cleared once it’s checked out? Would work for your use case but not everyone’s) but I think we could implement this.
This would be very helpfull, in my case I have 4 boxes of 20 headsets and those boxes can be requested. But if they are requested this means that it is unavailable and cannot be used by request button unavailable when the asset is checked out.
Also on a side note;
When a user requests an asset and the asset is checked out to them, the requested asset will remain in the requested section.
Could a simple remove / decline request feature solve this issue ?
Thank you for your help @snipe
This is a feature I would still like to see. My idea of the implementation would be this:
If a user checks the "Requestable" check box on an asset, a radio button expands with the two options of "Requestable when available" and "Requestable always"
I'm very interested in this feature too. is there any hope of seeing it in version 7?