From e4e31117e7dcdc769f6c94553165202c49c7e0ae 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 | 8 ++++++-- 2 files changed, 7 insertions(+), 3 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 35d7200279..71ab2a8070 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 7f95b324ff..7795cc6159 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/js/global.js +++ b/koha-tmpl/opac-tmpl/bootstrap/js/global.js @@ -82,8 +82,12 @@ function confirmModal(message, title, yes_label, no_label, callback) { } $("#bootstrap-confirm-box-modal .modal-header h4").text( title || "" ); - $("#bootstrap-confirm-box-modal .modal-body p").text( 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'); -} \ No newline at end of file +} -- 2.39.5