From a9ba0ce5831aea486e77a9bf23a8fd5b8883105f Mon Sep 17 00:00:00 2001 From: Jake Deery Date: Tue, 3 Mar 2026 16:14:01 +0000 Subject: [PATCH] Bug 14962: (QA follow-up) List all blocked items in one alert This patch stops duplication of the alert displayed when an item is not modifiable, and instead shows all the items listed under one single alert Sponsored-by: ByWater Solutions --- cataloguing/additem.pl | 15 ++++++++++++++- .../prog/en/modules/cataloguing/additem.tt | 10 +++++++--- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/cataloguing/additem.pl b/cataloguing/additem.pl index 784be908f7b..2e605342c89 100755 --- a/cataloguing/additem.pl +++ b/cataloguing/additem.pl @@ -169,7 +169,10 @@ if ( $op eq 'edititem' || $op eq 'dupeitem' ) { my $ondisplay = $item->active_display ? 1 : undef; my $nomod = $ondisplay; - $template->param( ondisplay => $ondisplay, nomod => $nomod ); + $template->param( + ondisplay => $ondisplay, + nomod => $nomod + ); } } @@ -699,6 +702,9 @@ if ($op) { # now, build existiing item list +my $bib_has_nomod; +my $bib_has_ondisplay; + my @items; for my $item ( $biblio->items->as_list, $biblio->host_items->as_list ) { my $i = $item->columns_to_str; @@ -713,6 +719,9 @@ for my $item ( $biblio->items->as_list, $biblio->host_items->as_list ) { } } + $bib_has_nomod = 1 if $i->{nomod}; + $bib_has_ondisplay = 1 if $i->{ondisplay}; + push @items, $i; } @@ -837,6 +846,10 @@ $template->param( barcode => $current_item->{barcode}, op => $nextop, popup => scalar $input->param('popup') ? 1 : 0, + can_mod => { + nomod => scalar $bib_has_nomod ? 1 : 0, + ondisplay => scalar $bib_has_ondisplay ? 1 : 0, + }, C4::Search::enabled_staff_search_views, ); $template->{'VARS'}->{'searchid'} = $searchid; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt index 266f7e52577..e97fb816862 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt @@ -88,12 +88,16 @@ [% END %] [% IF ( items ) %] - [% FOREACH item IN items %] - [% IF item.ondisplay %] + [% IF ( can_mod.nomod ) %] + [% IF ( can_mod.ondisplay ) %]

Item(s) on display: The following item is currently on display, and cannot be modified:

The permanent location for these item(s) is found below. To modify these details, edit the display, or remove the item from the display.

-- 2.50.1 (Apple Git-155)