Description
Marc Véron
2012-02-20 23:50:29 UTC
Created attachment 9290 [details] Bug 7563 [ENH] - Silent print slips using Firefox PlugIn jsPrintSetup and new staff client preference Marc Veron <veron@veron.ch> modified: mysql/sysprefs.sql modified: mysql/updatedatabase.pl modified: ../../koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-print.tt modified: ../../koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-receipt.tt modified: ../../members/printslip.pl Please do not use first patch (mistaked with files). New patch will follow. Marc Hi Marc, you can obsolete the patch, so that noone uses it. It will still be accesssible. Details > edit details (behind bug title) > obsolete checkbox Created attachment 9306 [details] 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: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7563 Koha 3.8.0 bump Marc Veron <veron@veron.ch> modified: installer/data/mysql/updatedatabase.pl modified: kohaversion.pl modified: installer/data/mysql/sysprefs.sql modified: installer/data/mysql/updatedatabase.pl modified: koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_client.pref modified: koha-tmpl/intranet-tmpl/prog/en/modules/circ/printslip.tt modified: members/printslip.pl Created attachment 9307 [details] [review] 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: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7563 modified: installer/data/mysql/sysprefs.sql modified: installer/data/mysql/updatedatabase.pl modified: koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_client.pref modified: koha-tmpl/intranet-tmpl/prog/en/modules/circ/printslip.tt modified: members/printslip.pl Created attachment 9981 [details] [review] 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: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7563 i# Please enter the commit message for your changes. Lines starting Did not longer apply. Remade patch, would be nice to get a signoff. Created attachment 10063 [details] [review] 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: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7563 i# Please enter the commit message for your changes. Lines starting Signed-off-by: Marc Veron <veron@veron.ch> Did not longer apply, redone patch. "Signed off by " in last comment by mistake. Created attachment 10068 [details] [review] 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> Created attachment 10071 [details] [review] 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: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7563 Created attachment 10073 [details] [review] 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: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7563 Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> QA comment: I think this change was not really wanted: - SetVersion($DBversion); -} as it result in updatedatabase not compiling: Missing right curly or square bracket at installer/data/mysql/updatedatabase.pl line 5434, at end of line syntax error at installer/data/mysql/updatedatabase.pl line 5434, at EOF installer/data/mysql/updatedatabase.pl had compilation errors. Fixed, was a bad merge conflict fix Created attachment 10104 [details] [review] 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: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7563 Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> http://bugs.koha-community.org/show_bug.cgi?id=7653 QA Comment: small new feature, introduced nicely through a systempreference, in a nice and extensible way I think. It would be worth to add it also on other places where we do a window.print() for consistency. grep -R "window.print()" * shows that we print in the following pages: koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detailprint.tt: window.print(); koha-tmpl/intranet-tmpl/prog/en/modules/members/printinvoice.tt: window.print(); koha-tmpl/intranet-tmpl/prog/en/modules/members/printfeercpt.tt: window.print(); koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-receipt.tt: window.print(); koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-print.tt: window.print(); koha-tmpl/intranet-tmpl/prog/en/modules/labels/spinelabel-print.tt: <body id="labels_spinelabel-print" class="tools labels" onLoad="window.print()"> koha-tmpl/intranet-tmpl/prog/en/modules/labels/spinelabel-print.tt:<button onclick="window.print()">Print this label</button> koha-tmpl/intranet-tmpl/prog/en/modules/circ/transfer-slip.tt:window.print(); koha-tmpl/intranet-tmpl/prog/en/modules/circ/printslip.tt:window.print(); koha-tmpl/intranet-tmpl/prog/en/modules/serials/routing-preview-slip.tt: <a class="button" href="javascript:window.print();self.close()">Print</a> <a class="button" href="javascript:self.close()">Close</a> koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tt:<p class="noprint"><a href="#" onclick="window.print(); return false;">Print</a> <a href="#" class="close">Close</a></p> koha-tmpl/intranet-tmpl/prog/en/xslt/oilsMARC21slim2HTML.xsl:<div><button onclick='window.print();'>Print Page</button></div> I hesitate failing QA because of this non consistent behaviour, I won't mark it passed QA nor failed QA, to get another QA team opinion. Paul, I agree with you, this feature must be used for all occurrences of "window.print". But it is not blocking. I think this patch could be pushed though a followup is required asap. I let you make the decision ;-) Paul and Jonathan, Thank you for your comments. When I introduced this feature, I was aware that it could be used at other places as well. This version is just for the use case where a lot of printing occurs, and it was made by advice of the librarians in our group who often work at the front desk and who told me that not having this feature could be a killer argument against Koha. I really would appreciate if you could push it, and I will be happy to deliver follow ups for the other use cases as well. Thanks again Marc Created attachment 10427 [details] [REBASED] Bug 8272 - OPAC : date expiration format Adding TT date filter to output of expiration date on OPAC user page. Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> Signed-off-by: Delaye Stephane <stephane.delaye@biblibre.com> Signed-off-by: Paul Poulain <paul.poulain@biblibre.com> Comment on attachment 10427 [details] [REBASED] Bug 8272 - OPAC : date expiration format Something went wrong with teh attachment... Comment on attachment 10104 [details] [review] Bug 7563 [ENH] - Silent print slips using Firefox PlugIn jsPrintSetup and new staff client preference REstoring previous attachment... Created attachment 10428 [details] [review] [REBASED] 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: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7563 Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> http://bugs.koha-community.org/show_bug.cgi?id=7653 Created attachment 10557 [details] [review] [REBASED] Bug 7563 [ENH] - Silent print slips using Firefox PlugIn jsPrintSetup and new staff client preference (Rebased to Koha version: 3.09.00.018) Created attachment 10570 [details] [review] [REBASED] Bug 7563 - Silent print slips using Firefox PlugIn jsPrintSetup and new staff client preference ...to version 3.09.00.021 QA comment, my concern has been answered in comment #18 > Paul and Jonathan, > > Thank you for your comments. When I introduced this feature, I was aware > that it could be used at other places as well. This version is just for the > use case where a lot of printing occurs, and it was made by advice of the > librarians in our group who often work at the front desk and who told me > that not having this feature could be a killer argument against Koha. > > I really would appreciate if you could push it, and I will be happy to > deliver follow ups for the other use cases as well. Passed QA then Thanks for QA-ing, Paul. I will work on the follow-ups you suggested after my vacation. Marc I'm trying to document this and am having trouble. The preference says "Define at least function printThenClose()." which makes me think that this preference must have that function in there for Koha to work. We might need to make it clearer. Can someone write a short description of this preference in librarianese (aka not developer talk) so that I can edit it and put it in the manual? Nicole via IRC: [10:34] <oleonard> nengard it looks like there's two basic steps: Install the jsPrintSetup addon, and populate the pref [10:35] <oleonard> That first comment gives you an example for what to populate the pref with in Step 4 [10:35] <nengard> THANK YOU [10:35] <nengard> :) [10:35] <nengard> I was missing the whole install the add on part [10:35] <nengard> we should update the description on that preference to make it clearer [10:35] <oleonard> Hmmm... not sure about the "Choose printer using one or more of the following functions" step Yeah, this part is cryptic: //Choose printer using one or more of the following functions //jsPrintSetup.getPrintersList... //jsPrintSetup.setPrinter... Is this something I must configure in order for this feature to work? I installed the Firefox addon (https://addons.mozilla.org/en-US/firefox/addon/js-print-setup/) and populated the system preference with the JS code exactly as it appears in Step four of comment 0. Then I went to a patron record and chose "Print quick slip." A new tab appeared for a split second and disappeared, but no print job started. Created attachment 11149 [details] Settings for Firefox Add-on JSPrintSetup Screenshot with settings to make work Firefox add-on jsprintsetup with a specific web site. For security reasons, the website must be in a list of allowed sites. The pre-installed JavaScript in the system preference should then work with the default printer. To create more sophisticated solutions you find the function reference of jsprintsetup at: http://jsprintsetup.mozdev.org/reference.html I will set up a Wiki page for this as soon as possible. Marc (In reply to comment #30) > The pre-installed JavaScript in the system preference should then work > with the default printer. By this do mean that the getPrintersList and setPrinter settings are not required? Regarding: //Choose printer using one or more of the following functions //jsPrintSetup.getPrintersList... //jsPrintSetup.setPrinter... Here I wanted to indicate where a more sophisticated solution can be implemented. The lines are commented out (//) and ar ignored by the JavaScript. You can savely remove them. The function jsPrintSetup.getPrintersList retuns a list of installed printers. One could then check if e.g. a printer with the name "Slipprinter" is available and if yes print on this printer using jsPrintSetup.setPrinter('Slipprinter), otherwise print on the default printer. For full reference see: http://jsprintsetup.mozdev.org/reference.html Please refer to the following wiki page for setup and usage instructions: http://wiki.koha-community.org/wiki/Setting_up_slip_printer_to_print_silently (In reply to Marc Véron from comment #33) > Please refer to the following wiki page for setup and usage instructions: > http://wiki.koha-community.org/wiki/Setting_up_slip_printer_to_print_silently For the records: Wiki page updated after testing for Koha 16.11 an Firefox 52.02 with new example JavaScript: ----------------------------- $( window ).load(function() { try { //Try to print using jsPrintSetup Plug-In in Firefox //If it is not installed fall back to default printing jsPrintSetup.clearSilentPrint(); jsPrintSetup.setOption('printSilent', 1); //Choose printer using one or more of the following functions //jsPrintSetup.getPrintersList... jsPrintSetup.setPrinter("PUT HERE YOUR PRINTER NAME"); //Set Header and footer... jsPrintSetup.setOption('headerStrLeft', ''); jsPrintSetup.setOption('headerStrCenter', ''); jsPrintSetup.setOption('headerStrRight', ''); jsPrintSetup.setOption('footerStrLeft', ''); jsPrintSetup.setOption('footerStrCenter', ''); jsPrintSetup.setOption('footerStrRight', ''); jsPrintSetup.print(); window.close(); } catch(err) { //Default printing if jsPrintsetup is not available window.print(); window.close(); } }); ----------------------------- |