From 0b66310580e71223bc66168a8ee3b2c8e7299b5d Mon Sep 17 00:00:00 2001 From: Marion Durand Date: Thu, 2 Dec 2021 13:41:11 +0100 Subject: [PATCH] Bug 9565: (follow-up) Adapt batch record deletion tool Add a column "Subscriptions" to the batch deletion tools Add a link on the number of subscription to the search page with all the subscriptions of the record Add a button in the toolbar to select only biblio record without subscriptions The changes are only on display It is still possible to delete records that are attached to subscriptions from this tool (as it is possible for records with attached items) To test: 1) Go to the batch record deletion (in tools) 2) Select a list of record numbers (select some with one or more subscription) 3) Click on Continue 4) Check that there is no column named "Subscription" and that there is no button "Select without subscription" in the toolbar 5) Apply patch 6) Repeat steps 1 to 3 7a) Check that there is a column named "Subscription" fill with the number of subscriptions attached to the record 7b) Check that the link in the subscriptions column send you to the search page with the subscriptions linked to this record 7c) Check that there is a button "Select without subscription" in the toolbar that selects record with no subscription attached 8) Sign off Signed-off-by: Frank Hansen Signed-off-by: Jonathan Druart Signed-off-by: Fridolin Somers --- .../en/modules/tools/batch_delete_records.tt | 16 +++++++++++++++- tools/batch_delete_records.pl | 2 ++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_delete_records.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_delete_records.tt index 09738efa05..469ec64868 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_delete_records.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_delete_records.tt @@ -133,6 +133,7 @@ | Clear all | Select without items | Select without holds + | Select without subscriptions
@@ -144,17 +145,19 @@ + [% FOR biblio IN records %] - + + [% END %] @@ -271,6 +274,17 @@ }); }); + $("#selectwithoutsubscriptions").click(function(e){ + e.preventDefault(); + $(".records input[type='checkbox']:not(:disabled)").each(function(){ + if( $(this).data("subscriptions") == 0 ){ + $(this).prop("checked", true ); + } else { + $(this).prop("checked", false ); + } + }); + }); + $("#clearlinkedtobiblio").click(function(e){ e.preventDefault(); $(".records input[type='checkbox']:not(:disabled)").each(function(){ diff --git a/tools/batch_delete_records.pl b/tools/batch_delete_records.pl index b35d703146..0f42bd8ede 100755 --- a/tools/batch_delete_records.pl +++ b/tools/batch_delete_records.pl @@ -28,6 +28,7 @@ use C4::Auth qw( get_template_and_user ); use C4::Output qw( output_html_with_http_headers ); use C4::Auth qw( get_template_and_user ); use C4::Biblio qw( GetMarcBiblio ); +use C4::Serials qw( CountSubscriptionFromBiblionumber); use C4::AuthoritiesMarc; use Koha::Virtualshelves; @@ -106,6 +107,7 @@ if ( $op eq 'form' ) { $biblio->{itemnumbers} = [Koha::Items->search({ biblionumber => $record_id })->get_column('itemnumber')]; $biblio->{holds_count} = $holds_count; $biblio->{issues_count} = C4::Biblio::CountItemsIssued( $record_id ); + $biblio->{subscriptions_count} = CountSubscriptionFromBiblionumber( $record_id ); push @records, $biblio; } else { # Retrieve authority information -- 2.39.5
Items Holds CheckoutsSubscriptions
[% INCLUDE 'biblio-title.inc' link = 1 %] [% biblio.itemnumbers.size | html %] [% biblio.holds_count | html %] [% biblio.issues_count | html %][% biblio.subscriptions_count | html %]