JBAS-1665 Selfcheck return-to URL option
authorBill Erickson <berickxx@gmail.com>
Fri, 6 Jan 2017 19:53:31 +0000 (14:53 -0500)
committerBill Erickson <berickxx@gmail.com>
Thu, 21 Mar 2019 19:46:23 +0000 (15:46 -0400)
New URL option return-to=http://example.org used for overriding the
default patron timeout / logout destination.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/web/js/ui/kcls/circ/selfcheck/selfcheck.js

index 608ae47..deefe6a 100644 (file)
@@ -1566,15 +1566,18 @@ SelfCheckManager.prototype.printFinesReceipt = function(callback) {
  * Logout the patron and return to the login page
  */
 SelfCheckManager.prototype.logoutPatron = function(print) {
+
+    var return_url = this.cgi.param('return-to') || location.href;
+
     progressDialog.show(true); // prevent patron from clicking logout link twice
     if(print && this.checkouts.length) {
         this.printSessionReceipt(
             function() {
-                location.href = location.href;
+                location.href = return_url;
             }
         );
     } else {
-        location.href = location.href;
+        location.href = return_url;
     }
 }