Add "limit to available" option in OPAC record view

Bug #1853006 reported by Ruth Frasur
34
This bug affects 6 people
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
Wishlist
Unassigned

Bug Description

Users should have the ability to filter copy results in record page to only those with an "available" status.

Lynn Floyd (lfloyd)
tags: added: wishlist
Revision history for this message
Elizabeth Thomsen (et-8) wrote :

It's possible to limit a search to show only bibs with available copies, but when you're looking at a bib record, it's not possible to limit the display of items to show only the available copies. This is a big problem for records with lots of copies with many copies checked out, like bestsellers. For example, right now in CW MARS, only 9 of 488 copies are currently available. Even using the option to page through 50 items at a time, it takes a lot of paging and scanning through items to spot the available copies. http://catalog.cwmars.org/eg/opac/record/4198697?copy_limit=50

Revision history for this message
Ruth Frasur (rfrasur) wrote :

This proposed feature has been selected as a development project by the Evergreen Community Development Initiative. The ECDI has compiled and refined a set of requirements and seeks proposals including specifications and project cost/time estimates from interested and able parties to develop this feature.

Those requirements and additional information are available at https://docs.google.com/document/d/1Ijlnp1DmyFmstZAlZM0OcnDOsRcm1WabBg5AMWLAj7Q/

Lynn Floyd (lfloyd)
Changed in evergreen:
importance: Undecided → Wishlist
Revision history for this message
Zavier (zavierbanks) wrote :

Here's the branch for the newly added "limit to available" component.
https://git.evergreen-ils.org/?p=working/Evergreen.git;a=commit;h=ca1e3b3f0f01b54bde06b40218b06e7362fcdddd

Ready for review.

tags: added: pullrequest
Revision history for this message
Mike Rylander (mrylander) wrote :

Hi Zavier,

I wonder if, in the adjustment to the WHERE clause added to mk_copy_query, the test should be for statuses that have the is_available flag set to true rather than testing for the id of 0 specifically?

Also, and I admit I have not confirmed it's possible, could the overwriting of the WHERE clause in its entirety be blowing away some clause added by the call of $U->basic_opac_copy_query()? I have a vague memory of a bug in that area before (and may have been the one that caused it).

Revision history for this message
Zavier (zavierbanks) wrote :

Here's the updated branch:
https://git.evergreen-ils.org/?p=working/Evergreen.git;a=commit;h=495605b7ff9e4e090222dd7fc3119398f14d83d7

I don't know how to check for that bug, but I pretty much copied the WHERE clause with an added field.

Revision history for this message
Mike Rylander (mrylander) wrote :

Thanks, Zavier

Since you're moving part of the required logic into basic_opac_copy_query() to get the flag out, perhaps we should just move the rest into basic_opac_copy_query() and have it be driven by an optional parameter, just like the staff flag. With that change other callers can benefit from the ability to filter by copy availability in the future.

Thoughts?

Revision history for this message
Zavier (zavierbanks) wrote :

Mike Rylander,

If I'm understanding you right, I kept most logic in the Record.pm to keep up consistency with the already established code. I tried to keep from changing any of the AppUtils as much as possible, just in case there is some kind of bug.

As long as the "available" parameter is in the url. It should filter by copy availability.

Revision history for this message
Ruth Frasur (rfrasur) wrote :

While not to do with the functionality, there has been some conversation about the styling of the "limit to available" feature which appears as a link. With the thought that eventual styling of the OPAC will follow in the vein of Chris Burton's work (https://bugs.launchpad.net/evergreen/+bug/1778972), it seems appropriate that the "Show Only Available Copies" might look similar to the "More Details" button in the test OPAC provided by Chris. https://test.nflibrary.ca/eg/opac/record/158047?locg=101

Revision history for this message
Ruth Frasur (rfrasur) wrote :

As well as the "Show All Copies."

Revision history for this message
Ruth Frasur (rfrasur) wrote :

I have tested this code and consent to signing off on it with my name, rfrasur, and my email address, <email address hidden>.

tags: added: signedoff
Revision history for this message
Elaine Hardy (ehardy) wrote :

I also tested this code and consent to signing off on it with my name, Elaine Hardy, and my email address, <email address hidden>.

I want to note something here that was out of scope of the development but might be considered a wish list item later. When you limit to available at the results or initial search level, it does filter out any bib record with no available copies as always. You have to filter again at the bib record level to filter out unavailable copies.

I can see users wanting/expecting the filter to carry through to the bib level when set at earlier points. Again, out of scope of the development but might be something to address later. I will keep in mind in order to post as a wish list item once this is live.

Galen Charlton (gmc)
Changed in evergreen:
milestone: none → 3.next
Michele Morgan (mmorgan)
Changed in evergreen:
milestone: 3.next → 3.7-beta
Revision history for this message
Terran McCanna (tmccanna) wrote :

Since this has already been signed off, I created a new bug for adding it to the Bootstrap OPAC: https://bugs.launchpad.net/evergreen/+bug/1908612

Galen Charlton (gmc)
Changed in evergreen:
assignee: nobody → Galen Charlton (gmc)
Revision history for this message
Galen Charlton (gmc) wrote :

Noting that the patch needs to be rebased.

Changed in evergreen:
assignee: Galen Charlton (gmc) → nobody
Michele Morgan (mmorgan)
Changed in evergreen:
assignee: nobody → Michele Morgan (mmorgan)
Revision history for this message
Kyle Huckins (khuckins) wrote :
Revision history for this message
Galen Charlton (gmc) wrote :

Eh, the rebase has compilation errors:

$ perl -c Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm
Missing right curly or square bracket at Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm line 882, at end of line
syntax error at Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm line 882, at EOF
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm had compilation errors.

Adding needsrepatch.

tags: added: needsrepatch
removed: signedoff
Revision history for this message
Kyle Huckins (khuckins) wrote :

Thanks for the catch, erroneously kept an old version of a line in that already existed. Force pushed over the rebase

tags: removed: needsrepatch
Revision history for this message
Michele Morgan (mmorgan) wrote :

Unfortunately, after applying this patch, I get an Internal Server Error when attempting to load the TPAC.

tags: added: needsrepatch
Changed in evergreen:
assignee: Michele Morgan (mmorgan) → nobody
Revision history for this message
Kyle Huckins (khuckins) wrote :

With the recent rebase, I'm not encountering any internal server errors, I'm wondering if the branch you have loaded up is the prior rebase, which would result in said error. As it was force-pushed that could cause issues in ensuring the latest code is loaded up - this branch is, code-wise, the same as the latest rebase: https://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/collab/khuckins/lp1853006-add-limit-to-available-rebase-2

Michele Morgan (mmorgan)
Changed in evergreen:
assignee: nobody → Michele Morgan (mmorgan)
Revision history for this message
Michele Morgan (mmorgan) wrote :

This latest rebase is working for me now, adding a 'Show All Copies'/'Show Only Available Copies' toggle at the head of the item table in the TPAC.

I've pushed a signoff branch with an additional commit to allow translation of the toggle labels. Branch is here:

https://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/mmorgan/lp1853006_signoff

user/mmorgan/lp1853006_signoff

Also opened bug 1919485 to add this functionality to the Angular staff catalog.

tags: removed: needsrepatch
Changed in evergreen:
assignee: Michele Morgan (mmorgan) → nobody
Galen Charlton (gmc)
tags: added: signedoff
Revision history for this message
Galen Charlton (gmc) wrote :

Committed for inclusion in 3.7. Thanks, Zavier, Michele, and Kyle.

Changed in evergreen:
status: New → Fix Committed
Changed in evergreen:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers
https://bugs.launchpad.net/evergreen/+bug/1853006
bugs.launchpad.net
crawl=CC-MAIN-2022-49
101697
application/http; msgtype=response
sha1:V5JQ4BSZUJ5KLV5JW66MTZG56BRJNBSJ
<urn:uuid:ad0d1fd5-ae6f-4fd2-a46f-c4f9f74c8294>
2022-12-03T13:48:42Z
185.125.189.225
application/xhtml+xml
sha1:SB5EQ3KMLZCWGG5HP23PKO6O3J6HZ5SQ
<urn:uuid:70c818d1-6f34-47da-9541-9398974f2da0>
https://bugs.launchpad.net/evergreen/+bug/1853006
response
<urn:uuid:76fc9383-68ab-4e6e-a2f7-1b6905ff8508>
isPartOf: CC-MAIN-2022-49
publisher: Common Crawl
description: Wide crawl of the web for November/December 2022
operator: Common Crawl Admin (info@commoncrawl.org)
hostname: ip-10-67-67-182
software: Apache Nutch 1.19 (modified, https://github.com/commoncrawl/nutch/)
robots: checked via crawler-commons 1.4-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)
format: WARC File Format 1.1
conformsTo: https://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/