[open-ils-commits] r17380 - in branches/rel_2_0/Open-ILS: web/opac/locale/en-US xul/staff_client/chrome/content/OpenILS xul/staff_client/chrome/content/util xul/staff_client/chrome/locale/en-US xul/staff_client/server/admin xul/staff_client/server/circ xul/staff_client/server/patron (phasefx)

svn at svn.open-ils.org svn at svn.open-ils.org
Mon Aug 30 11:39:55 EDT 2010


Author: phasefx
Date: 2010-08-30 11:39:52 -0400 (Mon, 30 Aug 2010)
New Revision: 17380

Modified:
   branches/rel_2_0/Open-ILS/web/opac/locale/en-US/lang.dtd
   branches/rel_2_0/Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js
   branches/rel_2_0/Open-ILS/xul/staff_client/chrome/content/util/browser.js
   branches/rel_2_0/Open-ILS/xul/staff_client/chrome/content/util/browser.xul
   branches/rel_2_0/Open-ILS/xul/staff_client/chrome/content/util/list.js
   branches/rel_2_0/Open-ILS/xul/staff_client/chrome/content/util/print.js
   branches/rel_2_0/Open-ILS/xul/staff_client/chrome/content/util/rbrowser.xul
   branches/rel_2_0/Open-ILS/xul/staff_client/chrome/locale/en-US/offline.properties
   branches/rel_2_0/Open-ILS/xul/staff_client/server/admin/printer_settings.html
   branches/rel_2_0/Open-ILS/xul/staff_client/server/admin/printer_settings.js
   branches/rel_2_0/Open-ILS/xul/staff_client/server/circ/checkin.js
   branches/rel_2_0/Open-ILS/xul/staff_client/server/circ/checkout.js
   branches/rel_2_0/Open-ILS/xul/staff_client/server/patron/bill2.js
   branches/rel_2_0/Open-ILS/xul/staff_client/server/patron/bills.js
   branches/rel_2_0/Open-ILS/xul/staff_client/server/patron/items.js
   branches/rel_2_0/Open-ILS/xul/staff_client/server/patron/summary.xul
Log:
backport 17375-17379 for context sensitive (role-based) print settings

Modified: branches/rel_2_0/Open-ILS/web/opac/locale/en-US/lang.dtd
===================================================================
--- branches/rel_2_0/Open-ILS/web/opac/locale/en-US/lang.dtd	2010-08-30 15:36:24 UTC (rev 17379)
+++ branches/rel_2_0/Open-ILS/web/opac/locale/en-US/lang.dtd	2010-08-30 15:39:52 UTC (rev 17380)
@@ -3357,6 +3357,12 @@
 <!ENTITY staff.util.timestamp_dialog.apply_btn.accesskey "A">
 <!ENTITY staff.printing.set_default "Set Default Printer and Print Test Page">
 <!ENTITY staff.printing.page_settings "Page Settings">
+<!ENTITY staff.printing.context.header "Printer Context">
+<!ENTITY staff.printing.context.desc "Different printer settings may be configured for different contexts within the staff client (such as circulation, label printing, etc.).  If settings have not been made for a given context, the staff client will fall back on the 'default' context.">
+<!ENTITY staff.printing.context.radio.default.label "Default">
+<!ENTITY staff.printing.context.radio.receipt.label "Receipt">
+<!ENTITY staff.printing.context.radio.label.label "Label">
+<!ENTITY staff.printing.context.radio.mail.label "Mail">
 <!ENTITY staff.printing.normal_settings.header "Normal Settings">
 <!ENTITY staff.printing.advanced_settings.header "Advanced Settings">
 <!ENTITY staff.printing.advanced.mozilla_print "Use default print strategy (Mozilla Print)">

Modified: branches/rel_2_0/Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js
===================================================================
--- branches/rel_2_0/Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js	2010-08-30 15:36:24 UTC (rev 17379)
+++ branches/rel_2_0/Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js	2010-08-30 15:39:52 UTC (rev 17380)
@@ -431,20 +431,24 @@
         }
         file.close();
 
-        JSAN.use('util.file'); var file = new util.file('print_strategy');
-        if (file._file.exists()) {
-            try {
-                var x = file.get_content();
-                if (x) {
-                    obj.print_strategy = x;
-                    obj.stash('print_strategy');
-                    obj.data_progress('Print strategy retrieved from file. ');
+        obj.print_strategy = {};
+        var print_contexts = [ 'default', 'receipt', 'label', 'mail' ];
+        for (var i in print_contexts) {
+            JSAN.use('util.file'); var file = new util.file('print_strategy.' + print_contexts[i]);
+            if (file._file.exists()) {
+                try {
+                    var x = file.get_content();
+                    if (x) {
+                        obj.print_strategy[ print_contexts[i] ] = x;
+                        obj.data_progress('Print strategy ' + print_contexts[i] + ' retrieved from file. ');
+                    }
+                } catch(E) {
+                    alert(E);
                 }
-            } catch(E) {
-                alert(E);
             }
+            file.close();
         }
-        file.close();
+        obj.stash('print_strategy');
 
         JSAN.use('util.print'); (new util.print()).GetPrintSettings();
         obj.data_progress('Printer settings retrieved. ');

Modified: branches/rel_2_0/Open-ILS/xul/staff_client/chrome/content/util/browser.js
===================================================================
--- branches/rel_2_0/Open-ILS/xul/staff_client/chrome/content/util/browser.js	2010-08-30 15:36:24 UTC (rev 17379)
+++ branches/rel_2_0/Open-ILS/xul/staff_client/chrome/content/util/browser.js	2010-08-30 15:39:52 UTC (rev 17380)
@@ -26,6 +26,7 @@
             obj.debug_label = params['debug_label'];
             obj.passthru_content_params = params['passthru_content_params'];
             obj.on_url_load = params['on_url_load'];
+            obj.printer_context = params['printer_context'] || 'default';
 
             JSAN.use('util.controller'); obj.controller = new util.controller();
             obj.controller.init(
@@ -49,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;
@@ -60,8 +61,22 @@
                                         print_params.content_type = 'text/plain';
                                     }
                                     JSAN.use('OpenILS.data'); var data = new OpenILS.data(); data.stash_retrieve();
-                                    if (data.print_strategy == 'webBrowserPrint' || !data.print_strategy) {
-                                        // 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: branches/rel_2_0/Open-ILS/xul/staff_client/chrome/content/util/browser.xul
===================================================================
--- branches/rel_2_0/Open-ILS/xul/staff_client/chrome/content/util/browser.xul	2010-08-30 15:36:24 UTC (rev 17379)
+++ branches/rel_2_0/Open-ILS/xul/staff_client/chrome/content/util/browser.xul	2010-08-30 15:39:52 UTC (rev 17380)
@@ -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: branches/rel_2_0/Open-ILS/xul/staff_client/chrome/content/util/list.js
===================================================================
--- branches/rel_2_0/Open-ILS/xul/staff_client/chrome/content/util/list.js	2010-08-30 15:36:24 UTC (rev 17379)
+++ branches/rel_2_0/Open-ILS/xul/staff_client/chrome/content/util/list.js	2010-08-30 15:39:52 UTC (rev 17380)
@@ -33,6 +33,8 @@
 
         JSAN.use('util.widgets');
 
+        obj.printer_context = params.printer_context;
+
         if (typeof params.map_row_to_column == 'function') obj.map_row_to_column = params.map_row_to_column;
         if (typeof params.map_row_to_columns == 'function') {
             obj.map_row_to_columns = params.map_row_to_columns;
@@ -1265,7 +1267,7 @@
 
     'dump_csv_to_printer' : function(params) {
         var obj = this;
-        JSAN.use('util.print'); var print = new util.print();
+        JSAN.use('util.print'); var print = new util.print(params.printer_context || obj.printer_context);
         if (typeof params == 'undefined') params = {};
         if (params.no_full_retrieve) {
             print.simple( obj.dump_csv( params ), {'content_type':'text/plain'} );
@@ -1280,7 +1282,7 @@
 
     'dump_extended_format_to_printer' : function(params) {
         var obj = this;
-        JSAN.use('util.print'); var print = new util.print();
+        JSAN.use('util.print'); var print = new util.print(params.printer_context || obj.printer_context);
         if (typeof params == 'undefined') params = {};
         if (params.no_full_retrieve) {
             print.simple( obj.dump_extended_format( params ), {'content_type':'text/plain'} );
@@ -1341,7 +1343,7 @@
                 function() {
                     try {
                         if (!params.list) params.list = obj.dump_with_keys();
-                        JSAN.use('util.print'); var print = new util.print();
+                        JSAN.use('util.print'); var print = new util.print(params.printer_context || obj.printer_context);
                         print.tree_list( params );
                         if (typeof params.callback == 'function') params.callback();
                     } catch(E) {

Modified: branches/rel_2_0/Open-ILS/xul/staff_client/chrome/content/util/print.js
===================================================================
--- branches/rel_2_0/Open-ILS/xul/staff_client/chrome/content/util/print.js	2010-08-30 15:36:24 UTC (rev 17379)
+++ branches/rel_2_0/Open-ILS/xul/staff_client/chrome/content/util/print.js	2010-08-30 15:39:52 UTC (rev 17380)
@@ -1,7 +1,7 @@
 dump('entering util/print.js\n');
 
 if (typeof util == 'undefined') util = {};
-util.print = function () {
+util.print = function (context) {
 
     netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
 
@@ -11,8 +11,10 @@
     JSAN.use('util.functional');
     JSAN.use('util.file');
 
+    this.context = context || 'default';
+
     var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces['nsIPrefBranch']);
-    var key = 'oils.printer.external.cmd';
+    var key = 'oils.printer.external.cmd.' + this.context;
     var has_key = prefs.prefHasUserValue(key);
     this.oils_printer_external_cmd = has_key ? prefs.getCharPref(key) : '';
 
@@ -83,7 +85,8 @@
 
             var obj = this;
 
-            obj.data.last_print = { 'msg' : msg, 'params' : params}; obj.data.stash('last_print');
+            obj.data.last_print = { 'msg' : msg, 'params' : params, 'context' : this.context};
+            obj.data.stash('last_print');
 
             var silent = false;
             if ( params && params.no_prompt && (params.no_prompt == true || params.no_prompt == 'true') ) {
@@ -102,9 +105,9 @@
             netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
             obj.data.init({'via':'stash'});
 
-            if (params.print_strategy || obj.data.print_strategy) {
+            if (params.print_strategy || obj.data.print_strategy[obj.context] || obj.data.print_strategy['default']) {
 
-                switch(params.print_strategy || obj.data.print_strategy) {
+                switch(params.print_strategy || obj.data.print_strategy[obj.context] || obj.data.print_strategy['default']) {
                     case 'dos.print':
                         params.dos_print = true;
                     case 'custom.print':
@@ -296,10 +299,13 @@
             netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
             obj.data.init({'via':'stash'});
 
-            if (params.print_strategy || obj.data.print_strategy) {
+            if (params.print_strategy || obj.data.print_strategy[obj.context] || obj.data.print_strategy['default']) {
 
-dump('params.print_strategy = ' + params.print_strategy + ' || obj.data.print_strategy = ' + obj.data.print_strategy + ' => ' + ( params.print_strategy || obj.data.print_strategy ) + '\n');
-                switch(params.print_strategy || obj.data.print_strategy) {
+                dump('params.print_strategy = ' + params.print_strategy
+                    + ' || obj.data.print_strategy[' + obj.context + '] = ' + obj.data.print_strategy[obj.context] 
+                    + ' || obj.data.print_strategy[default] = ' + obj.data.print_strategy['default'] 
+                    + ' => ' + ( params.print_strategy || obj.data.print_strategy[obj.context] || obj.data.print_strategy['default'] ) + '\n');
+                switch(params.print_strategy || obj.data.print_strategy[obj.context] || obj.data.print_strategy['default']) {
                     case 'dos.print':
                     case 'custom.print':
                         if (typeof w != 'string') {
@@ -515,23 +521,31 @@
         try {
             var error_msg = '';
             netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
-            var file = new util.file('gPrintSettings');
+            var file = new util.file('gPrintSettings.' + this.context);
             if (file._file.exists()) {
                 temp = file.get_object(); file.close();
                 for (var i in temp) {
                     try { this.gPrintSettings[i] = temp[i]; } catch(E) { error_msg += 'Error trying to set gPrintSettings.'+i+'='+temp[i]+' : ' + js2JSON(E) + '\n'; }
                 }
-            } else {
-                this.gPrintSettings.marginTop = 0;
-                this.gPrintSettings.marginLeft = 0;
-                this.gPrintSettings.marginBottom = 0;
-                this.gPrintSettings.marginRight = 0;
-                this.gPrintSettings.headerStrLeft = '';
-                this.gPrintSettings.headerStrCenter = '';
-                this.gPrintSettings.headerStrRight = '';
-                this.gPrintSettings.footerStrLeft = '';
-                this.gPrintSettings.footerStrCenter = '';
-                this.gPrintSettings.footerStrRight = '';
+            }  else if (this.context != 'default') {
+                var file = new util.file('gPrintSettings.default');
+                if (file._file.exists()) {
+                    temp = file.get_object(); file.close();
+                    for (var i in temp) {
+                        try { this.gPrintSettings[i] = temp[i]; } catch(E) { error_msg += 'Error trying to set gPrintSettings.'+i+'='+temp[i]+' : ' + js2JSON(E) + '\n'; }
+                    }
+                } else {
+                    this.gPrintSettings.marginTop = 0;
+                    this.gPrintSettings.marginLeft = 0;
+                    this.gPrintSettings.marginBottom = 0;
+                    this.gPrintSettings.marginRight = 0;
+                    this.gPrintSettings.headerStrLeft = '';
+                    this.gPrintSettings.headerStrCenter = '';
+                    this.gPrintSettings.headerStrRight = '';
+                    this.gPrintSettings.footerStrLeft = '';
+                    this.gPrintSettings.footerStrCenter = '';
+                    this.gPrintSettings.footerStrRight = '';
+                }
             }
             if (error_msg) {
                 this.error.sdump('D_PRINT',error_msg);
@@ -553,7 +567,7 @@
         try {
             var obj = this;
             netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
-            var file = new util.file('gPrintSettings');
+            var file = new util.file('gPrintSettings.' + this.context);
             if (typeof obj.gPrintSettings == 'undefined') obj.GetPrintSettings();
             if (obj.gPrintSettings) file.set_object(obj.gPrintSettings); 
             file.close();

Modified: branches/rel_2_0/Open-ILS/xul/staff_client/chrome/content/util/rbrowser.xul
===================================================================
--- branches/rel_2_0/Open-ILS/xul/staff_client/chrome/content/util/rbrowser.xul	2010-08-30 15:36:24 UTC (rev 17379)
+++ branches/rel_2_0/Open-ILS/xul/staff_client/chrome/content/util/rbrowser.xul	2010-08-30 15:39:52 UTC (rev 17380)
@@ -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'
                 } 

Modified: branches/rel_2_0/Open-ILS/xul/staff_client/chrome/locale/en-US/offline.properties
===================================================================
--- branches/rel_2_0/Open-ILS/xul/staff_client/chrome/locale/en-US/offline.properties	2010-08-30 15:36:24 UTC (rev 17379)
+++ branches/rel_2_0/Open-ILS/xul/staff_client/chrome/locale/en-US/offline.properties	2010-08-30 15:39:52 UTC (rev 17380)
@@ -264,5 +264,5 @@
 staff.cat.create_or_rebarcode_items=Create or Re-barcode Items
 printing.nothing_to_reprint=Nothing to re-print
 printing.prompt_for_external_print_cmd=Enter external print command and parameters (use %receipt.txt% or %receipt.html% as the file containing the print data. Those values will be substituted with the proper path.):
-printing.print_strategy_saved=Print strategy (%1$s) saved to file system.
+printing.print_strategy_saved=Print strategy (%1$s) for %2$s context saved to file system.
 text_editor.prompt_for_external_cmd=Enter external text editor command and parameters (use %letter.txt% as the file containing the text. This value will be substituted with the proper path.):

Modified: branches/rel_2_0/Open-ILS/xul/staff_client/server/admin/printer_settings.html
===================================================================
--- branches/rel_2_0/Open-ILS/xul/staff_client/server/admin/printer_settings.html	2010-08-30 15:36:24 UTC (rev 17379)
+++ branches/rel_2_0/Open-ILS/xul/staff_client/server/admin/printer_settings.html	2010-08-30 15:39:52 UTC (rev 17380)
@@ -27,6 +27,14 @@
     <script type="text/javascript" src="printer_settings.js"></script>
 </head><body onload="try { my_init(); } catch(E) { alert(E); }" style="background: white;">
     <div class="messagecatalog" id="offlineStrings" src="/xul/server/locale/<!--#echo var='locale'-->/offline.properties" />
+    <h1>&staff.printing.context.header;</h1>
+    <p>&staff.printing.context.desc;</p>
+    <form>
+        <input type="radio" name="context" value="default" checked="checked" onclick="g.set_printer_context('default');">&staff.printing.context.radio.default.label;</input>
+        <input type="radio" name="context" value="receipt" onclick="g.set_printer_context('receipt');">&staff.printing.context.radio.receipt.label;</input>
+        <input type="radio" name="context" value="label" onclick="g.set_printer_context('label');">&staff.printing.context.radio.label.label;</input>
+        <input type="radio" name="context" value="mail" onclick="g.set_printer_context('mail');">&staff.printing.context.radio.mail.label;</input>
+    </form> 
     <h1>&staff.printing.normal_settings.header;</h1>
     <iframe id="sample" src="printer_settings.txt"></iframe><br />
     <button onclick="try { g.printer_settings(); } catch(E) { alert(E); }">&staff.printing.set_default;</button>

Modified: branches/rel_2_0/Open-ILS/xul/staff_client/server/admin/printer_settings.js
===================================================================
--- branches/rel_2_0/Open-ILS/xul/staff_client/server/admin/printer_settings.js	2010-08-30 15:36:24 UTC (rev 17379)
+++ branches/rel_2_0/Open-ILS/xul/staff_client/server/admin/printer_settings.js	2010-08-30 15:39:52 UTC (rev 17380)
@@ -9,7 +9,7 @@
         JSAN.use('util.error'); g.error = new util.error();
         g.error.sdump('D_TRACE','my_init() for printer_settings.xul');
 
-        JSAN.use('util.print'); g.print = new util.print();
+        g.set_printer_context();
 
         g.prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces['nsIPrefBranch']);
 
@@ -26,6 +26,11 @@
     }
 }
 
+g.set_printer_context = function(context) {
+    g.context = context || 'default';
+    JSAN.use('util.print'); g.print = new util.print(g.context);
+}
+
 g.page_settings = function() {
     netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
     g.print.page_settings();
@@ -42,7 +47,7 @@
 g.set_print_strategy = function(which) {
     netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
     if (which == 'custom.print') {
-        var key = 'oils.printer.external.cmd';
+        var key = 'oils.printer.external.cmd.' + g.context;
         var has_key = g.prefs.prefHasUserValue(key);
         var value = has_key ? g.prefs.getCharPref(key) : '';
         var cmd = window.prompt(
@@ -52,13 +57,17 @@
         if (!cmd) { return; }
         g.prefs.setCharPref(key,cmd);
     }
-    JSAN.use('util.file'); var file = new util.file('print_strategy');
+    JSAN.use('util.file'); var file = new util.file('print_strategy.' + g.context);
     file.write_content( 'truncate', String( which ) );
     file.close();
     JSAN.use('OpenILS.data'); var data = new OpenILS.data(); data.init({'via':'stash'});
-    data.print_strategy = which; data.stash('print_strategy');
+    if (!data.print_strategy) {
+        data.print_strategy = {};
+    }
+    data.print_strategy[g.context] = which;
+    data.stash('print_strategy');
     alert(
-        document.getElementById('offlineStrings').getFormattedString('printing.print_strategy_saved',[which])
+        document.getElementById('offlineStrings').getFormattedString('printing.print_strategy_saved',[which,g.context])
     );
 }
 

Modified: branches/rel_2_0/Open-ILS/xul/staff_client/server/circ/checkin.js
===================================================================
--- branches/rel_2_0/Open-ILS/xul/staff_client/server/circ/checkin.js	2010-08-30 15:36:24 UTC (rev 17379)
+++ branches/rel_2_0/Open-ILS/xul/staff_client/server/circ/checkin.js	2010-08-30 15:39:52 UTC (rev 17380)
@@ -314,6 +314,7 @@
                         ['command'],
                         function() {
                             var p = { 
+                                'printer_context' : 'receipt',
                                 'template' : 'checkin'
                             };
                             obj.list.print(p);

Modified: branches/rel_2_0/Open-ILS/xul/staff_client/server/circ/checkout.js
===================================================================
--- branches/rel_2_0/Open-ILS/xul/staff_client/server/circ/checkout.js	2010-08-30 15:36:24 UTC (rev 17379)
+++ branches/rel_2_0/Open-ILS/xul/staff_client/server/circ/checkout.js	2010-08-30 15:39:52 UTC (rev 17380)
@@ -307,6 +307,7 @@
                 'data' : {
                     'balance_owed' : util.money.sanitize( obj.most_recent_balance_owed ),
                 },
+                'printer_context' : 'receipt',
                 'template' : 'checkout',
                 'callback' : function() {
                     setTimeout(

Modified: branches/rel_2_0/Open-ILS/xul/staff_client/server/patron/bill2.js
===================================================================
--- branches/rel_2_0/Open-ILS/xul/staff_client/server/patron/bill2.js	2010-08-30 15:36:24 UTC (rev 17379)
+++ branches/rel_2_0/Open-ILS/xul/staff_client/server/patron/bill2.js	2010-08-30 15:39:52 UTC (rev 17380)
@@ -649,6 +649,7 @@
         JSAN.use('patron.util');
         var params = { 
             'patron' : patron.util.retrieve_au_via_id(ses(),g.patron_id), 
+            'printer_context' : 'receipt',
             'template' : template
         };
         g.bill_list.print(params);
@@ -782,7 +783,7 @@
                 };
                 g.error.sdump('D_DEBUG',js2JSON(params));
                 if (! $('printer_prompt').hasAttribute('checked')) params.no_prompt = true;
-                JSAN.use('util.print'); var print = new util.print();
+                JSAN.use('util.print'); var print = new util.print('receipt');
                 print.tree_list( params ); 
             } catch(E) {
                 g.error.standard_unexpected_error_alert('bill receipt', E);

Modified: branches/rel_2_0/Open-ILS/xul/staff_client/server/patron/bills.js
===================================================================
--- branches/rel_2_0/Open-ILS/xul/staff_client/server/patron/bills.js	2010-08-30 15:36:24 UTC (rev 17379)
+++ branches/rel_2_0/Open-ILS/xul/staff_client/server/patron/bills.js	2010-08-30 15:39:52 UTC (rev 17380)
@@ -540,7 +540,7 @@
                         };
                         obj.error.sdump('D_DEBUG',js2JSON(params));
                         if (document.getElementById('auto_print').checked) params.no_prompt = true;
-                        JSAN.use('util.print'); var print = new util.print();
+                        JSAN.use('util.print'); var print = new util.print('receipt');
                         print.tree_list( params );
                     } catch(E) {
                         obj.error.standard_unexpected_error_alert('bill receipt', E);
@@ -707,7 +707,7 @@
                     }
                 )
             };
-            JSAN.use('util.print'); var print = new util.print();
+            JSAN.use('util.print'); var print = new util.print('receipt');
             print.tree_list( params );
 
         } catch(E) {

Modified: branches/rel_2_0/Open-ILS/xul/staff_client/server/patron/items.js
===================================================================
--- branches/rel_2_0/Open-ILS/xul/staff_client/server/patron/items.js	2010-08-30 15:36:24 UTC (rev 17379)
+++ branches/rel_2_0/Open-ILS/xul/staff_client/server/patron/items.js	2010-08-30 15:39:52 UTC (rev 17380)
@@ -251,6 +251,7 @@
             JSAN.use('patron.util');
             var params = { 
                 'patron' : patron.util.retrieve_fleshed_au_via_id(ses(),obj.patron_id), 
+                'printer_context' : 'receipt', 
                 'template' : 'items_out'
             };
             list.print( params );

Modified: branches/rel_2_0/Open-ILS/xul/staff_client/server/patron/summary.xul
===================================================================
--- branches/rel_2_0/Open-ILS/xul/staff_client/server/patron/summary.xul	2010-08-30 15:36:24 UTC (rev 17379)
+++ branches/rel_2_0/Open-ILS/xul/staff_client/server/patron/summary.xul	2010-08-30 15:39:52 UTC (rev 17380)
@@ -110,7 +110,7 @@
                 case 'addr_export_print':
                     // Replace literal instances of '\n' and excessive whitespace.
                     s = s.replace(/(\\n)+/g, "<br/>").replace(/ {2,}/g, " ");
-                    JSAN.use('util.print'); var print = new util.print(); print.simple(s);
+                    JSAN.use('util.print'); var print = new util.print('mail'); print.simple(s);
                 break;
             };
         }



More information about the open-ils-commits mailing list