JBAS-821 SCKO post-barcode timer; cleanup
authorBill Erickson <berickxx@gmail.com>
Wed, 21 Oct 2015 16:42:54 +0000 (12:42 -0400)
committerBill Erickson <berickxx@gmail.com>
Thu, 21 Mar 2019 19:46:23 +0000 (15:46 -0400)
Reinstate the timeout that occurs between entering a barcode and failing
to enter a password.

Remove some trailing references to the defunct keepMeLoggedIn function.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
KCLS/openils/var/templates_kcls/circ/selfcheck/main.tt2
Open-ILS/web/js/ui/kcls/circ/selfcheck/payment.js
Open-ILS/web/js/ui/kcls/circ/selfcheck/selfcheck.js

index aaf2607..60e31c2 100644 (file)
@@ -133,7 +133,7 @@ function switchTo(str,subpage) {
                   <tbody id='oils-selfck-fines-tbody'>
                <tr id='oils-selfck-fines-row'><td width="443">
               <table cellpadding="2" cellspacing="0" border="0" width="100%">
-                <tr><td class="label"><input style="float:left;margin:2px;" class="hidden" type="checkbox" checked="checked" name='selector' onclick='selfCheckMgr.keepMeLoggedIn();' title='pay this fine' /> TITLE:</td><td name="title"></td></tr>
+                <tr><td class="label"><input style="float:left;margin:2px;" class="hidden" type="checkbox" checked="checked" name='selector' onclick='selfckResetTimer();' title='pay this fine' /> TITLE:</td><td name="title"></td></tr>
                 <tr><td class="label">DUE DATE:</td><td name="due_date"></td></tr>
                 <tr><td class="label">DATE RETURN:</td><td name="date_return"></td></tr>
                 <tr><td class="label">BALANCE OWED:</td><td style="color:red;">$<span name="balance"></span></td></tr>
@@ -214,7 +214,7 @@ function switchTo(str,subpage) {
           <div style=""><a href="javascript:;" id='oils-selfck-nav-logout'><img alt='logout without receipt' src="[% ctx.media_prefix %]/images/selfcheck/logoutwithoutreceiptbutton.jpg" style="" /></a></div>
         </div>
         <div style="clear:both;padding-top:15px;padding-left:3px;">
-          <a href="javascript:;" id="back_button" onclick="selfCheckMgr.keepMeLoggedIn();switchTo('step3');"><img alt='back to checkout' src="[% ctx.media_prefix %]/images/selfcheck/arrow.gif" /></a> <a href="javascript:;" onclick="selfCheckMgr.keepMeLoggedIn();switchTo('step3');"><span style="position:relative;top:-4px;left:2px;">Back to Checkout</span></a>
+          <a href="javascript:;" id="back_button" onclick="switchTo('step3');"><img alt='back to checkout' src="[% ctx.media_prefix %]/images/selfcheck/arrow.gif" /></a> <a href="javascript:;" onclick="switchTo('step3');"><span style="position:relative;top:-4px;left:2px;">Back to Checkout</span></a>
         </div>
           </div>
 <script src="[% ctx.media_prefix %]/js/ui/kcls/circ/selfcheck/floating.js"></script>
index 1c58d63..5c05a22 100644 (file)
@@ -82,7 +82,7 @@ proto.drawPayFinesPage = function(patron, total, xacts, onPaymentSubmit) {
 // TODO add per-transaction blocks for orgs that do not support CC payments
 
 proto.sendCCPayment = function(patron, xacts, onPaymentSubmit) {
-       this.keepMeLoggedIn();
+    selfckResetTimer();
     var args = {
         userid : patron.id(),
         payment_type : 'credit_card_payment',
index 307f5f1..f27b1d4 100644 (file)
@@ -43,10 +43,14 @@ const SET_BLOCK_CHECKOUT_ON_COPY_STATUS = 'circ.selfcheck.block_checkout_on_copy
 openils.User.default_login_agent = 'selfcheck';
 
 // start the logout timer
-function selfckStartTimer() {
+function selfckStartTimer(noWarning) {
     timerId = setTimeout(
         function() {
-            selfckLogoutWarning();
+            if (noWarning) {
+                SelfCheckManager.prototype.logoutPatron();
+            } else {
+                selfckLogoutWarning();
+            }
         },
         patronTimeout
     );
@@ -56,11 +60,12 @@ function selfckStartTimer() {
 function selfckResetTimer() {
     console.log('clearing login timer');
     clearTimeout(timerId);
-    
-    if (selfCheckManager && selfCheckManager.patron) {
-        console.log('Starting new login timer');
-        selfckStartTimer();
-    }
+    if (!selfCheckManager) return;
+    console.log('Starting new login timer');
+            
+    // do not show a warning dialog if the inactivity timeout
+    // occurs between entering a barcode and password.
+    selfckStartTimer(!Boolean(selfCheckManager.patron));
 }
 
 function selfckLogoutWarning() {
@@ -356,8 +361,9 @@ SelfCheckManager.prototype.drawLoginPage = function() {
     var bcHandler = function(barcode) {
         // handle patron barcode entry
 
+
         if(self.orgSettings[SET_PATRON_PASSWORD_REQUIRED]) {
-            
+
             // password is required.  wire up the scan box to read it
             self.updateScanBox({
                 msg : 'Please enter your password', // TODO i18n 
@@ -990,7 +996,9 @@ SelfCheckManager.prototype.checkout = function(barcode, override) {
     this.prevCirc = null;
 
     if(!barcode) {
-        this.updateScanbox(null, true);
+        // commenting this line out becuase it's misspelled and
+        // not doing anything but throwing an error.
+        //this.updateScanbox(null, true);
         return;
     }