Bugzilla – Attachment 183615 Details for
Bug 35211
Make it possible to split holdings tab using library groups
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35211: Separate group holdings
Bug-35211-Separate-group-holdings.patch (text/plain), 4.84 KB, created by
Eric Garcia
on 2025-06-27 15:26:02 UTC
(
hide
)
Description:
Bug 35211: Separate group holdings
Filename:
MIME Type:
Creator:
Eric Garcia
Created:
2025-06-27 15:26:02 UTC
Size:
4.84 KB
patch
obsolete
>From 7b384f47d02f9b80de642f8efb4060f3b35c8ab1 Mon Sep 17 00:00:00 2001 >From: Eric Garcia <cubingguy714@gmail.com> >Date: Fri, 27 Jun 2025 15:25:31 +0000 >Subject: [PATCH] Bug 35211: Separate group holdings > >--- > catalogue/detail.pl | 18 +++++++----------- > .../tables/items/catalogue_detail.inc | 7 +++++-- > .../prog/en/modules/catalogue/detail.tt | 11 ++++++++--- > 3 files changed, 20 insertions(+), 16 deletions(-) > >diff --git a/catalogue/detail.pl b/catalogue/detail.pl >index b5a858416f..5a85161031 100755 >--- a/catalogue/detail.pl >+++ b/catalogue/detail.pl >@@ -342,25 +342,21 @@ if ( C4::Context->preference('SeparateHoldings') ) { > my @all_search_groups = Koha::Library::Groups->get_search_groups( { interface => 'staff' } ); > > if ( C4::Context->preference('SeparateHoldingsByGroup') ) { >- my @libs_in_group; >+ my @lib_groups; > foreach my $search_group (@all_search_groups) { > while ( my $group = $search_group->next ) { > my @all_libs = $group->all_libraries; > if ( grep { $_->branchcode eq $branchcode } @all_libs ) { >- foreach my $lib (@all_libs) { >- if ( $lib->branchcode ne $branchcode ) { >- push @libs_in_group, $lib->branchcode; >- } >- } >+ push @lib_groups, $group; > } > } > } >- >- my $group_holdings_count = >- $items_to_display->search( { $SeparateHoldingsBranch => { -in => \@libs_in_group } } )->count; >+ foreach my $group (@lib_groups) { >+# warn 'LIBRARY_GROUP' . Data::Dumper::Dumper($group->title); >+ } >+# warn Data::Dumper::Dumper(\@lib_groups); > $template->param( >- libs_in_group => \@libs_in_group, >- group_holdings_count => $group_holdings_count, >+ library_groups => \@lib_groups > ); > } > >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 5dcb5aa322..5951e318a3 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 >@@ -308,12 +308,15 @@ > } > let default_filters = {}; > [% IF Koha.Preference('SeparateHoldings') %] >+ console.log(tab_id.includes('group_holdings')); >+ console.log(tab_id); > [% SET SeparateHoldingsBranch = Koha.Preference('SeparateHoldingsBranch') || 'homebranch' %]; > let branch = '[% IF SeparateHoldingsBranch == 'homebranch' %]me.home_library_id[% ELSE %]me.holding_library_id[% END %]'; > if ( tab_id == 'holdings' ) { > default_filters[branch] = '[% Branches.GetLoggedInBranchcode() | html %]'; >- } else if ( tab_id == 'group_holdings') { >- default_filters[branch] = [ [% FOREACH branchcode IN libs_in_group %]"[% branchcode | html %]"[% UNLESS loop.last %], [% END%][% END %] ]; >+ } else if ( tab_id.includes('group_holdings') ) { >+ console.log(tab_id); >+ // default_filters[branch] = [ [% FOREACH branchcode IN libs_in_group %]"[% branchcode | html %]"[% UNLESS loop.last %], [% END%][% END %] ]; > } else { > default_filters[branch] = { '!=': '[% Branches.GetLoggedInBranchcode() | html %]' }; > } >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >index 14499a10d1..ebbaf4c5ab 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >@@ -332,9 +332,14 @@ > <span>Other holdings ([% other_holdings_count || 0 | html %])</span> > [% END %] > [% END %] >- [% IF group_holdings_count %] >- [% WRAPPER tab_item tabname= "group_holdings" %] >- <span>Group holdings ([% group_holdings_count || 0 | html %])</span> >+ [% IF library_groups && library_groups.size > 0 %] >+ [% FOREACH group IN library_groups %] >+ [% USE Dumper %] >+ groups: [% Dumper.dump_html(group.unblessed) %] >+ [% SET group_id_tab = "group_holdings_" _ group.id %] >+ [% WRAPPER tab_item tabname=group_id_tab %] >+ <span>[% group.title | html %] Group ()</span> >+ [% END %] > [% END %] > [% END %] > [% ELSE %] >-- >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