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 <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit e4e31117e7)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Owen Leonard 2020-04-29 17:57:44 +00:00 committed by Lucas Gass
parent 0283892d44
commit c8aaa47e82
2 changed files with 7 additions and 3 deletions

View File

@ -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 %]&amp;print=qslip");
win.print();

View File

@ -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');
}
}