tweaks to self-check
authorGalen Charlton <gmc@esilibrary.com>
Thu, 4 Aug 2016 16:50:46 +0000 (12:50 -0400)
committerGalen Charlton <gmc@esilibrary.com>
Thu, 4 Aug 2016 16:50:46 +0000 (12:50 -0400)
* redirect page if user elects to have no receipt
  upon logging out
* correctly invoke open-ils.circ.checkout.batch_notify.session
* hide not just the email checkbox, but the label as well if
  user doesn't have email receipts enabled

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Open-ILS/src/templates/circ/selfcheck/summary.tt2
Open-ILS/web/js/ui/default/circ/selfcheck/selfcheck.js

index 82ffb2d..2e0b44e 100644 (file)
@@ -7,7 +7,7 @@
         <span for='oils-selfck-nav-receipt'>[% l('Receipt:') %] </span>
         <span><input type="radio" name="receipt_type" id='oils-selfck-receipt-print' value="email" checked/>[% l('Print') %]</span>
         <span><input type="radio" name="receipt_type" id='oils-selfck-receipt-none' value="email"/>[% l('None') %]</span>
-        <span><input type="radio" name="receipt_type" id='oils-selfck-receipt-email' value="email" class='hidden'/>[% l('Email') %]</span>
+        <span class="hidden"><input type="radio" name="receipt_type" id='oils-selfck-receipt-email' value="email"/>[% l('Email') %]</span>
     </div>
     <fieldset>
         <legend>[% l('Items Checked Out') %]</legend>
index 748f973..3959fbc 100644 (file)
@@ -469,7 +469,7 @@ SelfCheckManager.prototype.fetchPatron = function(barcode, usrname) {
         if (this.patron.email() && // they have an email address set and ...
             this.patron.email().match(/.*@.*/).length > 0 // it sorta looks like an email address
         ) {
-            openils.Util.removeCSSClass( dojo.byId('oils-selfck-receipt-email'), 'hidden' );
+            openils.Util.removeCSSClass( dojo.byId('oils-selfck-receipt-email').parentNode, 'hidden' );
             if (user_setting_value(this.patron, 'circ.send_email_checkout_receipts') == 'true') // their selected default
                 dojo.byId('oils-selfck-receipt-email').checked = true;
         }
@@ -1345,8 +1345,6 @@ SelfCheckManager.prototype.emailSessionReceipt = function(callback) {
     var params = [
         this.authtoken, 
         this.patron.id(),
-        null,
-        'format.selfcheck.checkout',
         circIds
     ];
 
@@ -1651,6 +1649,9 @@ SelfCheckManager.prototype.logoutPatron = function(print) {
                     location.href = location.href;
                 }
             );
+        } else {
+            // user elected to get no receipt
+            location.href = location.href;
         }
     } else {
         location.href = location.href;