Bugzilla – Attachment 118025 Details for
Bug 27893
Deleting a bibliographic record should warn about attached acquisition orders and cancel them
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27893: Display the number of orders on the batch record deletion
Bug-27893-Display-the-number-of-orders-on-the-batc.patch (text/plain), 4.08 KB, created by
Jonathan Druart
on 2021-03-10 14:46:45 UTC
(
hide
)
Description:
Bug 27893: Display the number of orders on the batch record deletion
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2021-03-10 14:46:45 UTC
Size:
4.08 KB
patch
obsolete
>From f31513ee0f91d85d54d17525ef11226431396354 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 10 Mar 2021 15:25:00 +0100 >Subject: [PATCH] Bug 27893: Display the number of orders on the batch record > deletion > >--- > .../prog/en/modules/tools/batch_delete_records.tt | 12 ++++++++++++ > tools/batch_delete_records.pl | 10 ++++++---- > 2 files changed, 18 insertions(+), 4 deletions(-) > >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 1cd8e0793a..99e50f2e8f 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 >@@ -1,6 +1,8 @@ > [% USE raw %] > [% USE Asset %] >+[% USE Context %] > [% SET footerjs = 1 %] >+[% PROCESS 'i18n.inc' %] > [% PROCESS 'authorities-search-results.inc' %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Tools › Batch record deletion</title> >@@ -143,6 +145,7 @@ > <th>Items</th> > <th>Holds</th> > <th>Checkouts</th> >+ <th>Orders</th> > </tr> > </thead> > <tbody> >@@ -154,6 +157,15 @@ > <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> >+ [% IF biblio.current_orders_count %] >+ [% tnpx('pluralization', '1 current order', '{count} current orders', biblio.current_orders_count, { count = biblio.current_orders_count }) | $raw %] >+ [% END %] >+ [% IF biblio.current_orders_count && biblio.cancelled_orders_count %]<br/>[% END %] >+ [% IF biblio.cancelled_orders_count %] >+ [% tnpx('pluralization', '1 cancelled order', '{count} cancelled orders', biblio.cancelled_orders_count, { count = biblio.cancelled_orders_count }) | $raw %] >+ [% END %] >+ </td> > </tr> > [% END %] > </tbody> >diff --git a/tools/batch_delete_records.pl b/tools/batch_delete_records.pl >index ea87d8b6c8..ca4c6d5c66 100755 >--- a/tools/batch_delete_records.pl >+++ b/tools/batch_delete_records.pl >@@ -81,8 +81,8 @@ if ( $op eq 'form' ) { > for my $record_id ( uniq @record_ids ) { > if ( $recordtype eq 'biblio' ) { > # Retrieve biblio information >- my $biblio = Koha::Biblios->find( $record_id ); >- unless ( $biblio ) { >+ my $biblio_object = Koha::Biblios->find( $record_id ); >+ unless ( $biblio_object ) { > push @messages, { > type => 'warning', > code => 'biblio_not_exists', >@@ -90,12 +90,14 @@ if ( $op eq 'form' ) { > }; > next; > } >- my $holds_count = $biblio->holds->count; >- $biblio = $biblio->unblessed; >+ my $holds_count = $biblio_object->holds->count; >+ my $biblio = $biblio_object->unblessed; > my $record = &GetMarcBiblio({ biblionumber => $record_id }); > $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->{current_orders_count} = $biblio_object->orders->filter_by_current->count; >+ $biblio->{cancelled_orders_count} = $biblio_object->orders->filter_by_cancelled->count; > push @records, $biblio; > } else { > # Retrieve authority information >-- >2.20.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 27893
:
118025
|
162271
|
162272
|
163669
|
163670
|
163676
|
163677
|
165002
|
165003
|
165151
|
165152
|
165620
|
165621