From cc0c53dfd8b231a265e0ed90bbe7e2aae81e4f9c 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: Lucas Gass --- 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 12875f49d5..763e0b05a6 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 84ee7e844b..2c19d8ee8b 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.11.0