Bugzilla – Attachment 191230 Details for
Bug 35211
Make it possible to split holdings tab using library groups in intranet
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35211: (follow-up) Improve how branchcodes are handled
Bug-35211-follow-up-Improve-how-branchcodes-are-ha.patch (text/plain), 3.21 KB, created by
Lucas Gass (lukeg)
on 2026-01-09 21:29:09 UTC
(
hide
)
Description:
Bug 35211: (follow-up) Improve how branchcodes are handled
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2026-01-09 21:29:09 UTC
Size:
3.21 KB
patch
obsolete
>From d6e37bab375027436f1e96835858a43d8de4bf50 Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Fri, 9 Jan 2026 20:25:15 +0000 >Subject: [PATCH] Bug 35211: (follow-up) 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;" >--- > catalogue/detail.pl | 10 +++++++--- > .../html_helpers/tables/items/catalogue_detail.inc | 14 +++++--------- > 2 files changed, 12 insertions(+), 12 deletions(-) > >diff --git a/catalogue/detail.pl b/catalogue/detail.pl >index 9aea2a670b4..eca6dce2ce2 100755 >--- a/catalogue/detail.pl >+++ b/catalogue/detail.pl >@@ -60,7 +60,6 @@ use Koha::Reviews; > use Koha::SearchEngine::Search; > use Koha::SearchEngine::QueryBuilder; > use Koha::Serial::Items; >-use Koha::Library::Group; > use Koha::Library::Groups; > > my $query = CGI->new(); >@@ -348,11 +347,13 @@ $template->param( > items_to_display_count => $items_to_display->count, > branch_holdings_count => $branch_holdings_count, > ); >+ >+my %branchcode_hash; >+ > if ( C4::Context->preference('SeparateHoldingsByGroup') ) { > my $branchcode = C4::Context->userenv->{branch}; > my @all_search_groups = Koha::Library::Groups->get_search_groups( { interface => 'staff' } ); > my @lib_groups; >- my %branchcode_hash; > my %holdings_count; > > foreach my $search_group (@all_search_groups) { >@@ -389,13 +390,16 @@ if ( C4::Context->preference('SeparateHoldingsByGroup') ) { > > $template->param( > lib_groups => \@lib_groups, >- branchcodes => \%branchcode_hash, > holdings_count_hash => \%holdings_count, > total_group_holdings_count => $total_group_holdings_count, > other_holdings_count => $other_holdings_count, > ); > } > >+$template->param( >+ branchcode_hash => \%branchcode_hash, >+); >+ > my $some_private_shelves = Koha::Virtualshelves->get_some_shelves( > { > borrowernumber => $borrowernumber, >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc >index 01f57749716..565c5c0af2a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc >@@ -297,15 +297,11 @@ > otherholdings: "[% PROCESS 'build_table' tab="otherholdings" | collapse | $tojson %]", > }; > >- 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 %] >- }; >+ [% IF branchcode_hash %] >+ const branchcodes = [% To.json(branchcode_hash) | $raw %]; >+ [% ELSE %] >+ const branchcodes = {}; >+ [% END %] > > function build_items_table (tab_id, add_filters, dt_options, drawcallback) { > >-- >2.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 35211
:
183075
|
183099
|
183143
|
183144
|
183420
|
183615
|
183642
|
183643
|
183901
|
183945
|
183949
|
183950
|
183966
|
183967
|
183968
|
184016
|
185336
|
185515
|
185525
|
185526
|
185527
|
185528
|
185529
|
185530
|
185531
|
188553
|
188554
|
188555
|
188556
|
188557
|
188558
|
188559
|
189379
|
189442
|
189443
|
189444
|
189445
|
189446
|
189447
|
189448
|
189449
|
189450
|
189451
|
191225
|
191226
|
191230
|
191231