Bugzilla – Attachment 103703 Details for
Bug 21565
SCO checkout confirm should be modal
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21565: Add modal to SCO confirm
Bug-21565-Add-modal-to-SCO-confirm.patch (text/plain), 2.77 KB, created by
Lucas Gass (lukeg)
on 2020-04-24 18:40:43 UTC
(
hide
)
Description:
Bug 21565: Add modal to SCO confirm
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2020-04-24 18:40:43 UTC
Size:
2.77 KB
patch
obsolete
>From a0f731edb6a4d814dcf3a8c61baed8ce67eec275 Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Fri, 24 Apr 2020 18:39:02 +0000 >Subject: [PATCH] Bug 21565: Add modal to SCO confirm > >This patch uses the confirmModal framework to add a modal confirm to SCO Finish. >TO TEST: >1. Enable SCO and go to /cgi-bin/koha/sco/sco-main.pl. Make sure SelfCheckReceiptPrompt is set to 'show' >2. Login and click 'Finish' to see the old print alert box. >3. Apply patch and repeat steps 1 and 2. >4. Make sure the modal works for confirming and denying a receipt. Checkout some items and make sure everything still functions the same. >5. Make sure when printing a receipt that the print dialog automatally shows >6. Set SelfCheckReceiptPrompt to 'Don't show' and confirm behavior is acceptable. >--- > .../opac-tmpl/bootstrap/en/modules/sco/sco-main.tt | 17 +++++++++++------ > 1 file changed, 11 insertions(+), 6 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 1b984e6693..3760f6b8fa 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 >@@ -473,17 +473,22 @@ > ] > })); > >- $("#logout_form").submit(function(){ >+ $("#logout_form").submit(function(e){ >+ e.preventDefault(e); > clearTimeout(mainTimeout); > [% IF Koha.Preference('SelfCheckReceiptPrompt') %] > var confirmStart = Date.now(); >- if(confirm(_("Would you like to print a receipt?"))){ >- if ( (Date.now() - confirmStart) < [% SelfCheckTimeout | html %] ) { >- window.open("/cgi-bin/koha/sco/printslip.pl?borrowernumber=[% borrowernumber | html %]&print=qslip"); >+ confirmModal("", _("Would you like to print a receipt?"), _("Yes"), _("No"), function(result) { >+ if ( result && (Date.now() - confirmStart) < [% SelfCheckTimeout | html %] ) { >+ var win = window.open("/cgi-bin/koha/sco/printslip.pl?borrowernumber=[% borrowernumber | html %]&print=qslip"); >+ win.print(); >+ location.href = '/cgi-bin/koha/sco/sco-main.pl?op=logout'; > } else { >- alert(_("Timeout while waiting for print confirmation")); >+ location.href = '/cgi-bin/koha/sco/sco-main.pl?op=logout'; > } >- } >+ }) >+ [% ELSE %] >+ location.href = '/cgi-bin/koha/sco/sco-main.pl?op=logout'; > [% END %] > > return true; >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 21565
:
96107
|
103703
|
103971
|
103972
|
103980
|
104188