From b5bc9cf3437f6f68ae207e72fdd449e6f1ab5489 Mon Sep 17 00:00:00 2001 From: David Cook Date: Wed, 4 Dec 2024 21:10:55 +0000 Subject: [PATCH] Bug 36586: Define self-checkin timer using Javascript class This patch rewrites the self-checkin timer code to be defined in a Javascript class which is then instantiated in once in sci-main.pl depending on certain conditions (ie a barcode has been entered, or an item has been checked in by barcode). To test: 1 - Set SelfCheckinTimeout to a small value like 5 2 - Go to the self checkin: http://localhost:8080/cgi-bin/koha/sci/sci-main.pl 3 - Sign in as the SCI user 4 - Watch the page, it should refresh every 5 seconds 5 - Confirm that moving the mouse/typing prevents the reset 6 - Check in an item 7 - Wait and confirm reload of main page happens when idle 8 - Confirm mouse/typing prevents refresh 9 - Sign off! Signed-off-by: David Nind Signed-off-by: Martin Renvoize Bug 36586: Add sc-timer to sco This patch implements the timer form the last patch on the sco To test: 1 - Set SelfCheckTimout to 5 or something low for testing 2 - Go to the self checkout module 3 - Either sign in or confirm you have AutoSelfCheck user setup 4 - Observe the page reloads every 5 seocnds (or as you set above) 5 - Sign in as a patron 6 - Confirm on idle you are logged out to home page 7 - Sign off! Signed-off-by: David Nind Signed-off-by: Martin Renvoize Bug 36586: Fix tidy Signed-off-by: Katrin Fischer (cherry picked from commit ff403dcfb3e2972597a49b447f4d55c208f13f4d) Signed-off-by: Paul Derscheid --- .../bootstrap/en/modules/sci/sci-main.tt | 37 +++++----- .../bootstrap/en/modules/sco/sco-main.tt | 68 +++++++++++-------- koha-tmpl/opac-tmpl/bootstrap/js/timeout.js | 39 +++++++++++ opac/sci/sci-main.pl | 4 -- opac/sco/sco-main.pl | 9 +-- 5 files changed, 95 insertions(+), 62 deletions(-) create mode 100644 koha-tmpl/opac-tmpl/bootstrap/js/timeout.js diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/sci/sci-main.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/sci/sci-main.tt index 8308303626..157752faa6 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/sci/sci-main.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/sci/sci-main.tt @@ -202,6 +202,7 @@ [% INCLUDE 'opac-bottom.inc' %] [% BLOCK jsinclude %] + [% Asset.js('js/timeout.js') | $raw %]