From 32dc4a7bfaeebcff2be739fdf5f15e0f8bad4faa Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Wed, 10 Oct 2018 15:53:13 +0000 Subject: [PATCH] Bug 21542: Use modal and password field for overdrive password To test: 1 - Enabled Overdrive and fill all preferences 2 - Make sure OverDrivePasswordRequired is true 3 - Go to opac account 4 - Log in to overdrive 5 - Note the input is shown 6 - Apply patch 7 - Repeat 8 - Note popup is now a modal 9 - Note password is now hidden 10 - Confirm overdrive integration works as before Signed-off-by: Martin Renvoize Signed-off-by: Nick Clemens --- .../bootstrap/en/includes/overdrive-login.inc | 18 ++++++++++++++++++ .../bootstrap/en/modules/opac-user.tt | 5 ++++- koha-tmpl/opac-tmpl/bootstrap/js/overdrive.js | 11 +++++++++-- 3 files changed, 31 insertions(+), 3 deletions(-) create mode 100644 koha-tmpl/opac-tmpl/bootstrap/en/includes/overdrive-login.inc 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 = $('