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 <dcook@prosentient.com.au>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 8cfce49d14)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Lari Taskula 2024-10-02 18:44:27 +00:00 committed by Lucas Gass
parent a60bcd9065
commit c2606618c0
2 changed files with 19 additions and 11 deletions

View File

@ -117,4 +117,15 @@
</div> <!-- / .main -->
[% INCLUDE 'opac-bottom.inc' is_popup=1 %]
[% BLOCK jsinclude %][% END %]
[% BLOCK jsinclude %]
<script>
$(document).ready(function() {
[% IF WINDOW_PARENT_RELOAD %]
opener.location.reload();
[% END %]
[% IF WINDOW_CLOSE %]
window.close();
[% END %]
});
</script>
[% END %]

View File

@ -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 "<html><meta http-equiv=\"refresh\" content=\"0\" /><body onload=\"window.opener.location.reload(true);self.close();\"></body></html>";
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 "<html><meta http-equiv=\"refresh\" content=\"0\" /><body onload=\"self.close();\"></body></html>";
exit;
$template->param(
WINDOW_CLOSE => 1,
);
} else {
$authorized = 0;
}