Bugzilla – Attachment 183556 Details for
Bug 13870
Add warnings about subscriptions and orders when deleting items
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13870: (follow-up) Link to relevent pages from batch results
Bug-13870-follow-up-Link-to-relevent-pages-from-ba.patch (text/plain), 8.26 KB, created by
Owen Leonard
on 2025-06-26 19:35:35 UTC
(
hide
)
Description:
Bug 13870: (follow-up) Link to relevent pages from batch results
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2025-06-26 19:35:35 UTC
Size:
8.26 KB
patch
obsolete
>From bf2b499f002cc3781ca337786d0409d534a3c2f1 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >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 @@ > </td> > [% ELSE %] > [% IF item.safe_to_delete %] >- <td><input type="checkbox" name="itemnumber" value="[% item.itemnumber | html %]" id="row[% item.itemnumber | html %]" checked="checked" /></td> >- [% IF linked_order.ordernumber %] >- <i class="fa fa-warning warn" Title="There is an order (ordernumber [% linked_order.ordernumber | html %]) on this item"></i> >- [% END %] >- [% IF linked_subscription %] >- <i class="fa fa-warning warn" Title="There is a subscription linked (subscription id [% linked_subscription | html %])"></i> >- [% END %] >+ <td> >+ <input type="checkbox" name="itemnumber" value="[% item.itemnumber | html %]" id="row[% item.itemnumber | html %]" checked="checked" /> >+ </td> > [% ELSE %] > [% SET messages = item.safe_to_delete.messages %] > [% FOR m IN messages %] >@@ -392,8 +388,19 @@ > [% END %] > <td> > <label for="row[% item.itemnumber | html %]"> >- <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% item.biblionumber | uri %]"> [% item.biblio.title | html %] </a> >+ [% INCLUDE 'biblio-title.inc' biblio=item.biblio link = 1 %] > [% IF ( item.biblio.author ) %], by [% item.biblio.author | html %][% END %] >+ >+ [% IF linked_order.ordernumber %] >+ <div> >+ <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% linked_order.basket | uri %]"><i class="fa fa-warning warn" aria-hidden="true"></i> Linked order</a> >+ </div> >+ [% END %] >+ [% IF linked_subscription %] >+ <div> >+ <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% linked_subscription | uri %]"><i class="fa fa-warning warn" aria-hidden="true"></i> Linked subscription</a> >+ </div> >+ [% END %] > </label> > </td> > <td class="holds_count"> >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 @@ > <input type="hidden" name="itemnumber" value="[% item.itemnumber | html %]" /> > <input type="hidden" name="searchid" value="[% searchid | html %]" /> > </form> >- <a class="dropdown-item delete" data-item="[% item.itemnumber | html %]" href="#"> >+ <a >+ class="dropdown-item delete" >+ data-item="[% item.itemnumber | html %]" >+ href="#" >+ [% IF ( warn_message ) %]data-bs-toggle="tooltip" data-bs-placement="right" title="[% warn_message | html %]"[% END %] >+ > > Delete > [% IF warn_message %] >- <i class="fa fa-warning warn" Title="[% warn_message | html %]"></i> >+ <i class="fa fa-warning warn" aria-hidden="true"></i> > [% END %] > </a> > </li> >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
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 13870
:
147641
|
152235
|
152236
|
155576
|
175440
|
176858
|
179579
|
179580
|
179581
|
179834
|
180952
|
183442
| 183556