Bugzilla – Attachment 10068 Details for
Bug 7563
Silent print slips using Firefox PlugIn jsPrintSetup and new staff client preference
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 7563 [ENH] - Silent print slips using Firefox PlugIn jsPrintSetup and new staff client preference
Bug-7563-ENH---Silent-print-slips-using-Firefox-Pl.patch (text/plain), 5.83 KB, created by
Chris Cormack
on 2012-06-10 10:13:48 UTC
(
hide
)
Description:
Bug 7563 [ENH] - Silent print slips using Firefox PlugIn jsPrintSetup and new staff client preference
Filename:
MIME Type:
Creator:
Chris Cormack
Created:
2012-06-10 10:13:48 UTC
Size:
5.83 KB
patch
obsolete
>From 8677bc169b72d43ca2f044c5fbe6f68240318899 Mon Sep 17 00:00:00 2001 >From: Marc Veron <veron@veron.ch> >Date: Fri, 8 Jun 2012 12:58:35 +0200 >Subject: [PATCH] Bug 7563 [ENH] - Silent print slips using Firefox PlugIn > jsPrintSetup and new staff client preference > >Configure slip printers to print slips (silently) to a special printer using the Firefox PlugIn jsPrintSetUp. >All other print actions are not affected. See http://jsprintsetup.mozdev.org/ for all the possibilities >(e.g. change header/footer, get a list of printers, set printer etc.). > >The overall concept is to have a new staff client preference (IntranetSlipPrinterJS) where one can enter the necessary JavaScript. > >If the preference is empty, Koha falls back to te default behaviour. An example of JavaScript can be found on: > >Signed-off-by: Marc Veron <veron@veron.ch> >Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> >--- > installer/data/mysql/sysprefs.sql | 2 ++ > installer/data/mysql/updatedatabase.pl | 5 +++++ > .../prog/en/modules/admin/preferences/staff_client.pref | 5 +++++ > koha-tmpl/intranet-tmpl/prog/en/modules/circ/printslip.tt | 12 ++++++++---- > members/printslip.pl | 2 ++ > 5 files changed, 22 insertions(+), 4 deletions(-) > >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index c4060fe..481e949 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -369,3 +369,5 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' > INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('SuspendHoldsIntranet', '1', NULL , 'Allow holds to be suspended from the intranet.', 'YesNo'); > INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('SuspendHoldsOpac', '1', NULL , 'Allow holds to be suspended from the OPAC.', 'YesNo'); > INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('DefaultLanguageField008','','Fill in the default language for field 008 Range 35-37 (e.g. eng, nor, ger, see <a href="http://www.loc.gov/marc/languages/language_code.html">MARC Code List for Languages</a>)','','Free'); >+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('IntranetSlipPrinterJS','','Use this JavaScript for printing slips. Define at least function printThenClose(). For use e.g. with Firefox PlugIn jsPrintSetup, see http://jsprintsetup.mozdev.org/','','Free'); >+ >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 62b4372..52c0783 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -5333,6 +5333,11 @@ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { > $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('SuspendHoldsIntranet', '1', NULL , 'Allow holds to be suspended from the intranet.', 'YesNo')"); > $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('SuspendHoldsOpac', '1', NULL , 'Allow holds to be suspended from the OPAC.', 'YesNo')"); > print "Upgrade to $DBversion done (Add system preference OpacBrowseResults ))\n"; >+ >+$DBversion ="XXX"; >+if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { >+ $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('IntranetSlipPrinterJS','','Use this JavaScript for printing slips. Define at least function printThenClose(). For use e.g. with Firefox PlugIn jsPrintSetup, see http://jsprintsetup.mozdev.org/','','Free')"); >+ print "Upgrade to $DBversion done (Add system preference IntranetSlipPrinterJS))\n"; > SetVersion($DBversion); > } > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_client.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_client.pref >index b93f8fd..b6be289 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_client.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_client.pref >@@ -16,6 +16,11 @@ Staff Client: > class: url > - on all pages in the staff interface, instead of the default. (This should be a complete URL, starting with <code>http://</code>.) > - >+ - "Use the following JavaScript for printing slips. Define at least function printThenClose(). For use e.g. with Firefox PlugIn jsPrintSetup, see http://jsprintsetup.mozdev.org/:" >+ - pref: IntranetSlipPrinterJS >+ type: textarea >+ class: code >+ - > - "Include the following CSS on all pages in the staff client:" > - pref: IntranetUserCSS > type: textarea >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 3e60d73..7b29d4e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/printslip.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/printslip.tt >@@ -8,10 +8,14 @@ > [% END %] > > <script language="javascript"> >- function printThenClose() { >- window.print(); >- window.close(); >- } >+[% IF ( IntranetSlipPrinterJS ) %] >+ [% IntranetSlipPrinterJS %] >+[% ELSE %] >+ function printThenClose() { >+ window.print(); >+ window.close(); >+ } >+[% END %] > </script> > </head> > <body id="circ_printslip" class="circ" onload="printThenClose();"> >diff --git a/members/printslip.pl b/members/printslip.pl >index 3a499cd..71fdda2 100755 >--- a/members/printslip.pl >+++ b/members/printslip.pl >@@ -89,4 +89,6 @@ $template->param( > error => $error, > ); > >+$template->param( IntranetSlipPrinterJS => C4::Context->preference('IntranetSlipPrinterJS' ) ); >+ > output_html_with_http_headers $input, $cookie, $template->output; >-- >1.7.10
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 7563
:
9290
|
9306
|
9307
|
9981
|
10063
|
10068
|
10071
|
10073
|
10104
|
10427
|
10428
|
10557
|
10570
|
11149