From 862beffad6e230f5e488e98bf3bfeeabf6a1196a Mon Sep 17 00:00:00 2001 From: pines Date: Fri, 11 Aug 2006 03:13:50 +0000 Subject: [PATCH] putting show last few circs and show item summary actions in places git-svn-id: svn://svn.open-ils.org/ILS/trunk@5452 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../xul/staff_client/server/cat/copy_browser.js | 52 ++++++++++++++++++++++ .../xul/staff_client/server/cat/copy_browser.xul | 14 ++++-- Open-ILS/xul/staff_client/server/circ/checkin.js | 12 +++++ Open-ILS/xul/staff_client/server/circ/checkin.xul | 1 + .../staff_client/server/circ/checkin_overlay.xul | 2 + .../xul/staff_client/server/circ/copy_status.js | 2 +- .../xul/staff_client/server/circ/copy_status.xul | 2 +- Open-ILS/xul/staff_client/server/circ/util.js | 1 + Open-ILS/xul/staff_client/server/patron/holds.js | 22 ++++++++- Open-ILS/xul/staff_client/server/patron/holds.xul | 2 + .../staff_client/server/patron/holds_overlay.xul | 4 ++ Open-ILS/xul/staff_client/server/patron/items.js | 27 ++++++++++- Open-ILS/xul/staff_client/server/patron/items.xul | 4 ++ .../staff_client/server/patron/items_overlay.xul | 4 ++ 14 files changed, 140 insertions(+), 9 deletions(-) diff --git a/Open-ILS/xul/staff_client/server/cat/copy_browser.js b/Open-ILS/xul/staff_client/server/cat/copy_browser.js index ae20f55ecf..516a63832c 100644 --- a/Open-ILS/xul/staff_client/server/cat/copy_browser.js +++ b/Open-ILS/xul/staff_client/server/cat/copy_browser.js @@ -64,6 +64,54 @@ cat.copy_browser.prototype = { obj.list.clear(); } ], + 'sel_patron' : [ + ['command'], + function() { + JSAN.use('util.functional'); + + var list = util.functional.filter_list( + obj.sel_list, + function (o) { + return o.split(/_/)[0] == 'acp'; + } + ); + + list = util.functional.map_list( + list, + function (o) { + return { 'copy_id' : o.split(/_/)[1] }; + } + ); + + JSAN.use('circ.util'); + circ.util.show_last_few_circs(list); + } + ], + 'sel_copy_details' : [ + ['command'], + function() { + JSAN.use('util.functional'); + + var list = util.functional.filter_list( + obj.sel_list, + function (o) { + return o.split(/_/)[0] == 'acp'; + } + ); + + list = util.functional.map_list( + list, + function (o) { + return o.split(/_/)[1]; + } + ); + + JSAN.use('circ.util'); + for (var i = 0; i < list.length; i++) { + circ.util.show_copy_details( list[i] ); + } + } + ], 'cmd_add_items' : [ ['command'], function() { @@ -1291,6 +1339,8 @@ cat.copy_browser.prototype = { obj.controller.view.cmd_mark_volume.setAttribute('disabled','true'); obj.controller.view.cmd_transfer_volume.setAttribute('disabled','true'); obj.controller.view.cmd_transfer_items.setAttribute('disabled','true'); + obj.controller.view.sel_copy_details.setAttribute('disabled','true'); + obj.controller.view.sel_patron.setAttribute('disabled','true'); if (found_aou) { obj.controller.view.cmd_add_volumes.setAttribute('disabled','false'); obj.controller.view.cmd_mark_library.setAttribute('disabled','false'); @@ -1308,6 +1358,8 @@ cat.copy_browser.prototype = { obj.controller.view.cmd_delete_items.setAttribute('disabled','false'); obj.controller.view.cmd_print_spine_labels.setAttribute('disabled','false'); obj.controller.view.cmd_transfer_items.setAttribute('disabled','false'); + obj.controller.view.sel_copy_details.setAttribute('disabled','false'); + obj.controller.view.sel_patron.setAttribute('disabled','false'); } } catch(E) { obj.error.standard_unexpected_error_alert('Copy Browser Actions',E); diff --git a/Open-ILS/xul/staff_client/server/cat/copy_browser.xul b/Open-ILS/xul/staff_client/server/cat/copy_browser.xul index 1c4a9b9ed1..4570a7da5f 100644 --- a/Open-ILS/xul/staff_client/server/cat/copy_browser.xul +++ b/Open-ILS/xul/staff_client/server/cat/copy_browser.xul @@ -64,6 +64,8 @@ + + @@ -89,8 +91,10 @@ - - + + + + @@ -121,8 +125,10 @@ - - + + + + diff --git a/Open-ILS/xul/staff_client/server/circ/checkin.js b/Open-ILS/xul/staff_client/server/circ/checkin.js index 100f7cf913..4e13420e64 100644 --- a/Open-ILS/xul/staff_client/server/circ/checkin.js +++ b/Open-ILS/xul/staff_client/server/circ/checkin.js @@ -49,6 +49,7 @@ circ.checkin.prototype = { obj.controller.view.sel_edit.setAttribute('disabled','true'); obj.controller.view.sel_opac.setAttribute('disabled','true'); obj.controller.view.sel_patron.setAttribute('disabled','true'); + obj.controller.view.sel_copy_details.setAttribute('disabled','true'); obj.controller.view.sel_bucket.setAttribute('disabled','true'); obj.controller.view.sel_spine.setAttribute('disabled','true'); obj.controller.view.sel_transit_abort.setAttribute('disabled','true'); @@ -57,6 +58,7 @@ circ.checkin.prototype = { obj.controller.view.sel_edit.setAttribute('disabled','false'); obj.controller.view.sel_opac.setAttribute('disabled','false'); obj.controller.view.sel_patron.setAttribute('disabled','false'); + obj.controller.view.sel_copy_details.setAttribute('disabled','false'); obj.controller.view.sel_bucket.setAttribute('disabled','false'); obj.controller.view.sel_spine.setAttribute('disabled','false'); obj.controller.view.sel_transit_abort.setAttribute('disabled','false'); @@ -116,6 +118,16 @@ circ.checkin.prototype = { circ.util.show_last_few_circs(obj.selection_list); } ], + 'sel_copy_details' : [ + ['command'], + function() { + JSAN.use('circ.util'); + for (var i = 0; i < obj.selection_list.length; i++) { + circ.util.show_copy_details( obj.selection_list[i].copy_id ); + } + } + ], + 'sel_bucket' : [ ['command'], function() { diff --git a/Open-ILS/xul/staff_client/server/circ/checkin.xul b/Open-ILS/xul/staff_client/server/circ/checkin.xul index 2f9fa50056..d81867a8bb 100644 --- a/Open-ILS/xul/staff_client/server/circ/checkin.xul +++ b/Open-ILS/xul/staff_client/server/circ/checkin.xul @@ -86,6 +86,7 @@ + diff --git a/Open-ILS/xul/staff_client/server/circ/checkin_overlay.xul b/Open-ILS/xul/staff_client/server/circ/checkin_overlay.xul index 72d72801ef..acd5530f35 100644 --- a/Open-ILS/xul/staff_client/server/circ/checkin_overlay.xul +++ b/Open-ILS/xul/staff_client/server/circ/checkin_overlay.xul @@ -13,6 +13,7 @@ + @@ -57,6 +58,7 @@ + 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 84d9900822..39dac47001 100644 --- a/Open-ILS/xul/staff_client/server/circ/copy_status.js +++ b/Open-ILS/xul/staff_client/server/circ/copy_status.js @@ -46,9 +46,9 @@ circ.copy_status.prototype = { obj.controller.view.sel_checkin.setAttribute('disabled','true'); obj.controller.view.sel_edit.setAttribute('disabled','true'); obj.controller.view.sel_opac.setAttribute('disabled','true'); - obj.controller.view.sel_patron.setAttribute('disabled','true'); obj.controller.view.sel_bucket.setAttribute('disabled','true'); obj.controller.view.sel_copy_details.setAttribute('disabled','true'); + obj.controller.view.sel_patron.setAttribute('disabled','true'); obj.controller.view.sel_spine.setAttribute('disabled','true'); obj.controller.view.sel_transit_abort.setAttribute('disabled','true'); obj.controller.view.sel_clip.setAttribute('disabled','true'); diff --git a/Open-ILS/xul/staff_client/server/circ/copy_status.xul b/Open-ILS/xul/staff_client/server/circ/copy_status.xul index 46e7f83762..bfb23d2073 100644 --- a/Open-ILS/xul/staff_client/server/circ/copy_status.xul +++ b/Open-ILS/xul/staff_client/server/circ/copy_status.xul @@ -87,10 +87,10 @@ + - diff --git a/Open-ILS/xul/staff_client/server/circ/util.js b/Open-ILS/xul/staff_client/server/circ/util.js index e57a68b841..a47c287478 100644 --- a/Open-ILS/xul/staff_client/server/circ/util.js +++ b/Open-ILS/xul/staff_client/server/circ/util.js @@ -74,6 +74,7 @@ circ.util.show_last_few_circs = function(selection_list,count) { for (var i = 0; i < selection_list.length; i++) { try { + if (typeof selection_list[i].copy_id == 'undefined' || selection_list[i].copy_id == null) continue; obj.data.fancy_prompt_data = null; obj.data.stash('fancy_prompt_data'); var url = xulG.url_prefix( urls.XUL_CIRC_SUMMARY ) + '?copy_id=' + selection_list[i].copy_id + '&count=' + count; obj.win.open( url, 'show_last_few_circs', 'chrome,resizable,modal' ); diff --git a/Open-ILS/xul/staff_client/server/patron/holds.js b/Open-ILS/xul/staff_client/server/patron/holds.js index 74b449fe18..3b3f568fd0 100644 --- a/Open-ILS/xul/staff_client/server/patron/holds.js +++ b/Open-ILS/xul/staff_client/server/patron/holds.js @@ -103,6 +103,8 @@ patron.holds.prototype = { function(o) { return JSON2js( o.getAttribute('retrieve_id') ); } ); if (obj.retrieve_ids.length > 0) { + obj.controller.view.sel_copy_details.setAttribute('disabled','false'); + obj.controller.view.sel_patron.setAttribute('disabled','false'); obj.controller.view.cmd_retrieve_patron.setAttribute('disabled','false'); obj.controller.view.cmd_holds_edit_pickup_lib.setAttribute('disabled','false'); obj.controller.view.cmd_holds_edit_phone_notify.setAttribute('disabled','false'); @@ -113,6 +115,8 @@ patron.holds.prototype = { obj.controller.view.cmd_holds_cancel.setAttribute('disabled','false'); obj.controller.view.cmd_show_catalog.setAttribute('disabled','false'); } else { + obj.controller.view.sel_copy_details.setAttribute('disabled','true'); + obj.controller.view.sel_patron.setAttribute('disabled','true'); obj.controller.view.cmd_retrieve_patron.setAttribute('disabled','true'); obj.controller.view.cmd_holds_edit_pickup_lib.setAttribute('disabled','true'); obj.controller.view.cmd_holds_edit_phone_notify.setAttribute('disabled','true'); @@ -140,6 +144,22 @@ patron.holds.prototype = { ['command'], function() { alert('Not Yet Implemented'); } ], + 'sel_patron' : [ + ['command'], + function() { + JSAN.use('circ.util'); + circ.util.show_last_few_circs(obj.selection_list); + } + ], + 'sel_copy_details' : [ + ['command'], + function() { + JSAN.use('circ.util'); + for (var i = 0; i < obj.selection_list.length; i++) { + if (obj.selection_list[i].copy_id) circ.util.show_copy_details( obj.selection_list[i].copy_id ); + } + } + ], 'cmd_holds_print' : [ ['command'], function() { @@ -530,7 +550,7 @@ patron.holds.prototype = { obj.holds_map[ hold.id() ] = hold; obj.list.append( { - 'retrieve_id' : js2JSON({'id':hold.id(),'type':hold.hold_type(),'target':hold.target(),'usr':hold.usr(),}), + 'retrieve_id' : js2JSON({'copy_id':hold.hold_type()=='C'?hold.target():null,'id':hold.id(),'type':hold.hold_type(),'target':hold.target(),'usr':hold.usr(),}), 'row' : { 'my' : { 'ahr' : hold, diff --git a/Open-ILS/xul/staff_client/server/patron/holds.xul b/Open-ILS/xul/staff_client/server/patron/holds.xul index 49a81c26f7..acd43f0c2d 100644 --- a/Open-ILS/xul/staff_client/server/patron/holds.xul +++ b/Open-ILS/xul/staff_client/server/patron/holds.xul @@ -65,6 +65,8 @@ + + diff --git a/Open-ILS/xul/staff_client/server/patron/holds_overlay.xul b/Open-ILS/xul/staff_client/server/patron/holds_overlay.xul index 9c4cbc3ff5..2933726678 100644 --- a/Open-ILS/xul/staff_client/server/patron/holds_overlay.xul +++ b/Open-ILS/xul/staff_client/server/patron/holds_overlay.xul @@ -13,6 +13,8 @@ + + @@ -52,6 +54,8 @@ + + diff --git a/Open-ILS/xul/staff_client/server/patron/items.js b/Open-ILS/xul/staff_client/server/patron/items.js index 98f06fba2b..d4e40c3adc 100644 --- a/Open-ILS/xul/staff_client/server/patron/items.js +++ b/Open-ILS/xul/staff_client/server/patron/items.js @@ -25,6 +25,21 @@ patron.items.prototype = { 'cmd_broken' : [ ['command'], function() { alert('Not Yet Implemented'); } ], 'sel_clip' : [ ['command'], function() { obj.list.clipboard(); } ], 'sel_clip2' : [ ['command'], function() { obj.list2.clipboard(); } ], + 'sel_patron' : [ ['command'], function() { JSAN.use('circ.util'); circ.util.show_last_few_circs(obj.selection_list); } ], + 'sel_copy_details' : [ ['command'], + function() { + JSAN.use('circ.util'); + for (var i = 0; i < obj.selection_list.length; i++) { circ.util.show_copy_details( obj.selection_list[i].copy_id ); } + } + ], + 'sel_patron2' : [ ['command'], function() { JSAN.use('circ.util'); circ.util.show_last_few_circs(obj.selection_list2); } ], + 'sel_copy_details2' : [ ['command'], + function() { + JSAN.use('circ.util'); + for (var i = 0; i < obj.selection_list2.length; i++) { circ.util.show_copy_details( obj.selection_list2[i].copy_id ); } + } + ], + 'cmd_items_print' : [ ['command'], function() { obj.items_print(1); } ], 'cmd_items_print2' : [ ['command'], function() { obj.items_print(2); } ], 'cmd_items_renew' : [ ['command'], function() { obj.items_renew(1); } ], @@ -51,6 +66,10 @@ patron.items.prototype = { obj.controller.view.sel_clip.setAttribute('disabled','true'); obj.controller.view.sel_clip2.setAttribute('disabled','true'); + obj.controller.view.sel_copy_details.setAttribute('disabled','true'); + obj.controller.view.sel_patron.setAttribute('disabled','true'); + obj.controller.view.sel_copy_details2.setAttribute('disabled','true'); + obj.controller.view.sel_patron2.setAttribute('disabled','true'); obj.controller.view.cmd_items_claimed_returned.setAttribute('disabled','true'); obj.controller.view.cmd_items_renew.setAttribute('disabled','true'); obj.controller.view.cmd_items_checkin.setAttribute('disabled','true'); @@ -512,12 +531,12 @@ patron.items.prototype = { [ row.my.circ.target_copy() ] ); - params.row_node.setAttribute( 'retrieve_id', js2JSON({'circ_id':row.my.circ.id(),'barcode':row.my.acp.barcode(),'doc_id': (typeof row.my.mvr.ilsevent == 'undefined' ? row.my.mvr.doc_id() : null )}) ); + params.row_node.setAttribute( 'retrieve_id', js2JSON({'copy_id':row.my.circ.target_copy(),'circ_id':row.my.circ.id(),'barcode':row.my.acp.barcode(),'doc_id': (typeof row.my.mvr.ilsevent == 'undefined' ? row.my.mvr.doc_id() : null )}) ); } ); } else { - params.row_node.setAttribute( 'retrieve_id', js2JSON({'circ_id':row.my.circ.id(),'barcode':row.my.acp.barcode(),'doc_id': ( typeof row.my.mvr.ilsevent == 'undefined' ? row.my.mvr.doc_id() : null) }) ); + params.row_node.setAttribute( 'retrieve_id', js2JSON({'copy_id':row.my.circ.target_copy(),'circ_id':row.my.circ.id(),'barcode':row.my.acp.barcode(),'doc_id': ( typeof row.my.mvr.ilsevent == 'undefined' ? row.my.mvr.doc_id() : null) }) ); } funcs.push( @@ -671,6 +690,8 @@ patron.items.prototype = { obj.controller.view.cmd_items_edit.setAttribute('disabled','false'); obj.controller.view.cmd_items_mark_lost.setAttribute('disabled','false'); obj.controller.view.cmd_show_catalog.setAttribute('disabled','false'); + obj.controller.view.sel_copy_details.setAttribute('disabled','false'); + obj.controller.view.sel_patron.setAttribute('disabled','false'); obj.retrieve_ids = list; }, @@ -687,6 +708,8 @@ patron.items.prototype = { obj.controller.view.cmd_items_edit2.setAttribute('disabled','false'); obj.controller.view.cmd_items_mark_lost2.setAttribute('disabled','false'); obj.controller.view.cmd_show_catalog2.setAttribute('disabled','false'); + obj.controller.view.sel_copy_details2.setAttribute('disabled','false'); + obj.controller.view.sel_patron2.setAttribute('disabled','false'); this.retrieve_ids2 = list; }, diff --git a/Open-ILS/xul/staff_client/server/patron/items.xul b/Open-ILS/xul/staff_client/server/patron/items.xul index a9997981c3..9f6ef2b15a 100644 --- a/Open-ILS/xul/staff_client/server/patron/items.xul +++ b/Open-ILS/xul/staff_client/server/patron/items.xul @@ -65,6 +65,8 @@ + + @@ -78,6 +80,8 @@ + + diff --git a/Open-ILS/xul/staff_client/server/patron/items_overlay.xul b/Open-ILS/xul/staff_client/server/patron/items_overlay.xul index 76bbb7eece..d4afebd5ed 100644 --- a/Open-ILS/xul/staff_client/server/patron/items_overlay.xul +++ b/Open-ILS/xul/staff_client/server/patron/items_overlay.xul @@ -13,6 +13,8 @@ + + @@ -24,6 +26,8 @@ + + -- 2.11.0