Bug 22752

Summary: Show item-level hold details for patrons when logged into their account
Product: Koha Reporter: Christopher Brannon <cbrannon>
Component: OPACAssignee: Victoria Faafia <vfaafia29>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: caroline.cyr-la-rose, david, fridolin.somers, gmcharlt, jonathan.druart, katrin.fischer, martin.renvoize, vfaafia29
Version: masterKeywords: Academy, Manual
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
This enhancement to the OPAC shows a logged in patron what item a hold was placed on, for item-level holds ("Item on hold: <barcode>" is added after the title).
Version(s) released in:
21.05.00
Attachments: Bug 22752: Show if a placed hold is a record or item level in the patron account in the OPAC
Bug 22752: Show if a placed hold is a record or item level in the patron account in the OPAC
Bug 22752: Show if a placed hold is a record or item level in the patron account in the OPAC
Bug 22752: (QA follow-up) Add missing filters
Bug 22752: (follow-up) Add style; Only show message about item-level holds

Description Christopher Brannon 2019-04-22 21:10:59 UTC
When a patron is viewing the holds they've placed in opac-user.pl#opac-user-holds, it does not show the user if they have requested a specific item or the next available item.  The patron should be given the ability to see this information, in case they incorrectly placed a hold.
Comment 1 Victoria Faafia 2021-01-19 04:01:52 UTC
Created attachment 115294 [details] [review]
Bug 22752: Show if a placed hold is a record or item level in the patron account in the OPAC

Test Plan
1. Have a record with an item
2. You will need to set a hold through staff account (to import books
        Cataloging>New from Z39.50/SRU>
3. Keyword(enter any keyword e.g pokemon)
4. tick library of congress
5. choose a title and click actions then import
6. 003 should be OSt
7. tab 9 koha item type can be books or whatever and press save
8. select the hold and place hold
9. on Koha OPAC click on your account and go to the holds and
underneath the title it should say Only item and the barcode
Comment 2 David Nind 2021-01-19 10:39:27 UTC
Created attachment 115302 [details] [review]
Bug 22752: Show if a placed hold is a record or item level in the patron account in the OPAC

Test Plan
1. Have a record with an item
2. You will need to set a hold through staff account (to import books
        Cataloging>New from Z39.50/SRU>
3. Keyword(enter any keyword e.g pokemon)
4. tick library of congress
5. choose a title and click actions then import
6. 003 should be OSt
7. tab 9 koha item type can be books or whatever and press save
8. select the hold and place hold
9. on Koha OPAC click on your account and go to the holds and
underneath the title it should say Only item and the barcode

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 David Nind 2021-01-19 10:41:47 UTC
Testing notes:
- Worked as expected, I tested placing next available item and specific item holds
- Works fine without needing to add a new record and item (it worked fine with existing example records and items)
Comment 4 Martin Renvoize 2021-01-21 10:58:25 UTC
Created attachment 115526 [details] [review]
Bug 22752: Show if a placed hold is a record or item level in the patron account in the OPAC

Test Plan
1. Have a record with an item
2. You will need to set a hold through staff account (to import books
        Cataloging>New from Z39.50/SRU>
3. Keyword(enter any keyword e.g pokemon)
4. tick library of congress
5. choose a title and click actions then import
6. 003 should be OSt
7. tab 9 koha item type can be books or whatever and press save
8. select the hold and place hold
9. on Koha OPAC click on your account and go to the holds and
underneath the title it should say Only item and the barcode

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 5 Martin Renvoize 2021-01-21 10:58:28 UTC
Created attachment 115527 [details] [review]
Bug 22752: (QA follow-up) Add missing filters

For security, we filter all template variables.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 6 Martin Renvoize 2021-01-21 11:00:41 UTC
Thanks Victoria, 

I've added a minor follow-up to coax this through QA (https://wiki.koha-community.org/wiki/Coding_Guidelines#HTML9:_Filter_all_template_variables), but otherwise this looks great.

Passing QA
Comment 7 Jonathan Druart 2021-01-21 14:52:57 UTC
It's placed to close to the author in my opinion: https://snipboard.io/utPVk4.jpg
Maybe we should add a new line?
Comment 8 Owen Leonard 2021-01-21 15:17:53 UTC
Created attachment 115558 [details] [review]
Bug 22752: (follow-up) Add style; Only show message about item-level holds

I think it's generally assumed that a hold has, by default, been made at
the bibliographic level. I think it's sufficent to add a note for only
item-level holds.

To test, apply the patch and log into the OPAC as a user who has
multiple holds, some at the bibliographic level and some at the item
level.

- Go to Your summary --> Holds
- Confirm that any item-level hold has a note under the title: "Item on
  hold <barcode>".
- The note should be on a new line and styled differently than the other
  text.
Comment 9 Owen Leonard 2021-01-21 15:18:36 UTC
My follow-up goes further than just adding some style. I can submit a less-opinionated patch if folks prefer.
Comment 10 Jonathan Druart 2021-01-21 15:23:20 UTC
https://snipboard.io/D6JH5R.jpg

Thanks Owen!
Comment 11 Jonathan Druart 2021-01-21 15:25:05 UTC
Pushed to master for 21.05, thanks to everybody involved!
Comment 12 David Nind 2021-01-24 02:28:52 UTC
Updated the bug title to reflect the actual changes made, and added suggested text for the release notes.
Comment 13 Fridolin Somers 2021-01-25 15:39:06 UTC
Should we backport to 20.11.x ?