From c2606618c03edcac7e3356d757fd74f320df348d Mon Sep 17 00:00:00 2001 From: Lari Taskula Date: Wed, 2 Oct 2024 18:44:27 +0000 Subject: [PATCH] Bug 35126: Remove onload from opac-addbybiblionumber.pl To test: Case a) Adding to a new list 1. Enable virtualshelves system preference 2. Search for any record and click it 3. On the right hand side of record view, click "Save to your lists" 4. A new pop up opens. 5. Under "Add to a new list", give any name to the list 6. Under "Add to a new list", click "Save" 7. Observe popup closing 8. Observe record view page reloading Case b) Adding to an existing list 1. Enable virtualshelves system preference 2. Search for any record and click it 3. On the right hand side of record view, click "Save to your lists" 4. A new pop up opens. 5. Under "Add to a list", select an existing list (it can be the same as the one you created in case a, it does not matter here) 6. Under "Add to a list", click "Save" 7. Observe popup closing 8. Unlike case a, observe record view page NOT reloading Signed-off-by: David Cook Signed-off-by: Aleisha Amohia Signed-off-by: Katrin Fischer (cherry picked from commit 8cfce49d14ec38ff0fb053b0051391d55a9a341a) Signed-off-by: Lucas Gass --- .../en/modules/opac-addbybiblionumber.tt | 13 ++++++++++++- opac/opac-addbybiblionumber.pl | 17 +++++++---------- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-addbybiblionumber.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-addbybiblionumber.tt index 7786a1097f..f562dfa0b4 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-addbybiblionumber.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-addbybiblionumber.tt @@ -117,4 +117,15 @@ [% INCLUDE 'opac-bottom.inc' is_popup=1 %] -[% BLOCK jsinclude %][% END %] +[% BLOCK jsinclude %] + +[% END %] diff --git a/opac/opac-addbybiblionumber.pl b/opac/opac-addbybiblionumber.pl index 1916c26e9e..3ea34220fd 100755 --- a/opac/opac-addbybiblionumber.pl +++ b/opac/opac-addbybiblionumber.pl @@ -70,12 +70,11 @@ if( $op && $op !~ /^cud-/ ) { for my $biblionumber (@biblionumbers) { $shelf->add_biblio( $biblionumber, $loggedinuser ); } - - #Reload the page where you came from - print $query->header; - print ""; - exit; } + $template->param( + WINDOW_CLOSE => 1, + WINDOW_PARENT_RELOAD => 1, + ); } } elsif ($shelfnumber) { my $shelfnumber = $query->param('shelfnumber'); @@ -84,11 +83,9 @@ if( $op && $op !~ /^cud-/ ) { for my $biblionumber (@biblionumbers) { $shelf->add_biblio( $biblionumber, $loggedinuser ); } - - #Close this page and return - print $query->header; - print ""; - exit; + $template->param( + WINDOW_CLOSE => 1, + ); } else { $authorized = 0; }