From 9ac1ed1012dd5777206e5f3e513d72bdfea53be5 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 --- .../bootstrap/en/includes/overdrive-login.inc | 18 ++++++++++++++++++ koha-tmpl/opac-tmpl/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 0000000..116cabf --- /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 1909c57..69ded6b 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt @@ -900,7 +900,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 7063cd1..9070dc3 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 = $('