Bugzilla – Attachment 95606 Details for
Bug 23987
batchMod.pl provides a link back to the record after the record is deleted
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23987: "return to cataloguing" if the record is deleted from bachMod-del
Bug-23987-return-to-cataloguing-if-the-record-is-d.patch (text/plain), 4.94 KB, created by
Jonathan Druart
on 2019-11-20 10:07:34 UTC
(
hide
)
Description:
Bug 23987: "return to cataloguing" if the record is deleted from bachMod-del
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2019-11-20 10:07:34 UTC
Size:
4.94 KB
patch
obsolete
>From fcdddbdf3667d5ec0968a20ee87421276d1fb44a Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 20 Nov 2019 10:56:24 +0100 >Subject: [PATCH] Bug 23987: "return to cataloguing" if the record is deleted > from bachMod-del > >If a bibliographic record is deleted after having deleted all their items in a batch, >we should not display a "return to the record" button but "return to cataloguing" instead > >Test plan: >1 - Have/make a bib with items >2 - On details page select Edit->Delete items in a batch >3 - Select all items and check "Delete record if no items remain" >4 - Delete the things >5 - On confirmation screen you have a count of items/bibs deleted >=> Without the patch there is a 'Return to record' button that leads to nowhere >=> With this patch there is a "Return to cataloging module" button >6 - Repeat using the "Delete selected items" link on top of the items table >=> Without the patch there is a 'Return to where you were' button that leads to nowhere >=> With this patch there is a "Return to cataloging module" button > >Note that there is a link AND a button, coming from > commit 928c0af2b6a2c7aa6ed54019c5bd7dbddbccf4ee > Bug 15824 - 'Done' button is unclear on batch item modification and deletion >I do not think it makes sense to have both. >--- > .../prog/en/modules/tools/batchMod-del.tt | 12 ++++++++++-- > tools/batchMod.pl | 18 ++++++++++++------ > 2 files changed, 22 insertions(+), 8 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-del.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-del.tt >index b938a16c87..3d11fafd52 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-del.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-del.tt >@@ -200,7 +200,11 @@ > <p>[% deleted_items | html %] item(s) deleted.</p> > [% IF delete_records %] <p>[% deleted_records | html %] record(s) deleted.</p> [% END %] > [% IF src == 'CATALOGUING' # from catalogue/detail.pl > Delete items in a batch%] >- <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber | uri %]">Return to the record</a> >+ [% IF biblio_deleted %] >+ <a href="/cgi-bin/koha/cataloguing/addbooks.pl">Return to the cataloging module</a> >+ [% ELSE %] >+ <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber | uri %]">Return to the record</a> >+ [% END %] > [% ELSIF src %] > <a href="[% src | url %]">Return to where you were</a> > [% ELSE %] >@@ -235,7 +239,11 @@ > > <p> > [% IF src == 'CATALOGUING' # from catalogue/detail.pl > Delete items in a batch%] >- <a class="btn btn-default" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber | html %]"><i class="fa fa-check-square-o"></i> Return to the record</a> >+ [% IF biblio_deleted %] >+ <a class="btn btn-default" href="/cgi-bin/koha/cataloguing/addbooks.pl"><i class="fa fa-check-square-o"></i> Return to the cataloging module</a> >+ [% ELSE %] >+ <a class="btn btn-default" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber | uri %]"><i class="fa fa-check-square-o"></i> Return to the record</a> >+ [% END %] > [% ELSIF src %] > <a class="btn btn-default" href="[% src | url %]"><i class="fa fa-check-square-o"></i> Return to where you were</a> > [% ELSE %] >diff --git a/tools/batchMod.pl b/tools/batchMod.pl >index 2e6473784c..ce7be79e76 100755 >--- a/tools/batchMod.pl >+++ b/tools/batchMod.pl >@@ -200,14 +200,20 @@ if ($op eq "action") { > }; > } > >- # If there are no items left, delete the biblio >- if ( $del_records ) { >- my $itemscount = Koha::Biblios->find( $itemdata->{'biblionumber'} )->items->count; >- if ( $itemscount == 0 ) { >- my $error = DelBiblio($itemdata->{'biblionumber'}); >- $deleted_records++ unless ( $error ); >+ # If there are no items left, delete the biblio >+ if ($del_records) { >+ my $itemscount = Koha::Biblios->find( $itemdata->{'biblionumber'} )->items->count; >+ if ( $itemscount == 0 ) { >+ my $error = DelBiblio( $itemdata->{'biblionumber'} ); >+ unless ($error) { >+ $deleted_records++; >+ if ( $src eq 'CATALOGUING' ) { >+ # We are coming catalogue/detail.pl, there were items from a single bib record >+ $template->param( biblio_deleted => 1 ); > } > } >+ } >+ } > } else { > if ($values_to_modify || $values_to_blank) { > my $localmarcitem = Item2Marc($itemdata); >-- >2.11.0
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 23987
:
95605
|
95606
|
95711
|
95712
|
95757
|
95758