print tweaks
authorpines <pines@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 17 Aug 2006 21:29:30 +0000 (21:29 +0000)
committerpines <pines@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 17 Aug 2006 21:29:30 +0000 (21:29 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@5578 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/server/cat/copy_buckets.js
Open-ILS/xul/staff_client/server/circ/checkin.js
Open-ILS/xul/staff_client/server/circ/checkout.js
Open-ILS/xul/staff_client/server/circ/copy_status.js
Open-ILS/xul/staff_client/server/circ/hold_capture.js
Open-ILS/xul/staff_client/server/circ/in_house_use.js
Open-ILS/xul/staff_client/server/patron/holds.js
Open-ILS/xul/staff_client/server/patron/items.js
Open-ILS/xul/staff_client/server/patron/search_result.js

index 130b9d2..d294aa8 100644 (file)
@@ -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' : [
index baea790..654639c 100644 (file)
@@ -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 );
index 27d7e8b..af72c07 100644 (file)
@@ -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();
index af45a68..ab4719f 100644 (file)
@@ -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 );
index 90373bd..c43989d 100644 (file)
@@ -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 );
index ceb3d4b..5773ae6 100644 (file)
@@ -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 );
index 3bbb423..cdfdfe4 100644 (file)
@@ -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 );
index d4a9657..4f7d4f2 100644 (file)
@@ -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 );
index 891b3c3..6460ccb 100644 (file)
@@ -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' : [