Bugzilla – Attachment 183967 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: Removed local items from group tabs and removed group items from other holdings tab
Bug-35211-Removed-local-items-from-group-tabs-and-.patch (text/plain), 3.96 KB, created by
Eric Garcia
on 2025-07-10 18:54:32 UTC
(
hide
)
Description:
Bug 35211: Removed local items from group tabs and removed group items from other holdings tab
Filename:
MIME Type:
Creator:
Eric Garcia
Created:
2025-07-10 18:54:32 UTC
Size:
3.96 KB
patch
obsolete
>From 2f211e0e05a98360e5d72275308e655ef44e6c82 Mon Sep 17 00:00:00 2001 >From: Eric Garcia <cubingguy714@gmail.com> >Date: Thu, 10 Jul 2025 18:52:22 +0000 >Subject: [PATCH] Bug 35211: Removed local items from group tabs and removed > group items from other holdings tab > >Fixed the issues with tabs. > >I cannot replicate the issue in the attached screenshot. What steps did you take? >--- > catalogue/detail.pl | 19 +++++++++---------- > .../tables/items/catalogue_detail.inc | 4 +++- > 2 files changed, 12 insertions(+), 11 deletions(-) > >diff --git a/catalogue/detail.pl b/catalogue/detail.pl >index 42d6704199..d6cdca7631 100755 >--- a/catalogue/detail.pl >+++ b/catalogue/detail.pl >@@ -332,13 +332,7 @@ if ( defined $dat->{'itemtype'} ) { > $dat->{imageurl} = getitemtypeimagelocation( 'intranet', $itemtypes->{ $dat->{itemtype} }->imageurl ); > } > >-if ( C4::Context->preference('SeparateHoldings') ) { >- my $SeparateHoldingsBranch = C4::Context->preference('SeparateHoldingsBranch') || 'homebranch'; >- my $other_holdings_count = >- $items_to_display->search( { $SeparateHoldingsBranch => { '!=' => C4::Context->userenv->{branch} } } )->count; >- $template->param( other_holdings_count => $other_holdings_count ); >-} >- >+my $total_group_holdings_count = 0; > if ( C4::Context->preference('SeparateHoldingsByGroup') ) { > my $branchcode = C4::Context->userenv->{branch}; > my @all_search_groups = Koha::Library::Groups->get_search_groups( { interface => 'staff' } ); >@@ -361,15 +355,13 @@ if ( C4::Context->preference('SeparateHoldingsByGroup') ) { > push @libs_branchcodes, $lib->branchcode; > } > >- # Push logged in branchcode >- push @libs_branchcodes, $branchcode; >- > # Build group branchcode hash > $branchcode_hash{ $group->id } = \@libs_branchcodes; > > my $group_holdings_count = > $items_to_display->search( { homebranch => { '-in' => \@libs_branchcodes } } )->count; > $holdings_count{ $group->id } = $group_holdings_count; >+ $total_group_holdings_count += $group_holdings_count; > > push @lib_groups, $group; > } >@@ -383,6 +375,13 @@ if ( C4::Context->preference('SeparateHoldingsByGroup') ) { > ); > } > >+if ( C4::Context->preference('SeparateHoldings') ) { >+ my $SeparateHoldingsBranch = C4::Context->preference('SeparateHoldingsBranch') || 'homebranch'; >+ my $other_holdings_count = >+ $items_to_display->search( { $SeparateHoldingsBranch => { '!=' => C4::Context->userenv->{branch} } } )->count; >+ $other_holdings_count -= $total_group_holdings_count; >+ $template->param( other_holdings_count => $other_holdings_count ); >+} > $template->param( > count => $all_items->count, # FIXME 'count' is used in catalog-strings.inc > # But it's not a meaningful variable, we should rename it there >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 6e1cc46bbf..e8839e8f1b 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 >@@ -322,7 +322,9 @@ > if ( tab_id == 'holdings' ) { > default_filters[branch] = '[% Branches.GetLoggedInBranchcode() | html %]'; > } else { >- default_filters[branch] = { '!=': '[% Branches.GetLoggedInBranchcode() | html %]' }; >+ let all_branchcodes = Object.values(branchcodes).flat(); >+ all_branchcodes.push('[% Branches.GetLoggedInBranchcode() | html %]'); >+ default_filters[branch] = { '-not_in' : all_branchcodes }; > } > [% END %] > >-- >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