From bf2b499f002cc3781ca337786d0409d534a3c2f1 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Thu, 26 Jun 2025 19:23:58 +0000 Subject: [PATCH] Bug 13870: (follow-up) Link to relevent pages from batch results In batch results, if there is a linked subscription or order, I think we can link to that subscription or the basket the order is in. I think this is more user-friendly than asking the user to hover their mouse over a small icon. On the item edit page, we can add a Bootstrap tooltip to the menu item. This patch also includes perltidy changes to cataloguing/additem.pl and tools/batchMod.pl which were missed. --- cataloguing/additem.pl | 6 ++--- .../prog/en/includes/html_helpers.inc | 23 ++++++++++++------- .../prog/en/modules/cataloguing/additem.tt | 9 ++++++-- tools/batchMod.pl | 5 ++-- 4 files changed, 28 insertions(+), 15 deletions(-) diff --git a/cataloguing/additem.pl b/cataloguing/additem.pl index bf84276c479..0cb33e42a38 100755 --- a/cataloguing/additem.pl +++ b/cataloguing/additem.pl @@ -30,8 +30,8 @@ use C4::Biblio qw( GetFrameworkCode GetMarcFromKohaField GetMarcStructure I 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; @@ -687,7 +687,7 @@ 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) { 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 148eb5f9954..f820c2733c2 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 c0536cffc85..1af4ca97785 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt @@ -187,10 +187,15 @@ - + Delete [% IF warn_message %] - + [% END %] diff --git a/tools/batchMod.pl b/tools/batchMod.pl index 7f3ba1fb302..76a9645d9c8 100755 --- a/tools/batchMod.pl +++ b/tools/batchMod.pl @@ -235,7 +235,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) { @@ -247,7 +247,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