From 8d9cbacc5477138112ac11f5c845b846a4674ead Mon Sep 17 00:00:00 2001 From: Thibaud Guillot Date: Mon, 1 Sep 2025 16:46:46 +0200 Subject: [PATCH] Bug 13870: (follow-up) Link to relevent pages from batch results --- cataloguing/additem.pl | 10 ++++---- .../prog/en/includes/html_helpers.inc | 23 ++++++++++++------- .../prog/en/modules/cataloguing/additem.tt | 10 ++++++-- tools/batchMod.pl | 5 ++-- 4 files changed, 31 insertions(+), 17 deletions(-) diff --git a/cataloguing/additem.pl b/cataloguing/additem.pl index 768df3f7812..d4610c66c56 100755 --- a/cataloguing/additem.pl +++ b/cataloguing/additem.pl @@ -23,15 +23,15 @@ use Modern::Perl; use CGI qw ( -utf8 ); -use C4::Auth qw( get_template_and_user haspermission ); +use C4::Auth qw( get_template_and_user haspermission ); use C4::Barcodes::ValueBuilder; use C4::Barcodes; use C4::Biblio qw( GetFrameworkCode GetMarcFromKohaField GetMarcStructure IsMarcStructureInternal ModBiblio ); use C4::Circulation qw( barcodedecode LostItem ); use C4::Context; use C4::Members; -use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers ); -use C4::Search qw( enabled_staff_search_views ); +use C4::Output qw( output_and_exit_if_error output_and_exit output_html_with_http_headers ); +use C4::Search qw( enabled_staff_search_views ); use C4::Acquisition qw( GetOrderFromItemnumber ); use Koha::Biblios; use Koha::Item::Templates; @@ -700,12 +700,12 @@ if ($op) { my @items; my %warning_messages; for my $item ( $biblio->items->as_list, $biblio->host_items->as_list ) { - my $i = $item->columns_to_str; + my $i = $item->columns_to_str; my $i_order = GetOrderFromItemnumber( $i->{itemnumber} ); my $i_serialid = Koha::Serial::Items->find( { itemnumber => $i->{itemnumber} }, { prefetch => 'serialid' } ); if ($i_order) { $warning_messages{ $i->{itemnumber} } = - sprintf( 'There is an order (ordernumber %s) on this item', $i_order->{ordernumber} ); + sprintf( "There is an order (ordernumber %s) on this item", $i_order->{ordernumber} ); } if ($i_serialid) { $warning_messages{ $i->{itemnumber} } = 'A subscription is linked to this item'; diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc index e696a1bec15..bb34f6eb1fa 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc @@ -358,13 +358,9 @@ [% ELSE %] [% IF item.safe_to_delete %] - - [% IF linked_order.ordernumber %] - - [% END %] - [% IF linked_subscription %] - - [% END %] + + + [% ELSE %] [% SET messages = item.safe_to_delete.messages %] [% FOR m IN messages %] @@ -392,8 +388,19 @@ [% END %] 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 bd4ad470efa..02448b23732 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt @@ -189,10 +189,16 @@ - + Delete [% IF warn_message %] - + [% END %] diff --git a/tools/batchMod.pl b/tools/batchMod.pl index d44c4e97bfc..71b462f011e 100755 --- a/tools/batchMod.pl +++ b/tools/batchMod.pl @@ -262,7 +262,7 @@ if ( $op eq "cud-show" || $op eq "show" ) { } else { if ( defined $biblionumber && !@itemnumbers ) { my $biblio = Koha::Biblios->find($biblionumber); - if(!@itemnumbers) { + if ( !@itemnumbers ) { @itemnumbers = $biblio ? $biblio->items->get_column('itemnumber') : (); } foreach my $itemnumber (@itemnumbers) { @@ -274,7 +274,8 @@ if ( $op eq "cud-show" || $op eq "show" ) { { ordernumber => $order->{ordernumber}, basket => $order->{basketno} }; } if ($serial_id) { - my $subscription_id = Koha::Serials->search( { serialid => $serial_id } )->get_column('subscriptionid'); + my $subscription_id = + Koha::Serials->search( { serialid => $serial_id } )->get_column('subscriptionid'); $linked_orders_subscriptions{$itemnumber} = { subscription => $subscription_id }; } } -- 2.39.5