[open-ils-commits] [GIT] Evergreen ILS branch master updated. 677370554b9be79353ca2f599784dd617c42af73

Evergreen Git git at git.evergreen-ils.org
Tue Jul 28 16:43:27 EDT 2015


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  677370554b9be79353ca2f599784dd617c42af73 (commit)
       via  04c67f014fb79efbb68e5c1c16957f4a960d032d (commit)
      from  6f332bac34eee8d9eae3c8a56af6bd9675d6cff6 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 677370554b9be79353ca2f599784dd617c42af73
Author: Bill Erickson <berickxx at gmail.com>
Date:   Tue Jul 21 10:00:41 2015 -0400

    LP#1476370 Selfcheck inactivity warning release notes
    
    Signed-off-by: Bill Erickson <berickxx at gmail.com>
    Signed-off-by: Ben Shum <bshum at biblio.org>

diff --git a/docs/RELEASE_NOTES_NEXT/Circulation/selfcheck-logout-warning.txt b/docs/RELEASE_NOTES_NEXT/Circulation/selfcheck-logout-warning.txt
new file mode 100644
index 0000000..4b12370
--- /dev/null
+++ b/docs/RELEASE_NOTES_NEXT/Circulation/selfcheck-logout-warning.txt
@@ -0,0 +1,8 @@
+Selfcheck Inactivity Warning
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+The Selfcheck interface now warns patrons when they are about to be
+logged out due to inactivity 20 seconds prior to logging them out.
+
+The inactivity timeout is also reset with each checkout to avoid timeouts 
+while checking out lots of items.

commit 04c67f014fb79efbb68e5c1c16957f4a960d032d
Author: Bill Erickson <berickxx at gmail.com>
Date:   Mon Jul 20 16:26:30 2015 -0400

    LP1476370 Selfcheck logout warning, checkout resets
    
    * Show a logout warning dialog 20 seconds before discontinuing a
    self-check patron login session.
    
    * Reset the inactivity timer with each checkout.
    
    Signed-off-by: Bill Erickson <berickxx at gmail.com>
    Signed-off-by: Ben Shum <bshum at biblio.org>

diff --git a/Open-ILS/src/templates/circ/selfcheck/logout_dialog.tt2 b/Open-ILS/src/templates/circ/selfcheck/logout_dialog.tt2
new file mode 100644
index 0000000..11ecd07
--- /dev/null
+++ b/Open-ILS/src/templates/circ/selfcheck/logout_dialog.tt2
@@ -0,0 +1,14 @@
+<div dojoType="dijit.Dialog" jsId='oilsSelfckLogoutDialog' style='display:none;'>
+  <p>[% l('Your login session will soon timeout due to inactivity.') %]</p>
+  <table><tr>
+    <td>
+      <button jsId='oilsSelfckLogout' 
+        dojoType='dijit.form.Button'>[% l('Logout') %]</button>
+    </td>
+    <td>
+      <button jsId='oilsSelfckContinue' 
+        dojoType='dijit.form.Button'>[% l('Continue Session') %]</button>
+    </td>
+  </tr></table>
+</div>
+
diff --git a/Open-ILS/src/templates/circ/selfcheck/main.tt2 b/Open-ILS/src/templates/circ/selfcheck/main.tt2
index 22022fe..c82337c 100644
--- a/Open-ILS/src/templates/circ/selfcheck/main.tt2
+++ b/Open-ILS/src/templates/circ/selfcheck/main.tt2
@@ -4,6 +4,7 @@
 <script type="text/javascript" src="[% ctx.media_prefix %]/js/ui/default/circ/selfcheck/payment.js"></script>
 <link rel='stylesheet' type='text/css' href='[% ctx.media_prefix %]/css/skin/[% ctx.skin %]/selfcheck.css'/>
 [% INCLUDE 'circ/selfcheck/audio_config.tt2' %]
+[% INCLUDE 'circ/selfcheck/logout_dialog.tt2' %]
 
 <div id='oils-selfck-top-div'>
     [% INCLUDE 'circ/selfcheck/banner.tt2' %]
@@ -55,6 +56,27 @@
         </table>
     </form>
 </div>
+<div dojoType="dijit.Dialog" jsId='oilsSelfckWsDialog' class='oils-logout-dialog' style='display:none;'>
+    <form>
+        <table>
+            <tr>
+                <td>[% l('Choose a location') %]</td>
+                <td><div dojoType='openils.widget.OrgUnitFilteringSelect' jsId='oilsSelfckWsLocSelector' 
+                    searchAttr='shortname' labelAttr='shortname'></div></td>
+            </tr>
+            <tr>
+                <td>[% l('Enter a workstation name') %]</td>
+                <td><input dojoType='dijit.form.TextBox' jsId='oilsSelfckWsName'/></td>
+            </tr>
+            <tr>
+                <td colspan='2' align='center'>
+                    <button jsId='oilsSelfckWsSubmit' dojoType='dijit.form.Button'>[% l('Submit') %]</button>
+                </td>
+            </tr>
+        </table>
+    </form>
+</div>
+
 [% END %]
 
 
diff --git a/Open-ILS/web/js/ui/default/circ/selfcheck/selfcheck.js b/Open-ILS/web/js/ui/default/circ/selfcheck/selfcheck.js
index 303cbb9..61ec139 100644
--- a/Open-ILS/web/js/ui/default/circ/selfcheck/selfcheck.js
+++ b/Open-ILS/web/js/ui/default/circ/selfcheck/selfcheck.js
@@ -15,8 +15,12 @@ dojo.requireLocalization('openils.circ', 'selfcheck');
 var localeStrings = dojo.i18n.getLocalization('openils.circ', 'selfcheck');
 
 // set patron timeout default
-var patronTimeout = 180000; /* 3 minutes */
+var patronTimeout = 160000; /* 2 minutes, 40 seconds */
 var timerId = null;
+// 20 second inactivity warning; total default timeout is 3 minutes.
+var patronTimeoutWarning = 20000; 
+var selfckWarningSetup = false;
+var selfckWarningTimer;
 
 const SET_BARCODE_REGEX = 'opac.barcode_regex';
 const SET_PATRON_TIMEOUT = 'circ.selfcheck.patron_login_timeout';
@@ -37,7 +41,7 @@ openils.User.default_login_agent = 'selfcheck';
 function selfckStartTimer() {
     timerId = setTimeout(
         function() {
-            SelfCheckManager.prototype.logoutPatron();
+            selfckLogoutWarning();
         },
         patronTimeout
     );
@@ -49,6 +53,41 @@ function selfckResetTimer() {
     selfckStartTimer();
 }
 
+function selfckLogoutWarning() {
+
+    // connect the logout warning dialog button handlers if needed
+    if (!selfckWarningSetup) {
+        selfckWarningSetup = true;
+
+        dojo.connect(oilsSelfckLogout, 'onClick', 
+            function() {
+                clearTimeout(selfckWarningTimer);
+                oilsSelfckLogoutDialog.hide();
+                SelfCheckManager.prototype.logoutPatron();
+            }
+        );
+
+        dojo.connect(oilsSelfckContinue, 'onClick', 
+            function() {
+                clearTimeout(selfckWarningTimer);
+                oilsSelfckLogoutDialog.hide();
+                selfckResetTimer();
+            }
+        );
+    }
+
+    // warn the patron of imminent logout
+    oilsSelfckLogoutDialog.show();
+    selfckWarningTimer = setTimeout(
+        function() {
+            // no action was taken, force a logout.
+            oilsSelfckLogoutDialog.hide();
+            SelfCheckManager.prototype.logoutPatron();
+        },
+        patronTimeoutWarning
+    );
+}
+
 function SelfCheckManager() {
 
     this.cgi = new openils.CGI();
@@ -295,8 +334,13 @@ SelfCheckManager.prototype.loadOrgSettings = function() {
     if(settings[SET_BARCODE_REGEX]) 
         this.patronBarcodeRegex = new RegExp(settings[SET_BARCODE_REGEX].value);
 
-    if(settings[SET_PATRON_TIMEOUT])
-        patronTimeout = parseInt(settings[SET_PATRON_TIMEOUT].value) * 1000;
+    // Subtract the timeout warning interval from the configured timeout 
+    // so that when taken together they add up to the configured amount.
+    if(settings[SET_PATRON_TIMEOUT]) {
+        patronTimeout = 
+            (parseInt(settings[SET_PATRON_TIMEOUT].value) * 1000) 
+            - patronTimeoutWarning;
+    }
 }
 
 SelfCheckManager.prototype.drawLoginPage = function() {
@@ -941,6 +985,9 @@ SelfCheckManager.prototype.checkin = function(barcode, abortTransit) {
  */
 SelfCheckManager.prototype.checkout = function(barcode, override) {
 
+    // reset timeout
+    selfckResetTimer();
+
     this.prevCirc = null;
 
     if(!barcode) {

-----------------------------------------------------------------------

Summary of changes:
 .../src/templates/circ/selfcheck/logout_dialog.tt2 |   14 +++++
 Open-ILS/src/templates/circ/selfcheck/main.tt2     |   22 ++++++++
 .../web/js/ui/default/circ/selfcheck/selfcheck.js  |   55 ++++++++++++++++++--
 .../Circulation/selfcheck-logout-warning.txt       |    8 +++
 4 files changed, 95 insertions(+), 4 deletions(-)
 create mode 100644 Open-ILS/src/templates/circ/selfcheck/logout_dialog.tt2
 create mode 100644 docs/RELEASE_NOTES_NEXT/Circulation/selfcheck-logout-warning.txt


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list