From 11005fd44c6350f38f17387b3a31f07627ad439c 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 (cherry picked from commit c2606618c03edcac7e3356d757fd74f320df348d) Signed-off-by: Fridolin Somers --- .../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 25b997f3ec..e3af1a9370 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-addbybiblionumber.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-addbybiblionumber.tt @@ -113,4 +113,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 fc31627882..8bf1789e86 100755 --- a/opac/opac-addbybiblionumber.pl +++ b/opac/opac-addbybiblionumber.pl @@ -67,12 +67,11 @@ if ($newvirtualshelf) { 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'); @@ -81,11 +80,9 @@ if ($newvirtualshelf) { 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; } -- 2.39.5