The ILS DI web service is a handy way for a third party system, such as a mobile app, to check for the availability of items for a given bib record in your system. If you make a call like https://{OPAC_DOMAIN}/cgi-bin/koha/ilsdi.pl?service=GetAvailability&id={BIB_ID}&id_type=bib the response shows the availabilitystatus of items that are on the holds shelf or in transit as 'available'. While these items may be technically available to be checked out, it's not ideal to send the message to patrons that these items are available because they may show up at the library to get the book and be disappointed :( It would be more accurate and informative if ILS DI could show availabilitystatus 'not available' with availabilitymsg indicating 'on hold shelf' or 'in transit' for these items. Alternatively it would be nice to have a REST API endpoint for item availability to easily get this info to third party developers.
Just adding here that I found out the ILS DI service does have info on reserves in the response to GetRecords, you can see items on the hold shelf in <reserves> if you see <found>W</found> or a <waitingdate> then you know the item is on the hold shelf
Created attachment 160060 [details] [review] Bug 34950: Add availability statuses for in transit and on hold items. To test: 1. Enable the ILS-DI system preference. 2. Place a hold for a patron and put it in transit. Place another hold for a patron that is available for pickup at the local branch. And then select an item that is available for checkout but don’t change the status for it. 3. Go to your testing OPAC and make an ILS-DI “Get Availability” call using the item ids of the three items you worked with in step 2. (i.e. http://localhost:8080/cgi-bin/koha/ilsdi.pl?service=GetAvailability&id=321+323+214&id_type=item) 4. Notice that the availability status for all three items is showing as available. The item in transit and the item with a local hold should have a status of not available and a message of why they are not available. 5. Apply the patch 6. Use restart_all. 7. Refresh the page and notice that the statuses are now correct. The item in transit has a status of not available and an availability message of “In transit”. The item with the local hold has an availability status of not available with an availability message of “On hold”. Finally the available item is correctly showing up as available. 8. Sign off and have a wonderful day. :)
Created attachment 160131 [details] [review] Bug 34950: Add availability statuses for in transit and on hold items. To test: 1. Enable the ILS-DI system preference. 2. Place a hold for a patron and put it in transit. Place another hold for a patron that is available for pickup at the local branch. And then select an item that is available for checkout but don’t change the status for it. 3. Go to your testing OPAC and make an ILS-DI “Get Availability” call using the item ids of the three items you worked with in step 2. (i.e. http://localhost:8080/cgi-bin/koha/ilsdi.pl?service=GetAvailability&id=321+323+214&id_type=item) 4. Notice that the availability status for all three items is showing as available. The item in transit and the item with a local hold should have a status of not available and a message of why they are not available. 5. Apply the patch 6. Use restart_all. 7. Refresh the page and notice that the statuses are now correct. The item in transit has a status of not available and an availability message of “In transit”. The item with the local hold has an availability status of not available with an availability message of “On hold”. Finally the available item is correctly showing up as available. 8. Sign off and have a wonderful day. :) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
In testing I also learned that you can make a call for multiple items at once like this http://localhost:8080/cgi-bin/koha/ilsdi.pl?service=GetAvailability&id=321+323+214&id_type=item Thanks Laura!
*** Bug 32049 has been marked as a duplicate of this bug. ***
Hi Brendan. Could you change the status to "Signed Off"? That way, you will get the credit on the dashboard (https://dashboard.koha-community.org/). David
I thought I did change the status when I added the last comment, but it reverted somehow, or I otherwise messed that up :) Thanks! (In reply to David Nind from comment #6) > Hi Brendan. > > Could you change the status to "Signed Off"? > > That way, you will get the credit on the dashboard > (https://dashboard.koha-community.org/). > > David
Created attachment 161029 [details] [review] Bug 34950: Add availability statuses for in transit and on hold items. To test: 1. Enable the ILS-DI system preference. 2. Place a hold for a patron and put it in transit. Place another hold for a patron that is available for pickup at the local branch. And then select an item that is available for checkout but don’t change the status for it. 3. Go to your testing OPAC and make an ILS-DI “Get Availability” call using the item ids of the three items you worked with in step 2. (i.e. http://localhost:8080/cgi-bin/koha/ilsdi.pl?service=GetAvailability&id=321+323+214&id_type=item) 4. Notice that the availability status for all three items is showing as available. The item in transit and the item with a local hold should have a status of not available and a message of why they are not available. 5. Apply the patch 6. Use restart_all. 7. Refresh the page and notice that the statuses are now correct. The item in transit has a status of not available and an availability message of “In transit”. The item with the local hold has an availability status of not available with an availability message of “On hold”. Finally the available item is correctly showing up as available. 8. Sign off and have a wonderful day. :) Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Works, makes sense, QA script happy, code looks good, passing QA :)
Small style tip: If you break the lines a bit more, the commit message will be easier to read on CLI and maybe in other spots :)
Pushed for 24.05! Well done everyone, thank you!
Pushed to 23.11.x for 23.11.02
Backported to 23.05.x for upcoming 23.05.09