From: pines Date: Thu, 17 Aug 2006 21:29:30 +0000 (+0000) Subject: print tweaks X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=a3d4d71c57e2f34f4778d99b07f76f6a6d9b1175;p=evergreen%2Fpines.git print tweaks git-svn-id: svn://svn.open-ils.org/ILS/trunk@5578 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/xul/staff_client/server/cat/copy_buckets.js b/Open-ILS/xul/staff_client/server/cat/copy_buckets.js index 130b9d2d53..d294aa8f54 100644 --- a/Open-ILS/xul/staff_client/server/cat/copy_buckets.js +++ b/Open-ILS/xul/staff_client/server/cat/copy_buckets.js @@ -464,8 +464,30 @@ cat.copy_buckets.prototype = { 'cmd_copy_buckets_print' : [ ['command'], function() { - dump( js2JSON( obj.list2.dump() ) ); - alert( js2JSON( obj.list2.dump() ) ); + JSAN.use('OpenILS.data'); var data = new OpenILS.data(); data.init({'via':'stash'}); + obj.list2.on_all_fleshed = function() { + try { + dump( js2JSON( obj.list2.dump_with_keys() ) + '\n' ); + 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.item_status.header, + 'line_item' : data.print_list_templates.item_status.line_item, + 'footer' : data.print_list_templates.item_status.footer, + 'type' : data.print_list_templates.item_status.type, + 'list' : obj.list2.dump_with_keys(), + }; + JSAN.use('util.print'); var print = new util.print(); + print.tree_list( p ); + setTimeout(function(){obj.list2.on_all_fleshed = null;},0); + } catch(E) { + alert(E); + } + } + obj.list2.full_retrieve(); } ], 'cmd_copy_buckets_reprint' : [ diff --git a/Open-ILS/xul/staff_client/server/circ/checkin.js b/Open-ILS/xul/staff_client/server/circ/checkin.js index baea790abf..654639c2f3 100644 --- a/Open-ILS/xul/staff_client/server/circ/checkin.js +++ b/Open-ILS/xul/staff_client/server/circ/checkin.js @@ -203,7 +203,7 @@ circ.checkin.prototype = { function() { obj.list.on_all_fleshed = function() { try { - dump( js2JSON( obj.list.dump() ) + '\n' ); + 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); @@ -214,7 +214,7 @@ circ.checkin.prototype = { '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(), + 'list' : obj.list.dump_with_keys(), }; JSAN.use('util.print'); var print = new util.print(); print.tree_list( p ); diff --git a/Open-ILS/xul/staff_client/server/circ/checkout.js b/Open-ILS/xul/staff_client/server/circ/checkout.js index 27d7e8b648..af72c07555 100644 --- a/Open-ILS/xul/staff_client/server/circ/checkout.js +++ b/Open-ILS/xul/staff_client/server/circ/checkout.js @@ -233,6 +233,7 @@ circ.checkout.prototype = { 'print' : function(silent,f) { var obj = this; try { + dump( js2JSON( obj.list.dump_with_keys() ) + '\n' ); obj.list.on_all_fleshed = function() { try { var params = { @@ -243,7 +244,7 @@ circ.checkout.prototype = { '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(), + 'list' : obj.list.dump_with_keys(), }; if (silent) params.no_prompt = true; JSAN.use('util.print'); var print = new util.print(); diff --git a/Open-ILS/xul/staff_client/server/circ/copy_status.js b/Open-ILS/xul/staff_client/server/circ/copy_status.js index af45a68d01..ab4719f913 100644 --- a/Open-ILS/xul/staff_client/server/circ/copy_status.js +++ b/Open-ILS/xul/staff_client/server/circ/copy_status.js @@ -190,7 +190,7 @@ circ.copy_status.prototype = { obj.list.on_all_fleshed = function() { try { - dump( js2JSON( obj.list.dump() ) + '\n' ); + 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); @@ -201,7 +201,7 @@ circ.copy_status.prototype = { '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(), + 'list' : obj.list.dump_with_keys(), }; JSAN.use('util.print'); var print = new util.print(); print.tree_list( p ); diff --git a/Open-ILS/xul/staff_client/server/circ/hold_capture.js b/Open-ILS/xul/staff_client/server/circ/hold_capture.js index 90373bd8b9..c43989d155 100644 --- a/Open-ILS/xul/staff_client/server/circ/hold_capture.js +++ b/Open-ILS/xul/staff_client/server/circ/hold_capture.js @@ -62,7 +62,7 @@ circ.hold_capture.prototype = { function() { obj.list.on_all_fleshed = function() { try { - dump( js2JSON( obj.list.dump() ) + '\n' ); + 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); @@ -73,7 +73,7 @@ circ.hold_capture.prototype = { '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(), + 'list' : obj.list.dump_with_keys(), }; JSAN.use('util.print'); var print = new util.print(); print.tree_list( p ); diff --git a/Open-ILS/xul/staff_client/server/circ/in_house_use.js b/Open-ILS/xul/staff_client/server/circ/in_house_use.js index ceb3d4bd04..5773ae6f6f 100644 --- a/Open-ILS/xul/staff_client/server/circ/in_house_use.js +++ b/Open-ILS/xul/staff_client/server/circ/in_house_use.js @@ -98,7 +98,7 @@ circ.in_house_use.prototype = { function() { obj.list.on_all_fleshed = function() { try { - dump( js2JSON( obj.list.dump() ) + '\n' ); + 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); @@ -109,7 +109,7 @@ circ.in_house_use.prototype = { '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(), + 'list' : obj.list.dump_with_keys(), }; JSAN.use('util.print'); var print = new util.print(); print.tree_list( p ); diff --git a/Open-ILS/xul/staff_client/server/patron/holds.js b/Open-ILS/xul/staff_client/server/patron/holds.js index 3bbb423292..cdfdfe4178 100644 --- a/Open-ILS/xul/staff_client/server/patron/holds.js +++ b/Open-ILS/xul/staff_client/server/patron/holds.js @@ -183,7 +183,7 @@ patron.holds.prototype = { ['command'], function() { try { - dump(js2JSON(obj.list.dump()) + '\n'); + dump(js2JSON(obj.list.dump_with_keys()) + '\n'); function flesh_callback() { try { JSAN.use('patron.util'); @@ -195,7 +195,7 @@ patron.holds.prototype = { '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(), + 'list' : obj.list.dump_with_keys(), }; JSAN.use('util.print'); var print = new util.print(); print.tree_list( params ); diff --git a/Open-ILS/xul/staff_client/server/patron/items.js b/Open-ILS/xul/staff_client/server/patron/items.js index d4a965785c..4f7d4f2c68 100644 --- a/Open-ILS/xul/staff_client/server/patron/items.js +++ b/Open-ILS/xul/staff_client/server/patron/items.js @@ -180,7 +180,7 @@ patron.items.prototype = { var obj = this; try { var list = (which==2 ? obj.list2 : obj.list); - dump(js2JSON( list.dump() ) + '\n'); + dump(js2JSON( list.dump_with_keys() ) + '\n'); function flesh_callback() { try { JSAN.use('patron.util'); @@ -192,7 +192,7 @@ patron.items.prototype = { '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' : list.dump(), + 'list' : list.dump_with_keys(), }; JSAN.use('util.print'); var print = new util.print(); print.tree_list( params ); diff --git a/Open-ILS/xul/staff_client/server/patron/search_result.js b/Open-ILS/xul/staff_client/server/patron/search_result.js index 891b3c39c1..6460ccb5b9 100644 --- a/Open-ILS/xul/staff_client/server/patron/search_result.js +++ b/Open-ILS/xul/staff_client/server/patron/search_result.js @@ -87,8 +87,32 @@ patron.search_result.prototype = { 'cmd_search_print' : [ ['command'], function() { - dump( js2JSON( obj.list.dump() ) ); - alert( js2JSON( obj.list.dump() ) ); + 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(); + } ], 'cmd_sel_clip' : [