View | Details | Raw Unified | Return to bug 36586
Collapse All | Expand All

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/sci/sci-main.tt (-23 / +5 lines)
Lines 202-207 Link Here
202
202
203
[% INCLUDE 'opac-bottom.inc' %]
203
[% INCLUDE 'opac-bottom.inc' %]
204
[% BLOCK jsinclude %]
204
[% BLOCK jsinclude %]
205
[% Asset.js('js/timeout.js') | $raw %]
205
    <script>
206
    <script>
206
207
207
        function mungeHistory() {
208
        function mungeHistory() {
Lines 273-301 Link Here
273
});
274
});
274
275
275
276
276
        var idleTime = 0;
277
        let idleTimeout = [% Koha.Preference('SelfCheckInTimeOut') || 120 %];
277
        $(document).ready(function () {
278
        let refresh_button = $("#sci_refresh_button");
278
            //Increment the idle time counter every second
279
        let finish_button = $("#sci_finish_button");
279
            var idleInterval = setInterval(timerIncrement, 1000);
280
        let home_href = "/cgi-bin/koha/sci/sci-main.pl";
280
281
            //Zero the idle timer on mouse movement.
282
            $(this).mousemove(function (e) {
283
                idleTime = 0;
284
            });
285
            $(this).keypress(function (e) {
286
                idleTime = 0;
287
            });
288
        });
289
290
        function timerIncrement() {
291
            if ( $("#sci_finish_button").is(":visible") || $("#sci_refresh_button").is(":visible") ) {
292
                idleTime = idleTime + 1;
293
                idleTimeout = [% refresh_timeout | html %];
294
                if (idleTime >= idleTimeout ) {
295
                    location.href = '/cgi-bin/koha/sci/sci-main.pl';
296
                }
297
            }
298
        }
299
281
300
282
301
        function checkBarcodeInput() {
283
        function checkBarcodeInput() {
(-)a/opac/sci/sci-main.pl (-5 lines)
Lines 105-112 if ( $op eq 'cud-check_in' ) { Link Here
105
    $template->param( success => \@success, errors => \@errors, checkins => 1 );
105
    $template->param( success => \@success, errors => \@errors, checkins => 1 );
106
}
106
}
107
107
108
# Make sure timeout has a reasonable value
109
my $timeout = C4::Context->preference('SelfCheckInTimeout') || 120;
110
$template->param( refresh_timeout => $timeout );
111
112
output_html_with_http_headers $cgi, $cookie, $template->output, undef, { force_no_caching => 1 };
108
output_html_with_http_headers $cgi, $cookie, $template->output, undef, { force_no_caching => 1 };
113
- 

Return to bug 36586