From: pines Date: Wed, 31 Jan 2007 08:08:07 +0000 (+0000) Subject: fix printer settings interface.. stale data X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=13ce3c0e77c14b36b312c4f7920a82c38c76f2cf;p=Evergreen.git fix printer settings interface.. stale data git-svn-id: svn://svn.open-ils.org/ILS/trunk@6839 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- 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 13388ad209..f292ba639d 100644 --- a/Open-ILS/xul/staff_client/chrome/content/util/print.js +++ b/Open-ILS/xul/staff_client/chrome/content/util/print.js @@ -205,7 +205,10 @@ util.print.prototype = { if (!w) w = window; var obj = this; try { + if (!params) params = {}; + netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); + obj.data.init({'via':'stash'}); if (params.print_strategy || obj.data.print_strategy) { @@ -231,7 +234,7 @@ util.print.prototype = { } } catch (e) { - //alert('Probably not printing: ' + e); + alert('Probably not printing: ' + e); this.error.sdump('D_ERROR','PRINT EXCEPTION: ' + js2JSON(e) + '\n'); } @@ -240,6 +243,7 @@ util.print.prototype = { '_NSPrint_dos_print' : function(w,silent,params) { var obj = this; try { + /* This is a kludge/workaround. webBrowserPrint doesn't always work. So we're going to let 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 */ @@ -393,9 +397,12 @@ util.print.prototype = { 'save_settings' : function() { try { + var obj = this; netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); var file = new util.file('gPrintSettings'); - file.set_object(this.gPrintSettings); file.close(); + if (typeof obj.gPrintSettings == 'undefined') obj.GetPrintSettings(); + if (obj.gPrintSettings) file.set_object(obj.gPrintSettings); + file.close(); } catch(E) { this.error.standard_unexpected_error_alert("save_settings()",E); } diff --git a/Open-ILS/xul/staff_client/server/admin/printer_settings.js b/Open-ILS/xul/staff_client/server/admin/printer_settings.js index 80c759a975..7d9b6e6760 100644 --- a/Open-ILS/xul/staff_client/server/admin/printer_settings.js +++ b/Open-ILS/xul/staff_client/server/admin/printer_settings.js @@ -33,7 +33,7 @@ g.page_settings = function() { g.printer_settings = function() { netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); var w = document.getElementById('sample').contentWindow; - g.print.NSPrint(w ? w : window); + g.print.NSPrint(w ? w : window, false, {}); g.print.save_settings(); }