From cf6d7d18bc68c47fc02038a21e33d7cf816f25ab Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Fri, 7 Aug 2020 00:43:29 +0000 Subject: [PATCH] Bug 5428: (QA follow-up) Add searchid for deleting items in a batch and editing in batch To test: 0 - Perform a search in the staff client 1 - Click a title to go to the details page for a record 2 - Click the 'Edit' button and select 'Edit items in a batch' 3 - Note the searchid is in the url 4 - Make a change and hit 'Save' 5 - Note the 'Return the the record' link at the top, and the button on the bottom include searchid in URL 6 - Click one and note the brwoser is stil there 7 - Click 'Edit' and select 'Delete items in a batch' 8 - Delete one item 9 - Click return to record 10 - Browser is there 11 - Click 'Delete items in a batch again 12 - Select all and check 'Delete records if no items remain' 13 - Delete them 14 - Note you have a link to 'Go back to the results' Signed-off-by: Nick Clemens Signed-off-by: Jonathan Druart --- .../prog/en/modules/tools/batchMod-del.tt | 16 +++++++++++++++- .../prog/en/modules/tools/batchMod-edit.tt | 13 +++++++++++-- tools/batchMod.pl | 3 ++- 3 files changed, 28 insertions(+), 4 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 eb5ddd82c6..acdf6bcd02 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 @@ -76,6 +76,7 @@
+ @@ -221,9 +222,16 @@ [% IF delete_records %]

[% deleted_records | html %] record(s) deleted.

[% END %] [% IF src == 'CATALOGUING' # from catalogue/detail.pl > Delete items in a batch%] [% IF biblio_deleted %] + [% IF searchid %] + + [% END %] Return to the cataloging module [% ELSE %] - Return to the record + [% IF searchid %] + Return to the record + [% ELSE %] + Return to the record + [% END %] [% END %] [% ELSIF src %] Return to where you were @@ -289,6 +297,7 @@ [% INCLUDE 'datatables.inc' %] [% Asset.js("js/pages/batchMod.js") | $raw %] [% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %] + [% Asset.js("js/browser.js") | $raw %] [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tt index 283ef381ef..3730e316bb 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tt @@ -98,7 +98,11 @@ $(document).ready(function(){ [% END %]
[% IF src == 'CATALOGUING' # from catalogue/detail.pl > Edit items in a batch%] - Return to the record + [% IF searchid %] + Return to the record + [% ELSE %] + Return to the record + [% END %] [% ELSIF src %] Return to where you were [% ELSE %] @@ -150,6 +154,7 @@ $(document).ready(function(){ + @@ -350,7 +355,11 @@ $(document).ready(function(){ [% ELSE %]
[% IF src == 'CATALOGUING' # from catalogue/detail.pl > Edit items in a batch%] - Return to the record + [% IF searchid %] + Return to the record + [% ELSE %] + Return to the record + [% END %] [% ELSIF src %] Return to where you were [% ELSE %] diff --git a/tools/batchMod.pl b/tools/batchMod.pl index fe40f84c7e..975f7997c5 100755 --- a/tools/batchMod.pl +++ b/tools/batchMod.pl @@ -69,7 +69,6 @@ if (!defined $op) { $template_flag = ($del) ? { tools => 'items_batchdel' } : { tools => 'items_batchmod' }; } - my ($template, $loggedinuser, $cookie) = get_template_and_user({template_name => $template_name, query => $input, @@ -78,6 +77,8 @@ my ($template, $loggedinuser, $cookie) flagsrequired => $template_flag, }); +$template->param( searchid => scalar $input->param('searchid'), ); + # Does the user have a restricted item edition permission? my $uid = $loggedinuser ? Koha::Patrons->find( $loggedinuser )->userid : undef; my $restrictededition = $uid ? haspermission($uid, {'tools' => 'items_batchmod_restricted'}) : undef; -- 2.39.5