From 1507c58f96deff97ce091756909f817edcc2d8f9 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Wed, 15 Feb 2017 12:33:56 -0500 Subject: [PATCH] JBAS-1665 return-to=self option; timeout repairs Adds a special ?return-to=self parameter, telling the UI to return to its own URL after completion / timeout / exit. Rely solely on JS activity checker for page timeouts. Otherwise, the refresh simply overrides the activity checker. Put all timeout value configuration into the template so no JS changes are required for timeout changes. Signed-off-by: Bill Erickson --- KCLS/openils/var/templates_kcls/opac/register.tt2 | 22 ++++++++++++++++------ Open-ILS/web/js/ui/default/opac/register.js | 14 +++----------- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/KCLS/openils/var/templates_kcls/opac/register.tt2 b/KCLS/openils/var/templates_kcls/opac/register.tt2 index 8efe7769c2..2b34da7cb3 100644 --- a/KCLS/openils/var/templates_kcls/opac/register.tt2 +++ b/KCLS/openils/var/templates_kcls/opac/register.tt2 @@ -6,9 +6,6 @@ # for privacy, reload the page after (default) 5 minutes return_to = CGI.param('return-to'); kiosk = CGI.param('kiosk'); -refresh_time = ctx.register.settings.refresh_timeout || 300; -complete_url = return_to || 'https://www.kcls.org' -ctx.refresh = refresh_time _ '; ' _ complete_url; # Ugh, CGI.new/.param insists on mangling the return-to URL. # Build the redo_url by hand. @@ -20,6 +17,19 @@ IF return_to; END; SET redo_url = redo_url _ joiner _ 'kiosk=1' IF kiosk; +complete_url = 'https://www.kcls.org'; +IF return_to; + IF return_to == 'self'; + # 'self' is a special return-to value that means return back to the + # current URL. Without this, to return back to the samge page, + # we'd need an infinitely nesting series of return-to values. + # The self URL is the same as the redo ("submit another") url. + complete_url = redo_url; + ELSE; + complete_url = return_to; + END; +END; + # some useful variables and MACROs for display, # field validation, and added info display ctx_org = ctx.physical_loc || ctx.search_ou || ctx.aou_tree.id; @@ -70,15 +80,15 @@ END; # input_field() - [% l('[_1]', ctx.page_title) %] [% INCLUDE 'opac/parts/goog_analytics.tt2' %]