From dc38bf4f6ccaaef36ebc098949170e0d8d55ba3c Mon Sep 17 00:00:00 2001 From: David Cook Date: Wed, 21 May 2014 13:22:10 +1000 Subject: [PATCH] Bug 11014 - Slip Print Problem in Chrome Currently, slips cannot be printed in circulation, members, or the self check out when using Chrome. This patch adds a timer of 1ms which allows Chrome's custom code to prevent "window.close" occuring before the user has dealt with the print window. This patch also allows admins to use the 'IntranetSlipPrinterJS' system preference to override the slip printing code by centralizing all the slip printing code in slip-print.inc, and including this JS anywhere it's needed in the staff client. I haven't used this include in the OPAC SCO but perhaps it would make sense to do so as well (even if it isn't referred to in the syspref's name). _TEST PLAN_ 1) Using Chrome on Windows (not sure if this is an issue on other OSes), try to print a slip in the following locations: Fines Tab -> Print button koha-tmpl/intranet-tmpl/prog/en/modules/members/printfeercpt.tt: Details tab -> Print button -> Print slip || Print quick slip koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-receipt.tt: Details tab -> Print button -> Print summary koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-print.tt: Fines tab -> Accounts tab -> Print (Manual invoice of $5 sundry) koha-tmpl/intranet-tmpl/prog/en/modules/members/printinvoice.tt: Checkout tab -> Print button koha-tmpl/intranet-tmpl/prog/en/modules/circ/printslip.tt: Finish button koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/printslip.tt 2) Note that each time you try to print, a new print page is created but closed before you have a chance to print. 3) Apply the patch 4) Repeat Step 1 5) Note that the print page now doesn't close until after you've chosen to print or cancel. Signed-off-by: Christopher Brannon Signed-off-by: Kyle M Hall Signed-off-by: Tomas Cohen Arazi Signed-off-by: Galen Charlton --- .../intranet-tmpl/prog/en/includes/slip-print.inc | 10 ++++++++++ .../intranet-tmpl/prog/en/modules/circ/printslip.tt | 11 +---------- .../prog/en/modules/members/moremember-print.tt | 8 ++------ .../prog/en/modules/members/moremember-receipt.tt | 8 ++------ .../prog/en/modules/members/printfeercpt.tt | 8 ++------ .../prog/en/modules/members/printinvoice.tt | 8 ++------ .../opac-tmpl/bootstrap/en/modules/sco/printslip.tt | 2 +- 7 files changed, 20 insertions(+), 35 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/slip-print.inc diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/slip-print.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/slip-print.inc new file mode 100644 index 0000000000..413f4bbbcf --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/slip-print.inc @@ -0,0 +1,10 @@ + \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/printslip.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/printslip.tt index 7dc5b8136c..8e2b25be41 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/printslip.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/printslip.tt @@ -8,16 +8,7 @@ [% END %] - +[% INCLUDE 'slip-print.inc' #printThenClose %]
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-print.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-print.tt index eee5aeff4d..4c7107245f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-print.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-print.tt @@ -1,15 +1,11 @@ +[% USE Koha %] [% USE KohaDates %] [% INCLUDE 'doc-head-open.inc' %] Summary for [% firstname %] [% surname %] ([% cardnumber %]) - +[% INCLUDE 'slip-print.inc' #printThenClose %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-receipt.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-receipt.tt index 80d3dc020f..c7d67a11aa 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-receipt.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-receipt.tt @@ -1,15 +1,11 @@ +[% USE Koha %] [% INCLUDE 'doc-head-open.inc' %] Print Receipt for [% cardnumber %] - +[% INCLUDE 'slip-print.inc' #printThenClose %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/printfeercpt.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/printfeercpt.tt index 26be3f4907..64bbf354df 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/printfeercpt.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/printfeercpt.tt @@ -1,14 +1,10 @@ +[% USE Koha %] [% INCLUDE 'doc-head-open.inc' %] Print Receipt for [% cardnumber %] - +[% INCLUDE 'slip-print.inc' #printThenClose %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/printinvoice.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/printinvoice.tt index 8a19918c85..29e64da276 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/printinvoice.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/printinvoice.tt @@ -1,14 +1,10 @@ +[% USE Koha %] [% INCLUDE 'doc-head-open.inc' %] Print Receipt for [% cardnumber %] - +[% INCLUDE 'slip-print.inc' #printThenClose %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/printslip.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/printslip.tt index 224c9165c3..8ad25acf6e 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/printslip.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/printslip.tt @@ -23,7 +23,7 @@ -- 2.39.5