From 7ec68e1a739fd055b0b8b98d8ae3ce90c826e004 Mon Sep 17 00:00:00 2001 From: phasefx Date: Thu, 7 Jan 2010 21:17:03 +0000 Subject: [PATCH] Bucket related enhancements: * Add to Record Bucket action for Item Status interface * Authoritative methods in bucket interfaces immune to database replication lag * Removed a CGI param for better caching of the quick Add to Record Bucket interface * Added a cat.util.add_titles_to_bucket utility method (but forgot to put it into cat.util.EXPORT_OK, though harmless) git-svn-id: svn://svn.open-ils.org/ILS/trunk@15271 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../src/perlmods/OpenILS/Application/Actor/Container.pm | 2 ++ Open-ILS/web/opac/locale/en-US/lang.dtd | 2 ++ Open-ILS/xul/staff_client/chrome/content/cat/opac.js | 8 +++++--- .../xul/staff_client/chrome/content/main/constants.js | 4 ++-- .../xul/staff_client/server/cat/record_buckets_quick.xul | 3 ++- Open-ILS/xul/staff_client/server/cat/util.js | 12 ++++++++++++ Open-ILS/xul/staff_client/server/circ/copy_status.js | 15 +++++++++++++++ Open-ILS/xul/staff_client/server/circ/copy_status.xul | 1 + .../xul/staff_client/server/circ/copy_status_overlay.xul | 4 ++++ 9 files changed, 45 insertions(+), 6 deletions(-) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Actor/Container.pm b/Open-ILS/src/perlmods/OpenILS/Application/Actor/Container.pm index 6d86372f71..c3d85d0fca 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Actor/Container.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Actor/Container.pm @@ -37,6 +37,7 @@ sub _sort_buckets { __PACKAGE__->register_method( method => "bucket_retrieve_all", api_name => "open-ils.actor.container.all.retrieve_by_user", + authoritative => 1, notes => <<" NOTES"); Retrieves all un-fleshed buckets assigned to given user PARAMS(authtoken, bucketOwnerId) @@ -65,6 +66,7 @@ sub bucket_retrieve_all { __PACKAGE__->register_method( method => "bucket_flesh", api_name => "open-ils.actor.container.flesh", + authoritative => 1, argc => 3, ); diff --git a/Open-ILS/web/opac/locale/en-US/lang.dtd b/Open-ILS/web/opac/locale/en-US/lang.dtd index 1f34e80e18..0a3063488c 100644 --- a/Open-ILS/web/opac/locale/en-US/lang.dtd +++ b/Open-ILS/web/opac/locale/en-US/lang.dtd @@ -1949,6 +1949,8 @@ + + diff --git a/Open-ILS/xul/staff_client/chrome/content/cat/opac.js b/Open-ILS/xul/staff_client/chrome/content/cat/opac.js index 133e6c5363..7875502497 100644 --- a/Open-ILS/xul/staff_client/chrome/content/cat/opac.js +++ b/Open-ILS/xul/staff_client/chrome/content/cat/opac.js @@ -249,10 +249,12 @@ function remove_me() { function add_to_bucket() { JSAN.use('util.window'); var win = new util.window(); win.open( - xulG.url_prefix(urls.XUL_RECORD_BUCKETS_QUICK) - + '?record_ids=' + js2JSON( [ docid ] ), + xulG.url_prefix(urls.XUL_RECORD_BUCKETS_QUICK), 'sel_bucket_win' + win.window_name_increment(), - 'chrome,resizable,modal,center' + 'chrome,resizable,modal,center', + { + record_ids: [ docid ] + } ); } diff --git a/Open-ILS/xul/staff_client/chrome/content/main/constants.js b/Open-ILS/xul/staff_client/chrome/content/main/constants.js index e5f039178b..9fe17d3c6b 100644 --- a/Open-ILS/xul/staff_client/chrome/content/main/constants.js +++ b/Open-ILS/xul/staff_client/chrome/content/main/constants.js @@ -53,9 +53,9 @@ const api = { 'BLOB_MOBTS_CIRC_MVR_OPEN' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.user.transactions.fleshed' }, 'BLOB_BALANCE_OWED_VIA_USERGROUP' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.usergroup.members.balance_owed.authoritative' }, 'BUCKET_CREATE' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.container.create' }, - 'BUCKET_FLESH' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.container.flesh' }, + 'BUCKET_FLESH' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.container.flesh.authoritative' }, 'BUCKET_DELETE' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.container.full_delete' }, - 'BUCKET_RETRIEVE_VIA_USER' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.container.all.retrieve_by_user' }, + 'BUCKET_RETRIEVE_VIA_USER' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.container.all.retrieve_by_user.authoritative' }, 'BUCKET_ITEM_CREATE' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.container.item.create' }, 'BUCKET_ITEM_DELETE' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.container.item.delete' }, 'CAPTURE_COPY_FOR_HOLD_VIA_BARCODE' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.hold.capture_copy.barcode' }, diff --git a/Open-ILS/xul/staff_client/server/cat/record_buckets_quick.xul b/Open-ILS/xul/staff_client/server/cat/record_buckets_quick.xul index b7331c2cfe..e1ffdeee0e 100644 --- a/Open-ILS/xul/staff_client/server/cat/record_buckets_quick.xul +++ b/Open-ILS/xul/staff_client/server/cat/record_buckets_quick.xul @@ -47,10 +47,11 @@ g.record_ids = xul_param( 'record_ids',{ 'concat' : true, + 'modal_xulG' : true, 'JSON2js_if_cgi' : true, 'JSON2js_if_xpcom' : true, 'stash_name':'rb_temp_record_ids', - 'clear_xpcom' : true, + 'clear_xpcom' : true } ); diff --git a/Open-ILS/xul/staff_client/server/cat/util.js b/Open-ILS/xul/staff_client/server/cat/util.js index 26329542fd..4fb5e10fdc 100644 --- a/Open-ILS/xul/staff_client/server/cat/util.js +++ b/Open-ILS/xul/staff_client/server/cat/util.js @@ -239,6 +239,18 @@ cat.util.add_copies_to_bucket = function(selection_list) { ); } +cat.util.add_titles_to_bucket = function(record_ids) { + JSAN.use('util.window'); var win = new util.window(); + win.open( + xulG.url_prefix(urls.XUL_RECORD_BUCKETS_QUICK), + 'sel_bucket_win' + win.window_name_increment(), + 'chrome,resizable,modal,center', + { + record_ids: record_ids + } + ); +} + cat.util.spawn_copy_editor = function(params) { try { if (!params.copy_ids && !params.copies) return; 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 e2271d4f3a..d4ddb89b91 100644 --- a/Open-ILS/xul/staff_client/server/circ/copy_status.js +++ b/Open-ILS/xul/staff_client/server/circ/copy_status.js @@ -59,6 +59,7 @@ circ.copy_status.prototype = { obj.controller.view.sel_edit.setAttribute('disabled','true'); obj.controller.view.sel_opac.setAttribute('disabled','true'); obj.controller.view.sel_bucket.setAttribute('disabled','true'); + obj.controller.view.sel_record_bucket.setAttribute('disabled','true'); obj.controller.view.sel_copy_details.setAttribute('disabled','true'); obj.controller.view.sel_mark_items_damaged.setAttribute('disabled','true'); obj.controller.view.sel_mark_items_missing.setAttribute('disabled','true'); @@ -87,6 +88,7 @@ circ.copy_status.prototype = { obj.controller.view.sel_patron.setAttribute('disabled','false'); obj.controller.view.cmd_triggered_events.setAttribute('disabled','false'); obj.controller.view.sel_bucket.setAttribute('disabled','false'); + obj.controller.view.sel_record_bucket.setAttribute('disabled','false'); obj.controller.view.sel_copy_details.setAttribute('disabled','false'); obj.controller.view.sel_mark_items_damaged.setAttribute('disabled','false'); obj.controller.view.sel_mark_items_missing.setAttribute('disabled','false'); @@ -380,6 +382,19 @@ circ.copy_status.prototype = { cat.util.add_copies_to_bucket(obj.selection_list); } ], + 'sel_record_bucket' : [ + ['command'], + function() { + JSAN.use('cat.util'); JSAN.use('util.functional'); + cat.util.add_titles_to_bucket( + util.functional.map_list( + obj.selection_list, function (o) { + return o.doc_id; + } + ) + ); + } + ], 'copy_status_barcode_entry_textbox' : [ ['keypress'], function(ev) { 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 fdb1433bff..aa955fe5bf 100644 --- a/Open-ILS/xul/staff_client/server/circ/copy_status.xul +++ b/Open-ILS/xul/staff_client/server/circ/copy_status.xul @@ -126,6 +126,7 @@ + diff --git a/Open-ILS/xul/staff_client/server/circ/copy_status_overlay.xul b/Open-ILS/xul/staff_client/server/circ/copy_status_overlay.xul index 5b8586df91..8036a67ae5 100644 --- a/Open-ILS/xul/staff_client/server/circ/copy_status_overlay.xul +++ b/Open-ILS/xul/staff_client/server/circ/copy_status_overlay.xul @@ -13,6 +13,7 @@ + @@ -42,6 +43,7 @@ + @@ -117,6 +119,7 @@ + @@ -148,6 +151,7 @@ + -- 2.11.0