[open-ils-commits] r17376 - trunk/Open-ILS/xul/staff_client/chrome/content/util (phasefx)
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon Aug 30 11:36:21 EDT 2010
Author: phasefx
Date: 2010-08-30 11:36:18 -0400 (Mon, 30 Aug 2010)
New Revision: 17376
Modified:
trunk/Open-ILS/xul/staff_client/chrome/content/util/browser.js
trunk/Open-ILS/xul/staff_client/chrome/content/util/browser.xul
trunk/Open-ILS/xul/staff_client/chrome/content/util/rbrowser.xul
Log:
label printer context
Modified: trunk/Open-ILS/xul/staff_client/chrome/content/util/browser.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/chrome/content/util/browser.js 2010-08-30 15:36:16 UTC (rev 17375)
+++ trunk/Open-ILS/xul/staff_client/chrome/content/util/browser.js 2010-08-30 15:36:18 UTC (rev 17376)
@@ -50,7 +50,7 @@
try {
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var content = obj.get_content();
- JSAN.use('util.print'); var p = new util.print();
+ JSAN.use('util.print'); var p = new util.print(obj.printer_context);
var print_params = {};
if (obj.html_source) {
print_params.msg = obj.html_source;
@@ -61,14 +61,22 @@
print_params.content_type = 'text/plain';
}
JSAN.use('OpenILS.data'); var data = new OpenILS.data(); data.stash_retrieve();
- if (
- !data.print_strategy
- || !data.print_strategy[obj.printer_context]
- || (data.print_strategy[obj.printer_context] && data.print_strategy[obj.printer_context] == 'webBrowserPrint')
- || !data.print_strategy['default']
- || (data.print_strategy['default'] && data.print_strategy['default'] == 'webBrowserPrint')
- ) {
- // Override the print strategy temporarily in this context
+ // Override the print strategy temporarily if it's not set or is equal to webBrowserPrint (which is buggy here)
+ if (data.print_strategy) {
+ if (data.print_strategy[obj.printer_context] || data.print_strategy['default']) {
+ if (data.print_strategy[obj.printer_context]) {
+ if (data.print_strategy[obj.printer_context] == 'webBrowserPrint') {
+ print_params.print_strategy = 'window.print';
+ }
+ } else {
+ if (data.print_strategy['default'] == 'webBrowserPrint') {
+ print_params.print_strategy = 'window.print';
+ }
+ }
+ } else {
+ print_params.print_strategy = 'window.print';
+ }
+ } else {
print_params.print_strategy = 'window.print';
}
p.NSPrint(content,false,print_params);
Modified: trunk/Open-ILS/xul/staff_client/chrome/content/util/browser.xul
===================================================================
--- trunk/Open-ILS/xul/staff_client/chrome/content/util/browser.xul 2010-08-30 15:36:16 UTC (rev 17375)
+++ trunk/Open-ILS/xul/staff_client/chrome/content/util/browser.xul 2010-08-30 15:36:18 UTC (rev 17376)
@@ -54,6 +54,7 @@
var p = {
'url' : url,
'push_xulG' : push_xulG,
+ 'printer_context' : xul_param('printer_context'),
'html_source' : xul_param('html_source'),
'debug_label' : 'debug'
};
Modified: trunk/Open-ILS/xul/staff_client/chrome/content/util/rbrowser.xul
===================================================================
--- trunk/Open-ILS/xul/staff_client/chrome/content/util/rbrowser.xul 2010-08-30 15:36:16 UTC (rev 17375)
+++ trunk/Open-ILS/xul/staff_client/chrome/content/util/rbrowser.xul 2010-08-30 15:36:18 UTC (rev 17376)
@@ -57,6 +57,7 @@
var p = {
'url' : url,
'push_xulG' : push_xulG,
+ 'printer_context' : xul_param('printer_context'),
'html_source' : xul_param('html_source'),
'debug_label' : 'debug'
}
More information about the open-ils-commits
mailing list