From e7814461d7747e679c2b44d8ae33d71efd5e8fd0 Mon Sep 17 00:00:00 2001 From: edoceo Date: Thu, 25 Apr 2013 10:52:43 -0700 Subject: [PATCH] Adds the option to print a single item from the Items Out. A new button and right-click option are created. Signed-off-by: edoceo Signed-off-by: Ben Shum --- Open-ILS/web/opac/locale/en-US/lang.dtd | 1 + .../xul/staff_client/server/patron/items.js | 33 +++++++++++++++++++ .../server/patron/items_overlay.xul | 8 +++++ 3 files changed, 42 insertions(+) diff --git a/Open-ILS/web/opac/locale/en-US/lang.dtd b/Open-ILS/web/opac/locale/en-US/lang.dtd index eb827f5375..e9f9f1ccb1 100644 --- a/Open-ILS/web/opac/locale/en-US/lang.dtd +++ b/Open-ILS/web/opac/locale/en-US/lang.dtd @@ -3691,6 +3691,7 @@ + diff --git a/Open-ILS/xul/staff_client/server/patron/items.js b/Open-ILS/xul/staff_client/server/patron/items.js index a2fc0619be..afe6dcd7ff 100644 --- a/Open-ILS/xul/staff_client/server/patron/items.js +++ b/Open-ILS/xul/staff_client/server/patron/items.js @@ -149,6 +149,8 @@ patron.items.prototype = { ], 'cmd_items_print' : [ ['command'], function() { obj.items_print(1); } ], 'cmd_items_print2' : [ ['command'], function() { obj.items_print(2); } ], + 'cmd_items_print_selected' : [ ['command'], function() { obj.items_print_selected(1); } ], + 'cmd_items_print_selected2' : [ ['command'], function() { obj.items_print_selected(2); } ], 'cmd_items_export' : [ ['command'], function() { obj.items_export(1); } ], 'cmd_items_export2' : [ ['command'], function() { obj.items_export(2); } ], 'cmd_items_renew' : [ ['command'], function() { obj.items_renew({which_list:1}); } ], @@ -299,7 +301,38 @@ patron.items.prototype = { obj.error.standard_unexpected_error_alert('printing 1',E); } }, + 'items_print_selected': function(which) { + var obj = this; + try { + JSAN.use('patron.util'); + // JSAN.use('util.functional'); + var list = ( which == 2 ? obj.list2 : obj.list); + // Selected Rows + var list_dump = list.dump_with_keys(); + var pick_list = ( which == 2 ? obj.retrieve_ids2 : obj.retrieve_ids ); + if (!pick_list || pick_list.length == 0) return; + + // I don't know a better way to just get all the data from one row + for (var i=0; i + @@ -40,6 +41,7 @@ + @@ -59,6 +61,7 @@ + @@ -81,6 +84,7 @@ + @@ -139,6 +143,7 @@ + @@ -169,6 +174,7 @@ + @@ -199,12 +205,14 @@ +