Bugzilla – Attachment 128160 Details for
Bug 9565
Deleting a record should alert or fail if there are current subscriptions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 9565: (follow-up) Adapt batch record deletion tool
Bug-9565-follow-up-Adapt-batch-record-deletion-too.patch (text/plain), 5.81 KB, created by
Marion Durand
on 2021-12-02 13:02:04 UTC
(
hide
)
Description:
Bug 9565: (follow-up) Adapt batch record deletion tool
Filename:
MIME Type:
Creator:
Marion Durand
Created:
2021-12-02 13:02:04 UTC
Size:
5.81 KB
patch
obsolete
>From aa4aa91a70b327aca6983f045f9ad0af2a082530 Mon Sep 17 00:00:00 2001 >From: Marion Durand <marion.durand@biblibre.com> >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 >--- > .../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 @@ > | <a id="clearall" href="#"><i class="fa fa-remove"></i> Clear all</a> > | <a id="selectwithoutitems" href="#">Select without items</a> > | <a id="selectnotreserved" href="#">Select without holds</a> >+ | <a id="selectwithoutsubscriptions" href="#">Select without subscriptions</a> > </div> > <form action="/cgi-bin/koha/tools/batch_delete_records.pl" method="post" id="selectrecords"> > <table id="biblios" class="records"> >@@ -144,17 +145,19 @@ > <th>Items</th> > <th>Holds</th> > <th>Checkouts</th> >+ <th>Subscriptions</th> > </tr> > </thead> > <tbody> > [% FOR biblio IN records %] > <tr> >- <td><input type="checkbox" name="record_id" id="record_id_[% biblio.biblionumber | html %]" value="[% biblio.biblionumber | html %]" data-items="[% biblio.itemnumbers.size | html %]" data-issues="[% biblio.issues_count | html %]" data-reserves="[% biblio.holds_count | html %]" /></td> >+ <td><input type="checkbox" name="record_id" id="record_id_[% biblio.biblionumber | html %]" value="[% biblio.biblionumber | html %]" data-items="[% biblio.itemnumbers.size | html %]" data-issues="[% biblio.issues_count | html %]" data-reserves="[% biblio.holds_count | html %]" data-subscriptions="[% biblio.subscriptions_count | html %]" /></td> > <td><label for="record_id_[% biblio.biblionumber | html %]">[% biblio.biblionumber | html %]</label></td> > <td>[% INCLUDE 'biblio-title.inc' link = 1 %]</td> > <td><a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% biblio.biblionumber | uri %]">[% biblio.itemnumbers.size | html %]</a></td> > <td><a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% biblio.biblionumber | uri %]">[% biblio.holds_count | html %]</a></td> > <td><a href="/cgi-bin/koha/catalogue/issuehistory.pl?biblionumber=[% biblio.biblionumber | uri %]">[% biblio.issues_count | html %]</a></td> >+ <td><a href="/cgi-bin/koha/serials/serials-search.pl?searched=1&biblionumber=[% biblio.biblionumber | uri %]">[% biblio.subscriptions_count | html %]</a></td> > </tr> > [% END %] > </tbody> >@@ -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 b447134207..7000862cdf 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.17.1
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 9565
:
113589
|
113591
|
126821
|
126905
|
128051
|
128160
|
128163
|
128164
|
128165
|
128278
|
128279
|
128280
|
128281
|
128764
|
128832