[open-ils-commits] r9045 -
trunk/Open-ILS/xul/staff_client/chrome/content/util
svn at svn.open-ils.org
svn at svn.open-ils.org
Sat Mar 15 03:25:56 EDT 2008
Author: phasefx
Date: 2008-03-15 02:52:12 -0400 (Sat, 15 Mar 2008)
New Revision: 9045
Modified:
trunk/Open-ILS/xul/staff_client/chrome/content/util/list.js
Log:
more refactoring.. putting all the list CSV functions into list.js
Modified: trunk/Open-ILS/xul/staff_client/chrome/content/util/list.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/chrome/content/util/list.js 2008-03-15 05:52:46 UTC (rev 9044)
+++ trunk/Open-ILS/xul/staff_client/chrome/content/util/list.js 2008-03-15 06:52:12 UTC (rev 9045)
@@ -1073,13 +1073,50 @@
'dump_csv_to_clipboard' : function(params) {
var obj = this;
- if (params && params.no_full_retrieve) {
+ if (typeof params == 'undefined') params = {};
+ if (params.no_full_retrieve) {
copy_to_clipboard( obj.dump_csv( params ) );
} else {
obj.wrap_in_full_retrieve( function() { copy_to_clipboard( obj.dump_csv( params ) ); } );
}
},
+ 'dump_csv_to_printer' : function(params) {
+ var obj = this;
+ JSAN.use('util.print'); var print = new util.print();
+ if (typeof params == 'undefined') params = {};
+ if (params.no_full_retrieve) {
+ print.simple( obj.dump_csv( params ), {'content_type':'text/plain'} );
+ } else {
+ obj.wrap_in_full_retrieve(
+ function() {
+ print.simple( obj.dump_csv( params ), {'content_type':'text/plain'} );
+ }
+ );
+ }
+ },
+
+ 'dump_csv_to_file' : function(params) {
+ var obj = this;
+ JSAN.use('util.file'); var f = new util.file();
+ if (typeof params == 'undefined') params = {};
+ if (params.no_full_retrieve) {
+ params.data = obj.dump_csv( params );
+ params.not_json = true;
+ if (!params.title) params.title = 'Save List CSV As';
+ f.export_file( params );
+ } else {
+ obj.wrap_in_full_retrieve(
+ function() {
+ params.data = obj.dump_csv( params );
+ params.not_json = true;
+ if (!params.title) params.title = 'Save List CSV As';
+ f.export_file( params );
+ }
+ );
+ }
+ },
+
'print' : function(params) {
if (!params) params = {};
switch(this.node.nodeName) {
More information about the open-ils-commits
mailing list