@@ -, +, @@ --- koha-tmpl/opac-tmpl/bootstrap/js/global.js | 5 +++++ opac/opac-user.pl | 10 ++++++++++ 2 files changed, 15 insertions(+) --- a/koha-tmpl/opac-tmpl/bootstrap/js/global.js +++ a/koha-tmpl/opac-tmpl/bootstrap/js/global.js @@ -225,6 +225,11 @@ $(document).ready(function(){ $(".loginModal-trigger").on("click",function(e){ e.preventDefault(); + var button = $(this); + var context = button.data('return') + if ( context == 'true' ) { + $('#modalAuth').append(''); + } $("#loginModal").modal("show"); }); $("#loginModal").on("shown.bs.modal", function(){ --- a/opac/opac-user.pl +++ a/opac/opac-user.pl @@ -424,4 +424,14 @@ if ($search_query) { ); } +# if not an empty string this indicates to return +# back to the page we triggered the login from +my $return = $query->param('return'); +if ( $return ) { + print $query->redirect( + -uri => $return, + -cookie => $cookie, + ); +} + output_html_with_http_headers $query, $cookie, $template->output, undef, { force_no_caching => 1 }; --