Bug 41624

Summary: Improvements to Bug 35211
Product: Koha Reporter: Lucas Gass (lukeg) <lucas>
Component: Staff interfaceAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: gmcharlt
Version: Main   
Hardware: All   
OS: All   
GIT URL: Initiative type: ---
Sponsorship status: --- Comma delimited list of Sponsors:
Crowdfunding goal: 0 Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on: 35211    
Bug Blocks:    
Attachments: Bug 41624: Improve how branchcodes are handled
Bug 41624: Move other_holdings_count outside of loop so it is only calculated once

Description Lucas Gass (lukeg) 2026-01-14 21:46:59 UTC
Bug 35211 has some problems. 

1. This is hard to read/maintain:

        const branchcodes = { 
          [% FOREACH key IN branchcodes.keys %]
            "[% key | html %]": [
              [% FOREACH code IN branchcodes.$key %]
                "[% code | html %]"[% UNLESS loop.last %], [% END %]
              [% END %]
            ][% UNLESS loop.last %], [% END %]
          [% END %]
        };


2. If you select Show/Hide filters on the group holdings table the table disappears. 

3. other_holdings_count is counted over and over inside the loop, it isn't necessary to do so. 

4. The code seems to unnecessarily touch colvis settings
Comment 1 Lucas Gass (lukeg) 2026-01-14 21:51:25 UTC
Created attachment 191470 [details] [review]
Bug 41624: Improve how branchcodes are handled

-This patch is an attempt to improve how we retrive branchcodes. Too much of this logic is unnesseary done in the template.
-This also removed the unneeded "use Koha::Library::Group;"
Comment 2 Lucas Gass (lukeg) 2026-01-14 21:51:32 UTC
Created attachment 191471 [details] [review]
Bug 41624: Move other_holdings_count outside of loop so it is only calculated once