[open-ils-commits] r8643 - trunk/Open-ILS/xul/staff_client/chrome/content/util

svn at svn.open-ils.org svn at svn.open-ils.org
Tue Feb 5 14:57:04 EST 2008


Author: phasefx
Date: 2008-02-05 14:28:43 -0500 (Tue, 05 Feb 2008)
New Revision: 8643

Modified:
   trunk/Open-ILS/xul/staff_client/chrome/content/util/print.js
Log:
regression in dos.print kludge.. need to quote path for windows, and assure text is being passed and not objects

Modified: trunk/Open-ILS/xul/staff_client/chrome/content/util/print.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/chrome/content/util/print.js	2008-02-05 19:28:08 UTC (rev 8642)
+++ trunk/Open-ILS/xul/staff_client/chrome/content/util/print.js	2008-02-05 19:28:43 UTC (rev 8643)
@@ -237,6 +237,11 @@
 
 				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 @@
 				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 @@
             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');
 



More information about the open-ils-commits mailing list