diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/overdrive-login.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/overdrive-login.inc new file mode 100644 index 0000000000..116cabf8a3 --- /dev/null +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/overdrive-login.inc @@ -0,0 +1,18 @@ + diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt index 5b671401a8..9af74ba466 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt @@ -896,7 +896,10 @@ [% IF ( OverDriveCirculation ) %] -[% INCLUDE 'overdrive-checkout.inc' %] + [% INCLUDE 'overdrive-checkout.inc' %] + [% IF ( Koha.Preference('OverDrivePasswordRequired') ) %] + [% INCLUDE 'overdrive-login.inc' %] + [% END %] [% END %] [% IF ( RecordedBooksCirculation ) %] [% INCLUDE 'recordedbooks-checkout.inc' %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/js/overdrive.js b/koha-tmpl/opac-tmpl/bootstrap/js/overdrive.js index 7063cd1007..9070dc3eb3 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/js/overdrive.js +++ b/koha-tmpl/opac-tmpl/bootstrap/js/overdrive.js @@ -71,10 +71,11 @@ KOHA.OverDriveCirculation = new function() { var login_link = $('') .click(function(e) { e.preventDefault(); - var passwd = OD_password_required ? prompt("Please enter your password") : ""; - login(passwd); + if( OD_password_required ) { $("#overdrive-login").modal('show'); } + else { login(""); } }) .text(_("Login to OverDrive account")); + var login_div = $('
').append(login_link); var details = null; @@ -97,6 +98,12 @@ KOHA.OverDriveCirculation = new function() { window.close(); } checkout_popup = $("#overdrive-checkout"); + $("#overdrive-login-form").submit(function(e){ + e.preventDefault(); + $("#overdrive-login").modal('hide'); + var ODpassword = $("input[name='ODpassword']").val(); + login( ODpassword ); + }); }); function display_account (container, data) {