From 921a0a1c532c449dfce2aac3ce6bced668603b01 Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Wed, 4 Feb 2026 16:47:22 +0000 Subject: [PATCH] Bug 41624: Revert "Bug 35211: Separate group holdings into individual tabs" This reverts commit 08045c8009c52596d8df83e5da12d9e4e9abb9ae. --- catalogue/detail.pl | 47 ------------------- installer/data/mysql/mandatory/sysprefs.sql | 1 - .../tables/items/catalogue_detail.inc | 24 ---------- .../admin/preferences/cataloguing.pref | 8 +--- .../prog/en/modules/catalogue/detail.tt | 30 +----------- 5 files changed, 2 insertions(+), 108 deletions(-) diff --git a/catalogue/detail.pl b/catalogue/detail.pl index edd03dfc3c5..d6ff6220315 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -61,8 +61,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(); @@ -339,51 +337,6 @@ if ( C4::Context->preference('SeparateHoldings') ) { $items_to_display->search( { $SeparateHoldingsBranch => { '!=' => C4::Context->userenv->{branch} } } )->count; $template->param( other_holdings_count => $other_holdings_count ); } - -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) { - while ( my $group = $search_group->next ) { - my @all_libs = $group->all_libraries; - - # Check if library is in group - if ( grep { $_->branchcode eq $branchcode } @all_libs ) { - - # Get other libraries in group - my @other_libs = grep { $_->branchcode ne $branchcode } @all_libs; - my @libs_branchcodes; - - foreach my $lib (@other_libs) { - 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; - - push @lib_groups, $group; - } - } - } - - $template->param( - lib_groups => \@lib_groups, - branchcodes => \%branchcode_hash, - holdings_count => \%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/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql index 9d91ed1861e..0bd2274c754 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -741,7 +741,6 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('SendAllEmailsTo','',NULL,'All emails will be redirected to this email if it is not empty','Free'), ('SeparateHoldings','0',NULL,'Separate current branch holdings from other holdings','YesNo'), ('SeparateHoldingsBranch','homebranch','homebranch|holdingbranch','Branch used to separate holdings','Choice'), -('SeparateHoldingsByGroup','0',NULL,'Separate current branch holdings and holdings from libraries in the same library groups','YesNo'), ('SerialsDefaultEmailAddress', '', NULL, 'Default email address used as reply-to for notices sent by the serials module.', 'Free'), ('SerialsDefaultReplyTo', '', NULL, 'Default email address that serials notices are sent from.', 'Free'), ('SerialsSearchResultsLimit', '', NULL, 'Serials search results limit', 'Integer'), 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 5c25bff6d8d..9a1a3eaf65c 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 @@ -296,17 +296,6 @@ holdings: "[% PROCESS 'build_table' tab="holdings" | collapse | $tojson %]", 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 %] - }; - function build_items_table (tab_id, add_filters, dt_options, drawcallback) { let table_dt; @@ -332,19 +321,6 @@ } [% END %] - [% IF Koha.Preference('SeparateHoldingsByGroup') %] - if ( tab_id.includes('group_holdings') ) { - user_colvis[tab_id] = {}; - items_table_settings[tab_id] = [% TablesSettings.GetTableSettings('catalogue', 'detail','otherholdings_table','json') | $raw %]; - - const id = tab_id.replace("group_holdings_", ""); - - let branch = '[% IF SeparateHoldingsBranch == 'homebranch' %]me.home_library_id[% ELSE %]me.holding_library_id[% END %]'; - default_filters[branch] = branchcodes[id]; - - } - [% END %] - [% IF hidden_count %] default_filters.lost_status = "0"; [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref index 33043ed714c..9c62cae0688 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref @@ -301,12 +301,6 @@ Cataloging: homebranch: 'home library' holdingbranch: 'holding library' - "is the logged in user's library. The second tab will contain all other items." - - - - pref: SeparateHoldingsByGroup - choices: - 1: Separate - 0: "Don't separate" - - "holdings by library group in subsequent tabs that contain items whose home library is the logged in library branch." - - pref: AlwaysShowHoldingsTableFilters choices: @@ -414,4 +408,4 @@ Cataloging: - "
" - "All values of repeating tags and subfields will be printed with the given RIS tag." - "
" - - "Use of TY ( record type ) as a key will replace the default TY with the field value of your choosing." + - "Use of TY ( record type ) as a key will replace the default TY with the field value of your choosing." \ No newline at end of file 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 51cbacab4f9..763cda06baf 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -350,16 +350,6 @@ Holdings ([% items_to_display_count || 0 | html %]) [% END %] [% END %] - [% IF Koha.Preference('SeparateHoldingsByGroup') && lib_groups %] - [% FOREACH group IN lib_groups %] - [% IF ( holdings_count.${group.id} > 0 ) %] - [% WRAPPER tab_item tabname="group_holdings_" _ group.id %] - [% group.title | html %] - Group ([% holdings_count.${group.id} | html %]) - [% END %] - [% END %] - [% END %] - [% END %] - [% IF Koha.Preference('EnableItemGroups') %] [% WRAPPER tab_item tabname= "item_groups" %] Item groups @@ -499,16 +489,6 @@ [% PROCESS items_table tab="otherholdings" %] [% END # /tab_panel %] [% END %] - [% IF Koha.Preference('SeparateHoldingsByGroup') && lib_groups %] - [% FOREACH group IN lib_groups %] - [% IF ( holdings_count.${group.id} > 0 ) %] - [% SET group_tab = "group_holdings_" _ group.id %] - [% WRAPPER tab_panel tabname=group_tab %] - [% PROCESS items_table tab=group_tab %] - [% END # /tab_panel %] - [% END %] - [% END %] - [% END %] [% IF ( MARCNOTES ) %] [% WRAPPER tab_panel tabname="description" %] @@ -1767,15 +1747,7 @@ var bundle_lost_value = [% Koha.Preference('BundleLostValue') | html %]; [% END %] - let items_tab_ids = [ - 'holdings', - 'otherholdings' - [% IF Koha.Preference('SeparateHoldingsByGroup') && lib_groups %] - [% FOREACH group IN lib_groups %] - , 'group_holdings_[% group.id | html %]' - [% END %] - [% END %] - ]; + let items_tab_ids = [ 'holdings', 'otherholdings' ]; items_tab_ids.forEach( function( tab_id, index ) { // Early return if the tab is not shown (ie. no table) -- 2.39.5