Bug 29706

Summary: When placing a request on the opac, the user is shown titles they cannot place a hold on
Product: Koha Reporter: Nick Clemens (kidclamp) <nick>
Component: OPACAssignee: Nick Clemens (kidclamp) <nick>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: andrew, jonathan.druart, kyle, victor
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
22.05.00,21.11.03,21.05.13
Circulation function:
Attachments: Bug 29706: Improve table elements
Bug 29706: Hide items that cannot be held by default when placing hold on OPAC
Bug 29706: Hide items that cannot be held by default when placing hold on OPAC
Bug 29706: Improve table elements
Bug 29706: Hide items that cannot be held by default when placing hold on OPAC
Bug 29706: (follow-up) Adjust code to work for multi-holds
Bug 29706: Improve table elements
Bug 29706: Hide items that cannot be held by default when placing hold on OPAC
Bug 29706: (follow-up) Adjust code to work for multi-holds

Description Nick Clemens (kidclamp) 2021-12-16 01:59:42 UTC
When a user is placing a hold in a consortium, there may be many items on a record that cannot be held.

We display these items which can cause the need for scrolling to get to items that can be held.
Comment 1 Nick Clemens (kidclamp) 2021-12-16 02:06:50 UTC
Created attachment 128580 [details] [review]
Bug 29706: Improve table elements

This patch add a thead and tbody element to the 'copiesrow' table
Comment 2 Nick Clemens (kidclamp) 2021-12-16 02:06:53 UTC Comment hidden (obsolete)
Comment 3 The Minh Luong 2022-01-07 16:19:03 UTC Comment hidden (obsolete)
Comment 4 Jonathan Druart 2022-02-08 09:11:23 UTC Comment hidden (obsolete)
Comment 5 Jonathan Druart 2022-02-08 09:11:27 UTC Comment hidden (obsolete)
Comment 6 Jonathan Druart 2022-02-08 09:12:34 UTC
I would have put the button at the top of the table, but not considering blocker.
Comment 7 Jonathan Druart 2022-02-08 09:14:45 UTC
It actually does not work for multi holds, the button will show/hide the items for the other biblios as well.
Comment 8 Nick Clemens (kidclamp) 2022-02-08 12:30:48 UTC Comment hidden (obsolete)
Comment 9 Jonathan Druart 2022-02-08 15:50:15 UTC
Created attachment 130297 [details] [review]
Bug 29706: Improve table elements

This patch add a thead and tbody element to the 'copiesrow' table

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 10 Jonathan Druart 2022-02-08 15:50:19 UTC
Created attachment 130298 [details] [review]
Bug 29706: Hide items that cannot be held by default when placing hold on OPAC

This patch adds a 'holdable' and 'unholdable' class to the rows of the table

Additionally I rename the 'backgroundcolor' field to 'onloan' as that is what it contains.
Note: Out of the box, there is no css associated with this class

I add a div around the table to allow hiding the new buttons as well when optiuons are hidden

It would be nice in the future to utilise a Koha table here, however, it is complicated by multi-holds

To test:
 1 - Add a number of items to a record, ensuring they belong to different libraries
 2 - Set 'Default checkout, hold and return policy'->'Hold policy' to 'From home library'
 3 - Sign in to opac and attempt to placehold on the record
 4 - Click 'show more options' and 'a specificitem'
 5 - Note holds table includes items that cannot be held
 6 - Apply patch
 7 - Reload holds page
 8 - Note items that cannot be heldare hidden
 9 - Click 'Show unholdable items' and note they appear
10 - Click 'Hide unholdable items' and veriofy they hide
11 - Test with multi holds

Signed-off-by: The Minh Luong <the-minh.luong@inlibro.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 11 Jonathan Druart 2022-02-08 15:50:23 UTC
Created attachment 130299 [details] [review]
Bug 29706: (follow-up) Adjust code to work for multi-holds

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 12 Fridolin Somers 2022-02-16 21:52:25 UTC
Pushed to master for 22.05, thanks to everybody involved ﷐[U+1F984]﷑
Comment 13 Kyle M Hall (khall) 2022-02-18 12:51:24 UTC
Pushed to 21.11.x for 21.11.03
Comment 14 Andrew Fuerste-Henry 2022-03-04 17:14:50 UTC
Pushed to 21.05.x for 21.05.12
Comment 15 Victor Grousset/tuxayo 2022-03-18 02:32:24 UTC
Not backported to oldoldstable (20.11.x). Feel free to ask if it's needed.