Bug 37004

Summary: Staff search results: Add a HTML class ( branchcode ) to each item entry in the results list
Product: Koha Reporter: Lucas Gass (lukeg) <lucas>
Component: Staff interfaceAssignee: Lucas Gass (lukeg) <lucas>
Status: RESOLVED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: david, gmcharlt, martin.renvoize
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
This enhancement to staff interface search results adds the library code as an HTML class to each item entry in the location column. This makes it easier to add custom CSS/JavaScript for libraries to the search results.
Version(s) released in:
24.11.00
Circulation function:
Bug Depends on: 37005    
Bug Blocks: 37006    
Attachments: Bug 37004: Add branchcode as HTML class to each grouped result in search results
Bug 37004: Add branchcode as HTML class to each grouped result in search results

Description Lucas Gass (lukeg) 2024-05-31 21:08:42 UTC
I would like to add the proper branchcode as an HTML class to each <li> item in the staff search results. 

There are three possible <ul>'s here:

-onloan_items_loop_items
-available_items_loop_items
-other_items_loop_items


Having the correct branch code here will make it much easier to write CSS/JS customization for a particular branch.
Comment 1 Lucas Gass (lukeg) 2024-05-31 21:18:29 UTC
Created attachment 167317 [details] [review]
Bug 37004: Add branchcode as HTML class to each grouped result in search results

To test:
1. Apply patch and restart_all
2. Do a catalog search that returns results.
3. Using the browsers dev tools inscpet the page and look for the 'available_items_loop_items' class in the 'Location column'.
4. Each child <li> element should have a class that is the branchcode.
5. Make sure that branchcode is correct.
6. Change the StaffSearchResultsDisplayBranch system preference. Make sure that each branchcode is still correct.
7. Change the system preference 'noItemTypeImages' to 'Dont show'.
8. Make sure the branchcode is still correct.
9. Checkout an item that would show up in these search results.
10. Do steps 3-8 again excpet this time look for the HTML element 'onloan_items_loop_items'.
11. Put some items in transfer that would show up in these search resultss.
12. Do steps 3-8 again excpet this time look for the HTML element 'other_items_loop_items'.
Comment 2 David Nind 2024-06-01 20:59:49 UTC
Created attachment 167322 [details] [review]
Bug 37004: Add branchcode as HTML class to each grouped result in search results

To test:
1. Apply patch and restart_all
2. Do a catalog search that returns results.
3. Using the browsers dev tools inscpet the page and look for the 'available_items_loop_items' class in the 'Location column'.
4. Each child <li> element should have a class that is the branchcode.
5. Make sure that branchcode is correct.
6. Change the StaffSearchResultsDisplayBranch system preference. Make sure that each branchcode is still correct.
7. Change the system preference 'noItemTypeImages' to 'Dont show'.
8. Make sure the branchcode is still correct.
9. Checkout an item that would show up in these search results.
10. Do steps 3-8 again excpet this time look for the HTML element 'onloan_items_loop_items'.
11. Put some items in transfer that would show up in these search resultss.
12. Do steps 3-8 again excpet this time look for the HTML element 'other_items_loop_items'.

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 Katrin Fischer 2024-09-02 08:39:52 UTC
QA'd by RM
Comment 4 Katrin Fischer 2024-09-02 10:21:18 UTC
Pushed for 24.11!

Well done everyone, thank you!