From 569f3915d7212f580b7a5bf6c7767c6374c279dd Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Wed, 29 Apr 2020 17:57:44 +0000 Subject: [PATCH] Bug 21565: (follow-up) Make confirmation buttons more detailed This patch updates the confirmation buttons to be more specific about what each one does. My concern was that it wasn't clear that "No" meant "No receipt" and not "Cancel logging out." The patch also updates the modal confirmation code so that the modal body is removed if no message is passed for it. To test, apply the patch and repeat the previous test plan. When you click "Finish" you should have the options "Print receipt and end session" and "End session." Signed-off-by: Katrin Fischer Signed-off-by: Martin Renvoize --- koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt | 2 +- koha-tmpl/opac-tmpl/bootstrap/js/global.js | 6 +++++- 2 files changed, 6 insertions(+), 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 6383a7a1a0..4b3fe8a652 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 @@ -478,7 +478,7 @@ clearTimeout(mainTimeout); [% IF Koha.Preference('SelfCheckReceiptPrompt') %] var confirmStart = Date.now(); - confirmModal("", _("Would you like to print a receipt?"), _("Yes"), _("No"), function(result) { + confirmModal("", _("Would you like to print a receipt?"), _("Print receipt and end session"), _("End session"), 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(); diff --git a/koha-tmpl/opac-tmpl/bootstrap/js/global.js b/koha-tmpl/opac-tmpl/bootstrap/js/global.js index ac1bc27af9..76ce7b5cb0 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/js/global.js +++ b/koha-tmpl/opac-tmpl/bootstrap/js/global.js @@ -82,7 +82,11 @@ function confirmModal(message, title, yes_label, no_label, callback) { } $("#bootstrap-confirm-box-modal .modal-header h4").text( title || "" ); - $("#bootstrap-confirm-box-modal .modal-body").html( message || "" ); + if( message && message != "" ){ + $("#bootstrap-confirm-box-modal .modal-body").html( message || "" ); + } else { + $("#bootstrap-confirm-box-modal .modal-body").remove(); + } $("#bootstrap-confirm-box-modal-submit").text( yes_label || 'Confirm' ); $("#bootstrap-confirm-box-modal-cancel").text( no_label || 'Cancel' ); $("#bootstrap-confirm-box-modal").modal('show'); -- 2.39.5