Bugzilla – Attachment 186021 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.73 KB, created by
Thibaud Guillot (thibaud_g)
on 2025-09-02 07:24:52 UTC
(
hide
)
Description:
Bug 13870: (follow-up) Link to relevent pages from batch results
Filename:
MIME Type:
Creator:
Thibaud Guillot (thibaud_g)
Created:
2025-09-02 07:24:52 UTC
Size:
8.73 KB
patch
obsolete
>From 8d9cbacc5477138112ac11f5c845b846a4674ead Mon Sep 17 00:00:00 2001 >From: Thibaud Guillot <thibaud.guillot@biblibre.com> >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 @@ > </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 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 @@ > <input type="hidden" name="searchid" value="[% searchid | html %]" /> > <input type="hidden" name="delete-serial-issues" id="[% item.itemnumber | html %]-delete-serial-issues" value="" /> > </form> >- <a class="dropdown-item delete" data-itemnumber="[% item.itemnumber | html %]" data-has-serial-item="[% Item.HasSerialItem(item.itemnumber) | html %]" href="#"> >+ <a >+ class="dropdown-item delete" >+ data-itemnumber="[% item.itemnumber | html %]" >+ data-has-serial-item="[% Item.HasSerialItem(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 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
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
|
186020
| 186021 |
186022