[open-ils-commits] r8232 - in trunk/Open-ILS/xul/staff_client:
chrome/content/circ chrome/content/util server/admin
server/cat server/circ server/patron
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon Dec 17 18:17:21 EST 2007
Author: phasefx
Date: 2007-12-17 17:55:58 -0500 (Mon, 17 Dec 2007)
New Revision: 8232
Modified:
trunk/Open-ILS/xul/staff_client/chrome/content/circ/offline_checkin.js
trunk/Open-ILS/xul/staff_client/chrome/content/circ/offline_checkout.js
trunk/Open-ILS/xul/staff_client/chrome/content/circ/offline_in_house_use.js
trunk/Open-ILS/xul/staff_client/chrome/content/circ/offline_renew.js
trunk/Open-ILS/xul/staff_client/chrome/content/util/list.js
trunk/Open-ILS/xul/staff_client/server/admin/offline_manage_xacts.js
trunk/Open-ILS/xul/staff_client/server/admin/transit_list.js
trunk/Open-ILS/xul/staff_client/server/cat/copy_buckets.js
trunk/Open-ILS/xul/staff_client/server/cat/record_buckets.js
trunk/Open-ILS/xul/staff_client/server/cat/z3950.js
trunk/Open-ILS/xul/staff_client/server/circ/checkin.js
trunk/Open-ILS/xul/staff_client/server/circ/checkout.js
trunk/Open-ILS/xul/staff_client/server/circ/copy_status.js
trunk/Open-ILS/xul/staff_client/server/circ/hold_capture.js
trunk/Open-ILS/xul/staff_client/server/circ/in_house_use.js
trunk/Open-ILS/xul/staff_client/server/patron/bill_history.xul
trunk/Open-ILS/xul/staff_client/server/patron/holds.js
trunk/Open-ILS/xul/staff_client/server/patron/items.js
trunk/Open-ILS/xul/staff_client/server/patron/search_result.js
Log:
refactoring.. moved some list print/clipboard functions into list.js
Modified: trunk/Open-ILS/xul/staff_client/chrome/content/circ/offline_checkin.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/chrome/content/circ/offline_checkin.js 2007-12-17 22:54:45 UTC (rev 8231)
+++ trunk/Open-ILS/xul/staff_client/chrome/content/circ/offline_checkin.js 2007-12-17 22:55:58 UTC (rev 8232)
@@ -113,26 +113,20 @@
if ($('print_receipt').checked) {
try {
- var params = {
- 'header' : g.data.print_list_templates.offline_checkin.header,
- 'line_item' : g.data.print_list_templates.offline_checkin.line_item,
- 'footer' : g.data.print_list_templates.offline_checkin.footer,
- 'type' : g.data.print_list_templates.offline_checkin.type,
- 'list' : g.list.dump(),
- };
- JSAN.use('util.print'); var print = new util.print();
- print.tree_list( params );
+ var params = {
+ 'template' : 'offline_checkin',
+ 'callback' : function() {
+ g.list.clear();
+ var x = $('i_barcode'); x.value = ''; x.focus();
+ }
+ };
+ g.list.print( params );
} catch(E) {
g.error.sdump('D_ERROR','print: ' + E);
alert('print: ' + E);
}
}
- g.list.clear();
-
- var x;
- x = $('i_barcode'); x.value = ''; x.focus();
-
} catch(E) {
dump(E+'\n'); alert(E);
}
Modified: trunk/Open-ILS/xul/staff_client/chrome/content/circ/offline_checkout.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/chrome/content/circ/offline_checkout.js 2007-12-17 22:54:45 UTC (rev 8231)
+++ trunk/Open-ILS/xul/staff_client/chrome/content/circ/offline_checkout.js 2007-12-17 22:55:58 UTC (rev 8232)
@@ -272,28 +272,21 @@
try {
var params = {
'patron_barcode' : $('p_barcode').value,
- 'header' : g.data.print_list_templates.offline_checkout.header,
- 'line_item' : g.data.print_list_templates.offline_checkout.line_item,
- 'footer' : g.data.print_list_templates.offline_checkout.footer,
- 'type' : g.data.print_list_templates.offline_checkout.type,
- 'list' : g.list.dump(),
+ 'template' : 'offline_checkout',
+ 'callback' : function() {
+ g.list.clear();
+ var x = $('i_barcode'); x.value = '';
+ x = $('p_barcode'); x.value = '';
+ x.setAttribute('disabled','false'); x.disabled = false;
+ x.focus();
+ }
};
- JSAN.use('util.print'); var print = new util.print();
- print.tree_list( params );
+ g.list.print( params );
} catch(E) {
g.error.sdump('D_ERROR','print: ' + E);
alert('print: ' + E);
}
}
-
- g.list.clear();
-
- var x;
- x = $('i_barcode'); x.value = '';
- x = $('p_barcode'); x.value = '';
- x.setAttribute('disabled','false'); x.disabled = false;
- x.focus();
-
} catch(E) {
dump(E+'\n'); alert(E);
}
Modified: trunk/Open-ILS/xul/staff_client/chrome/content/circ/offline_in_house_use.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/chrome/content/circ/offline_in_house_use.js 2007-12-17 22:54:45 UTC (rev 8231)
+++ trunk/Open-ILS/xul/staff_client/chrome/content/circ/offline_in_house_use.js 2007-12-17 22:55:58 UTC (rev 8232)
@@ -117,25 +117,18 @@
if ($('print_receipt').checked) {
try {
var params = {
- 'header' : g.data.print_list_templates.offline_inhouse_use.header,
- 'line_item' : g.data.print_list_templates.offline_inhouse_use.line_item,
- 'footer' : g.data.print_list_templates.offline_inhouse_use.footer,
- 'type' : g.data.print_list_templates.offline_inhouse_use.type,
- 'list' : g.list.dump(),
+ 'template' : 'offline_inhouse_use',
+ 'callback' : function() {
+ g.list.clear();
+ var x = $('i_barcode'); x.value = ''; x.focus();
+ }
};
- JSAN.use('util.print'); var print = new util.print();
- print.tree_list( params );
+ g.list.print( params );
} catch(E) {
g.error.sdump('D_ERROR','print: ' + E);
alert('print: ' + E);
}
}
-
- g.list.clear();
-
- var x;
- x = $('i_barcode'); x.value = ''; x.focus();
-
} catch(E) {
dump(E+'\n'); alert(E);
}
Modified: trunk/Open-ILS/xul/staff_client/chrome/content/circ/offline_renew.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/chrome/content/circ/offline_renew.js 2007-12-17 22:54:45 UTC (rev 8231)
+++ trunk/Open-ILS/xul/staff_client/chrome/content/circ/offline_renew.js 2007-12-17 22:55:58 UTC (rev 8232)
@@ -223,27 +223,20 @@
try {
var params = {
'patron_barcode' : $('p_barcode').value,
- 'header' : g.data.print_list_templates.offline_renew.header,
- 'line_item' : g.data.print_list_templates.offline_renew.line_item,
- 'footer' : g.data.print_list_templates.offline_renew.footer,
- 'type' : g.data.print_list_templates.offline_renew.type,
- 'list' : g.list.dump(),
+ 'template' : 'offline_renew',
+ 'callback' : function() {
+ g.list.clear();
+ var x = $('i_barcode'); x.value = '';
+ x = $('p_barcode'); x.value = ''; x.focus();
+ }
};
- JSAN.use('util.print'); var print = new util.print();
- print.tree_list( params );
+ g.list.print( params );
} catch(E) {
g.error.sdump('D_ERROR','print: ' + E);
alert('print: ' + E);
}
}
}
-
- g.list.clear();
-
- var x;
- x = $('i_barcode'); x.value = '';
- x = $('p_barcode'); x.value = ''; x.focus();
-
} catch(E) {
dump(E+'\n'); alert(E);
}
Modified: trunk/Open-ILS/xul/staff_client/chrome/content/util/list.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/chrome/content/util/list.js 2007-12-17 22:54:45 UTC (rev 8231)
+++ trunk/Open-ILS/xul/staff_client/chrome/content/util/list.js 2007-12-17 22:55:58 UTC (rev 8232)
@@ -1080,6 +1080,47 @@
}
},
+ 'print' : function(params) {
+ if (!params) params = {};
+ switch(this.node.nodeName) {
+ case 'tree' : return this._print_tree(params); break;
+ default: throw('NYI: Need ._print() for ' + this.node.nodeName); break;
+ }
+ },
+
+ '_print_tree' : function(params) {
+ var obj = this;
+ try {
+ JSAN.use('OpenILS.data'); var data = new OpenILS.data(); data.stash_retrieve();
+ if (!params.staff && data.list.au && data.list.au[0]) {
+ params.staff = data.list.au[0];
+ }
+ if (!params.lib && data.list.au && data.list.au[0] && data.list.au[0].ws_ou() && data.hash.aou && data.hash.aou[ data.list.au[0].ws_ou() ]) {
+ params.lib = data.hash.aou[ data.list.au[0].ws_ou() ];
+ params.lib.children(null);
+ }
+ if (params.template && data.print_list_templates[ params.template ]) {
+ var template = data.print_list_templates[ params.template ];
+ for (var i in template) params[i] = template[i];
+ }
+ obj.wrap_in_full_retrieve(
+ function() {
+ try {
+ if (!params.list) params.list = obj.dump_with_keys();
+ JSAN.use('util.print'); var print = new util.print();
+ print.tree_list( params );
+ if (typeof params.callback == 'function') params.callback();
+ } catch(E) {
+ obj.error.standard_unexpected_error_alert('inner _print_tree',E);
+ }
+ }
+ );
+
+ } catch(E) {
+ obj.error.standard_unexpected_error_alert('_print_tree',E);
+ }
+ },
+
'dump_selected_with_keys' : function(params) {
var obj = this;
switch(this.node.nodeName) {
Modified: trunk/Open-ILS/xul/staff_client/server/admin/offline_manage_xacts.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/admin/offline_manage_xacts.js 2007-12-17 22:54:45 UTC (rev 8231)
+++ trunk/Open-ILS/xul/staff_client/server/admin/offline_manage_xacts.js 2007-12-17 22:55:58 UTC (rev 8232)
@@ -320,17 +320,7 @@
'command',
function(ev) {
try {
- obj.error_list.on_all_fleshed =
- function() {
- try {
- dump( obj.error_list.dump_csv() + '\n' );
- copy_to_clipboard(obj.error_list.dump_csv());
- setTimeout(function(){ obj.error_list.on_all_fleshed = null; },0);
- } catch(E) {
- obj.error.standard_unexpected_error_alert('export',E);
- }
- }
- obj.error_list.full_retrieve();
+ obj.error_list.dump_csv_to_clipboard();
} catch(E) {
obj.error.standard_unexpected_error_alert('export',E);
}
Modified: trunk/Open-ILS/xul/staff_client/server/admin/transit_list.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/admin/transit_list.js 2007-12-17 22:54:45 UTC (rev 8231)
+++ trunk/Open-ILS/xul/staff_client/server/admin/transit_list.js 2007-12-17 22:55:58 UTC (rev 8232)
@@ -421,37 +421,11 @@
'print_list' : function(which_list) {
var obj = this;
try {
-
var list = which_list == 0 ? obj.list : obj.list2;
-
- if (list.on_all_fleshed != null) {
- var r = window.confirm('This list is busy retrieving/rendering rows for a pending action. Would you like to abort the pending action and proceed?');
- if (!r) return;
- }
- list.on_all_fleshed =
- function() {
- try {
- dump( js2JSON( list.dump_with_keys() ) + '\n' );
- obj.data.stash_retrieve();
- var lib = obj.data.hash.aou[ obj.data.list.au[0].ws_ou() ];
- lib.children(null);
- var p = {
- 'lib' : lib,
- 'staff' : obj.data.list.au[0],
- 'header' : obj.data.print_list_templates.transit_list.header,
- 'line_item' : obj.data.print_list_templates.transit_list.line_item,
- 'footer' : obj.data.print_list_templates.transit_list.footer,
- 'type' : obj.data.print_list_templates.transit_list.type,
- 'list' : list.dump_with_keys(),
- };
- JSAN.use('util.print'); var print = new util.print();
- print.tree_list( p );
- setTimeout(function(){ list.on_all_fleshed = null; },0);
- } catch(E) {
- obj.error.standard_unexpected_error_alert('print',E);
- }
- }
- list.full_retrieve();
+ var p = {
+ 'template' : 'transit_list'
+ };
+ list.print(p);
} catch(E) {
obj.error.standard_unexpected_error_alert('print',E);
}
Modified: trunk/Open-ILS/xul/staff_client/server/cat/copy_buckets.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/cat/copy_buckets.js 2007-12-17 22:54:45 UTC (rev 8231)
+++ trunk/Open-ILS/xul/staff_client/server/cat/copy_buckets.js 2007-12-17 22:55:58 UTC (rev 8232)
@@ -575,31 +575,13 @@
'cmd_copy_buckets_export' : [
['command'],
function() {
- obj.list2.on_all_fleshed = function() {
- try {
- dump(obj.list2.dump_csv() + '\n');
- copy_to_clipboard(obj.list2.dump_csv());
- setTimeout(function(){obj.list2.on_all_fleshed = null;},0);
- } catch(E) {
- alert(E);
- }
- }
- obj.list2.full_retrieve();
+ obj.list2.dump_csv_to_clipboard();
}
],
'cmd_export1' : [
['command'],
function() {
- obj.list1.on_all_fleshed = function() {
- try {
- dump(obj.list1.dump_csv() + '\n');
- copy_to_clipboard(obj.list1.dump_csv());
- setTimeout(function(){obj.list1.on_all_fleshed = null;},0);
- } catch(E) {
- alert(E);
- }
- }
- obj.list1.full_retrieve();
+ obj.list1.dump_csv_to_clipboard();
}
],
Modified: trunk/Open-ILS/xul/staff_client/server/cat/record_buckets.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/cat/record_buckets.js 2007-12-17 22:54:45 UTC (rev 8231)
+++ trunk/Open-ILS/xul/staff_client/server/cat/record_buckets.js 2007-12-17 22:55:58 UTC (rev 8232)
@@ -448,32 +448,14 @@
'cmd_record_buckets_export' : [
['command'],
function() {
- obj.list2.on_all_fleshed = function() {
- try {
- dump(obj.list2.dump_csv() + '\n');
- copy_to_clipboard(obj.list2.dump_csv());
- setTimeout(function(){obj.list2.on_all_fleshed = null;},0);
- } catch(E) {
- alert(E);
- }
- }
- obj.list2.full_retrieve();
+ obj.list2.dump_csv_to_clipboard();
}
],
'cmd_export1' : [
['command'],
function() {
- obj.list1.on_all_fleshed = function() {
- try {
- dump(obj.list1.dump_csv() + '\n');
- copy_to_clipboard(obj.list1.dump_csv());
- setTimeout(function(){obj.list1.on_all_fleshed = null;},0);
- } catch(E) {
- alert(E);
- }
- }
- obj.list1.full_retrieve();
+ obj.list1.dump_csv_to_clipboard();
}
],
Modified: trunk/Open-ILS/xul/staff_client/server/cat/z3950.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/cat/z3950.js 2007-12-17 22:54:45 UTC (rev 8231)
+++ trunk/Open-ILS/xul/staff_client/server/cat/z3950.js 2007-12-17 22:55:58 UTC (rev 8232)
@@ -82,16 +82,7 @@
'cmd_export' : [
['command'],
function() {
- obj.list.on_all_fleshed = function() {
- try {
- dump(obj.list.dump_csv() + '\n');
- copy_to_clipboard(obj.list.dump_csv());
- setTimeout(function(){obj.list.on_all_fleshed = null;},0);
- } catch(E) {
- obj.error.standard_unexpected_error_alert('Failure during export.',E);
- }
- }
- obj.list.full_retrieve();
+ obj.list.dump_csv_to_clipboard();
}
],
'cmd_broken' : [
Modified: trunk/Open-ILS/xul/staff_client/server/circ/checkin.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/circ/checkin.js 2007-12-17 22:54:45 UTC (rev 8231)
+++ trunk/Open-ILS/xul/staff_client/server/circ/checkin.js 2007-12-17 22:55:58 UTC (rev 8232)
@@ -236,44 +236,16 @@
'cmd_checkin_print' : [
['command'],
function() {
- obj.list.on_all_fleshed = function() {
- try {
- dump( js2JSON( obj.list.dump_with_keys() ) + '\n' );
- obj.OpenILS.data.stash_retrieve();
- var lib = obj.OpenILS.data.hash.aou[ obj.OpenILS.data.list.au[0].ws_ou() ];
- lib.children(null);
- var p = {
- 'lib' : lib,
- 'staff' : obj.OpenILS.data.list.au[0],
- 'header' : obj.OpenILS.data.print_list_templates.checkin.header,
- 'line_item' : obj.OpenILS.data.print_list_templates.checkin.line_item,
- 'footer' : obj.OpenILS.data.print_list_templates.checkin.footer,
- 'type' : obj.OpenILS.data.print_list_templates.checkin.type,
- 'list' : obj.list.dump_with_keys(),
- };
- JSAN.use('util.print'); var print = new util.print();
- print.tree_list( p );
- setTimeout(function(){obj.list.on_all_fleshed = null;},0);
- } catch(E) {
- alert(E);
- }
- }
- obj.list.full_retrieve();
+ var p = {
+ 'template' : 'checkin'
+ };
+ obj.list.print(p);
}
],
'cmd_checkin_export' : [
['command'],
function() {
- obj.list.on_all_fleshed = function() {
- try {
- dump(obj.list.dump_csv() + '\n');
- copy_to_clipboard(obj.list.dump_csv());
- setTimeout(function(){obj.list.on_all_fleshed = null;},0);
- } catch(E) {
- alert(E);
- }
- }
- obj.list.full_retrieve();
+ obj.list.dump_csv_to_clipboard();
}
],
Modified: trunk/Open-ILS/xul/staff_client/server/circ/checkout.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/circ/checkout.js 2007-12-17 22:54:45 UTC (rev 8231)
+++ trunk/Open-ILS/xul/staff_client/server/circ/checkout.js 2007-12-17 22:55:58 UTC (rev 8232)
@@ -266,39 +266,25 @@
var obj = this;
try {
obj.patron = obj.network.simple_request('FM_AU_FLESHED_RETRIEVE_VIA_ID',[ses(),obj.patron_id]);
- dump( js2JSON( obj.list.dump_with_keys() ) + '\n' );
- obj.list.on_all_fleshed = function() {
- try {
- var params = {
- 'patron' : obj.patron,
- 'lib' : obj.data.hash.aou[ obj.data.list.au[0].ws_ou() ],
- 'staff' : obj.data.list.au[0],
- 'header' : obj.data.print_list_templates.checkout.header,
- 'line_item' : obj.data.print_list_templates.checkout.line_item,
- 'footer' : obj.data.print_list_templates.checkout.footer,
- 'type' : obj.data.print_list_templates.checkout.type,
- 'list' : obj.list.dump_with_keys(),
- };
- if (silent) params.no_prompt = true;
- JSAN.use('util.print'); var print = new util.print();
- print.tree_list( params );
- setTimeout(
- function(){
- obj.list.on_all_fleshed = null;
- if (typeof f == 'function') {
- setTimeout(
- function() {
- f();
- }, 1000
- )
- } }
- , 1000
- );
- } catch(E) {
- obj.error.standard_unexpected_error_alert('print',E);
- }
- }
- obj.list.full_retrieve();
+ var params = {
+ 'patron' : obj.patron,
+ 'header' : 'checkout',
+ 'callback' : function() {
+ setTimeout(
+ function(){
+ if (typeof f == 'function') {
+ setTimeout(
+ function() {
+ f();
+ }, 1000
+ )
+ }
+ }, 1000
+ );
+ }
+ };
+ if (silent) params.no_prompt = true;
+ obj.list.print(params);
} catch(E) {
obj.error.standard_unexpected_error_alert('print',E);
}
@@ -307,16 +293,7 @@
'export_list' : function(silent,f) {
var obj = this;
try {
- obj.list.on_all_fleshed = function() {
- try {
- dump( obj.list.dump_csv() + '\n' );
- copy_to_clipboard(obj.list.dump_csv());
- setTimeout(function(){obj.list.on_all_fleshed = null;if (typeof f == 'function') f();},0);
- } catch(E) {
- obj.error.standard_unexpected_error_alert('print',E);
- }
- }
- obj.list.full_retrieve();
+ obj.list.dump_csv_to_clipboard();
} catch(E) {
obj.error.standard_unexpected_error_alert('export',E);
}
Modified: trunk/Open-ILS/xul/staff_client/server/circ/copy_status.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/circ/copy_status.js 2007-12-17 22:54:45 UTC (rev 8231)
+++ trunk/Open-ILS/xul/staff_client/server/circ/copy_status.js 2007-12-17 22:55:58 UTC (rev 8232)
@@ -318,30 +318,10 @@
['command'],
function() {
try {
- obj.list.on_all_fleshed =
- function() {
- try {
- dump( js2JSON( obj.list.dump_with_keys() ) + '\n' );
- obj.data.stash_retrieve();
- var lib = obj.data.hash.aou[ obj.data.list.au[0].ws_ou() ];
- lib.children(null);
- var p = {
- 'lib' : lib,
- 'staff' : obj.data.list.au[0],
- 'header' : obj.data.print_list_templates.item_status.header,
- 'line_item' : obj.data.print_list_templates.item_status.line_item,
- 'footer' : obj.data.print_list_templates.item_status.footer,
- 'type' : obj.data.print_list_templates.item_status.type,
- 'list' : obj.list.dump_with_keys(),
- };
- JSAN.use('util.print'); var print = new util.print();
- print.tree_list( p );
- setTimeout(function(){ obj.list.on_all_fleshed = null; },0);
- } catch(E) {
- obj.error.standard_unexpected_error_alert('print',E);
- }
- }
- obj.list.full_retrieve();
+ var p = {
+ 'template' : 'item_status'
+ };
+ obj.list.print(p);
} catch(E) {
obj.error.standard_unexpected_error_alert('print',E);
}
@@ -351,17 +331,7 @@
['command'],
function() {
try {
- obj.list.on_all_fleshed =
- function() {
- try {
- dump( obj.list.dump_csv() + '\n' );
- copy_to_clipboard(obj.list.dump_csv());
- setTimeout(function(){ obj.list.on_all_fleshed = null; },0);
- } catch(E) {
- obj.error.standard_unexpected_error_alert('export',E);
- }
- }
- obj.list.full_retrieve();
+ obj.list.dump_csv_to_clipboard();
} catch(E) {
obj.error.standard_unexpected_error_alert('export',E);
}
Modified: trunk/Open-ILS/xul/staff_client/server/circ/hold_capture.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/circ/hold_capture.js 2007-12-17 22:54:45 UTC (rev 8231)
+++ trunk/Open-ILS/xul/staff_client/server/circ/hold_capture.js 2007-12-17 22:55:58 UTC (rev 8232)
@@ -60,29 +60,10 @@
'cmd_hold_capture_print' : [
['command'],
function() {
- obj.list.on_all_fleshed = function() {
- try {
- dump( js2JSON( obj.list.dump_with_keys() ) + '\n' );
- obj.OpenILS.data.stash_retrieve();
- var lib = obj.OpenILS.data.hash.aou[ obj.OpenILS.data.list.au[0].ws_ou() ];
- lib.children(null);
- var p = {
- 'lib' : lib,
- 'staff' : obj.OpenILS.data.list.au[0],
- 'header' : obj.OpenILS.data.print_list_templates.hold_capture.header,
- 'line_item' : obj.OpenILS.data.print_list_templates.hold_capture.line_item,
- 'footer' : obj.OpenILS.data.print_list_templates.hold_capture.footer,
- 'type' : obj.OpenILS.data.print_list_templates.hold_capture.type,
- 'list' : obj.list.dump_with_keys(),
- };
- JSAN.use('util.print'); var print = new util.print();
- print.tree_list( p );
- setTimeout(function(){obj.list.on_all_fleshed = null;},0);
- } catch(E) {
- alert(E);
- }
- }
- obj.list.full_retrieve();
+ var p = {
+ 'template' : 'hold_capture'
+ };
+ obj.list.print(p);
}
],
'cmd_hold_capture_reprint' : [
Modified: trunk/Open-ILS/xul/staff_client/server/circ/in_house_use.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/circ/in_house_use.js 2007-12-17 22:54:45 UTC (rev 8231)
+++ trunk/Open-ILS/xul/staff_client/server/circ/in_house_use.js 2007-12-17 22:55:58 UTC (rev 8232)
@@ -155,44 +155,16 @@
'cmd_in_house_use_print' : [
['command'],
function() {
- obj.list.on_all_fleshed = function() {
- try {
- dump( js2JSON( obj.list.dump_with_keys() ) + '\n' );
- obj.data.stash_retrieve();
- var lib = obj.data.hash.aou[ obj.data.list.au[0].ws_ou() ];
- lib.children(null);
- var p = {
- 'lib' : lib,
- 'staff' : obj.data.list.au[0],
- 'header' : obj.data.print_list_templates.in_house_use.header,
- 'line_item' : obj.data.print_list_templates.in_house_use.line_item,
- 'footer' : obj.data.print_list_templates.in_house_use.footer,
- 'type' : obj.data.print_list_templates.in_house_use.type,
- 'list' : obj.list.dump_with_keys(),
- };
- JSAN.use('util.print'); var print = new util.print();
- print.tree_list( p );
- setTimeout(function(){obj.list.on_all_fleshed = null;},0);
- } catch(E) {
- alert(E);
- }
- }
- obj.list.full_retrieve();
+ var p = {
+ 'template' : 'in_house_use'
+ };
+ obj.list.print(p);
}
],
'cmd_in_house_use_export' : [
['command'],
function() {
- obj.list.on_all_fleshed = function() {
- try {
- dump(obj.list.dump_csv() + '\n');
- copy_to_clipboard(obj.list.dump_csv());
- setTimeout(function(){obj.list.on_all_fleshed = null;},0);
- } catch(E) {
- alert(E);
- }
- }
- obj.list.full_retrieve();
+ obj.list.dump_csv_to_clipboard();
}
],
Modified: trunk/Open-ILS/xul/staff_client/server/patron/bill_history.xul
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/bill_history.xul 2007-12-17 22:54:45 UTC (rev 8231)
+++ trunk/Open-ILS/xul/staff_client/server/patron/bill_history.xul 2007-12-17 22:55:58 UTC (rev 8232)
@@ -323,29 +323,13 @@
function print_bills() {
try {
- g.bill_list.on_all_fleshed = function() {
- try {
- var template = 'bills_historical'; if (xul_param('current')) template = 'bills_current';
- JSAN.use('patron.util');
- var params = {
- 'patron' : patron.util.retrieve_au_via_id(ses(),g.patron_id),
- 'lib' : g.data.hash.aou[ g.data.list.au[0].ws_ou() ],
- 'staff' : g.data.list.au[0],
- 'header' : g.data.print_list_templates[template].header,
- 'line_item' : g.data.print_list_templates[template].line_item,
- 'footer' : g.data.print_list_templates[template].footer,
- 'type' : g.data.print_list_templates[template].type,
- 'list' : g.bill_list.dump_with_keys(),
- //'modal' : true,
- };
- JSAN.use('util.print'); var print = new util.print();
- print.tree_list( params );
- setTimeout(function(){ g.bill_list.on_all_fleshed = null; },0);
- } catch(E) {
- g.error.standard_unexpected_error_alert('printing bills', E);
- }
- }
- g.bill_list.full_retrieve();
+ var template = 'bills_historical'; if (xul_param('current')) template = 'bills_current';
+ JSAN.use('patron.util');
+ var params = {
+ 'patron' : patron.util.retrieve_au_via_id(ses(),g.patron_id),
+ 'template' : template
+ };
+ g.bill_list.print(params);
} catch(E) {
g.error.standard_unexpected_error_alert('printing bills', E);
}
Modified: trunk/Open-ILS/xul/staff_client/server/patron/holds.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/holds.js 2007-12-17 22:54:45 UTC (rev 8231)
+++ trunk/Open-ILS/xul/staff_client/server/patron/holds.js 2007-12-17 22:55:58 UTC (rev 8232)
@@ -195,29 +195,12 @@
['command'],
function() {
try {
- dump(js2JSON(obj.list.dump_with_keys()) + '\n');
- function flesh_callback() {
- try {
- JSAN.use('patron.util');
- var params = {
- 'patron' : patron.util.retrieve_au_via_id(ses(),obj.patron_id),
- 'lib' : obj.data.hash.aou[ obj.data.list.au[0].ws_ou() ],
- 'staff' : obj.data.list.au[0],
- 'header' : obj.data.print_list_templates.holds.header,
- 'line_item' : obj.data.print_list_templates.holds.line_item,
- 'footer' : obj.data.print_list_templates.holds.footer,
- 'type' : obj.data.print_list_templates.holds.type,
- 'list' : obj.list.dump_with_keys(),
- };
- JSAN.use('util.print'); var print = new util.print();
- print.tree_list( params );
- setTimeout(function(){obj.list.on_all_fleshed = null;},0);
- } catch(E) {
- obj.error.standard_unexpected_error_alert('print 2',E);
- }
- }
- obj.list.on_all_fleshed = flesh_callback;
- obj.list.full_retrieve();
+ JSAN.use('patron.util');
+ var params = {
+ 'patron' : patron.util.retrieve_au_via_id(ses(),obj.patron_id),
+ 'template' : 'holds'
+ };
+ obj.list.print(params);
} catch(E) {
obj.error.standard_unexpected_error_alert('print 1',E);
}
@@ -227,17 +210,7 @@
['command'],
function() {
try {
- function flesh_callback() {
- try {
- dump(obj.list.dump_csv() + '\n');
- copy_to_clipboard(obj.list.dump_csv());
- setTimeout(function(){obj.list.on_all_fleshed = null;},0);
- } catch(E) {
- obj.error.standard_unexpected_error_alert('export 2',E);
- }
- }
- obj.list.on_all_fleshed = flesh_callback;
- obj.list.full_retrieve();
+ obj.list.dump_csv_to_clipboard();
} catch(E) {
obj.error.standard_unexpected_error_alert('export 1',E);
}
Modified: trunk/Open-ILS/xul/staff_client/server/patron/items.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/items.js 2007-12-17 22:54:45 UTC (rev 8231)
+++ trunk/Open-ILS/xul/staff_client/server/patron/items.js 2007-12-17 22:55:58 UTC (rev 8232)
@@ -200,29 +200,12 @@
var obj = this;
try {
var list = (which==2 ? obj.list2 : obj.list);
- dump(js2JSON( list.dump_with_keys() ) + '\n');
- function flesh_callback() {
- try {
- JSAN.use('patron.util');
- var params = {
- 'patron' : patron.util.retrieve_fleshed_au_via_id(ses(),obj.patron_id),
- 'lib' : obj.data.hash.aou[ obj.data.list.au[0].ws_ou() ],
- 'staff' : obj.data.list.au[0],
- 'header' : obj.data.print_list_templates.items_out.header,
- 'line_item' : obj.data.print_list_templates.items_out.line_item,
- 'footer' : obj.data.print_list_templates.items_out.footer,
- 'type' : obj.data.print_list_templates.items_out.type,
- 'list' : list.dump_with_keys(),
- };
- JSAN.use('util.print'); var print = new util.print();
- print.tree_list( params );
- setTimeout(function(){list.on_all_fleshed = null;},0);
- } catch(E) {
- obj.error.standard_unexpected_error_alert('printing 2',E);
- }
- }
- list.on_all_fleshed = flesh_callback;
- list.full_retrieve();
+ JSAN.use('patron.util');
+ var params = {
+ 'patron' : patron.util.retrieve_fleshed_au_via_id(ses(),obj.patron_id),
+ 'template' : 'items_out'
+ };
+ list.print( params );
} catch(E) {
obj.error.standard_unexpected_error_alert('printing 1',E);
}
@@ -232,17 +215,7 @@
var obj = this;
try {
var list = (which==2 ? obj.list2 : obj.list);
- function flesh_callback() {
- try {
- dump( list.dump_csv() + '\n');
- copy_to_clipboard(list.dump_csv());
- setTimeout(function(){list.on_all_fleshed = null;},0);
- } catch(E) {
- obj.error.standard_unexpected_error_alert('export 2',E);
- }
- }
- list.on_all_fleshed = flesh_callback;
- list.full_retrieve();
+ list.dump_csv_to_clipboard();
} catch(E) {
obj.error.standard_unexpected_error_alert('export 1',E);
}
Modified: trunk/Open-ILS/xul/staff_client/server/patron/search_result.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/search_result.js 2007-12-17 22:54:45 UTC (rev 8231)
+++ trunk/Open-ILS/xul/staff_client/server/patron/search_result.js 2007-12-17 22:55:58 UTC (rev 8232)
@@ -94,32 +94,14 @@
'cmd_search_print' : [
['command'],
function() {
- dump( js2JSON( obj.list.dump_with_keys() ) );
- JSAN.use('OpenILS.data'); var data = new OpenILS.data(); data.init({'via':'stash'});
- obj.list.on_all_fleshed = function() {
- try {
- dump( js2JSON( obj.list.dump_with_keys() ) + '\n' );
- obj.OpenILS.data.stash_retrieve();
- var lib = data.hash.aou[ data.list.au[0].ws_ou() ];
- lib.children(null);
- var p = {
- 'lib' : lib,
- 'staff' : data.list.au[0],
- 'header' : data.print_list_templates.patron.header,
- 'line_item' : data.print_list_templates.patron.line_item,
- 'footer' : data.print_list_templates.patron.footer,
- 'type' : data.print_list_templates.patron.type,
- 'list' : obj.list.dump_with_keys(),
- };
- JSAN.use('util.print'); var print = new util.print();
- print.tree_list( p );
- setTimeout(function(){obj.list.on_all_fleshed = null;},0);
- } catch(E) {
- alert(E);
- }
- }
- obj.list.full_retrieve();
-
+ try {
+ var p = {
+ 'template' : 'patron'
+ };
+ obj.list.print( p );
+ } catch(E) {
+ obj.error.standard_unexpected_error_alert('patron search print',E);
+ }
}
],
'cmd_sel_clip' : [
More information about the open-ils-commits
mailing list