From f6074c3ea19ce74ab13fccf5596c3975b309ac64 Mon Sep 17 00:00:00 2001 From: David Cook Date: Wed, 18 Jun 2025 01:56:41 +0000 Subject: [PATCH] Bug 40158: [alternate] Remove unnecessary timeout check on sco slip print This change removes an unnecessary/buggy SelfCheckTimeout check when using SelfCheckReceiptPrompt slip printing. To test: 1. Have SelfCheckReceiptPrompt enabled 2. Go to the self checkout module 3. Login and press 'Finish' 4. Click 'Print receipt and end session' 5. The print screen isn't shown and the user is just logged out 6. APPLY PATCH and refresh the page 7. Login and press 'Finish' then click "Print receipt and end session" 8. You should now see a print screen Notes: Set SelfCheckTimeout to a small value like 10 to see that not choosing an option for the SelfCheckReceiptPrompt will mean you're automatically logged out by the timer. If you do choose "Print receipt and end session", the original window will redirect to the logout endpoint, but it won't completely load until after the print screen is actioned - at least in Chrome. Signed-off-by: Lucas Gass --- koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt index 486b442fcd7..e953e050370 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt @@ -513,9 +513,8 @@ $("#logout_form").on("click", function(e){ e.preventDefault(e); [% IF Koha.Preference('SelfCheckReceiptPrompt') %] - var confirmStart = Date.now(); confirmModal("", _("Would you like to print a receipt?"), _("Print receipt and end session"), _("End session"), function(result) { - if ( result && (Date.now() - confirmStart) < [% Koha.Preference('SelfCheckTimeout') | html %] ) { + if ( result ) { var win = window.open("/cgi-bin/koha/sco/printslip.pl?print=qslip"); location.href = '/cgi-bin/koha/sco/sco-main.pl?op=logout'; } else { -- 2.39.5