From 58e21011342abbd300b2e8f87ad63b243b5551bf Mon Sep 17 00:00:00 2001 From: phasefx Date: Tue, 5 Feb 2008 19:27:26 +0000 Subject: [PATCH] regression in dos.print kludge.. need to quote path for windows, and assure text is being passed and not objects git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_1_2_1@8641 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/xul/staff_client/chrome/content/util/print.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Open-ILS/xul/staff_client/chrome/content/util/print.js b/Open-ILS/xul/staff_client/chrome/content/util/print.js index 89e47b57a9..b53c61964b 100644 --- a/Open-ILS/xul/staff_client/chrome/content/util/print.js +++ b/Open-ILS/xul/staff_client/chrome/content/util/print.js @@ -237,6 +237,11 @@ util.print.prototype = { switch(params.print_strategy || obj.data.print_strategy) { case 'dos.print': + if (typeof w != 'string') { + netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); + w.getSelection().selectAllChildren(w.document.firstChild); + w = w.getSelection().toString(); + } obj._NSPrint_dos_print(w,silent,params); break; case 'window.print': @@ -271,12 +276,6 @@ util.print.prototype = { the html window handle our receipt template rendering, and then force a selection of all the text nodes and dump that to a file, for printing through a dos utility */ - /* - netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); - w.getSelection().selectAllChildren(w.document.firstChild); - var text = w.getSelection().toString(); - */ - /* NEW way: we just pass in the text */ var text = w; @@ -287,7 +286,7 @@ util.print.prototype = { file.close(); file = new util.file('receipt.bat'); - file.write_content('truncate+exec','#!/bin/sh\ncopy ' + path + ' lpt1 /b\nlpr ' + path + '\n'); + file.write_content('truncate+exec','#!/bin/sh\ncopy "' + path + '" lpt1 /b\nlpr ' + path + '\n'); file.close(); file = new util.file('receipt.bat'); -- 2.11.0