From e7fae53261a1f652a76358d066a3d337dc5da78a 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 --- .../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 501f048444..70f1573d12 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-addbybiblionumber.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-addbybiblionumber.tt @@ -123,4 +123,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; } -- 2.34.1