From: Jason Etheridge Date: Tue, 24 Apr 2012 20:54:20 +0000 (-0400) Subject: Admin -> Local Admin -> Item Attribute Editor X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=91f8a82745d3a7c88fd975d722914ec165485a23;p=working%2FEvergreen.git Admin -> Local Admin -> Item Attribute Editor Main purpose is to allow you to spawn the Item Attribute Editor for the purpose of configuring templates and using the Hide Fields feature without actually finding an item to work and putting it at risk of accidental modification. Signed-off-by: Jason Etheridge Signed-off-by: Jason Stephenson --- diff --git a/Open-ILS/web/opac/locale/en-US/lang.dtd b/Open-ILS/web/opac/locale/en-US/lang.dtd index 8180820806..65949279f5 100644 --- a/Open-ILS/web/opac/locale/en-US/lang.dtd +++ b/Open-ILS/web/opac/locale/en-US/lang.dtd @@ -735,6 +735,8 @@ + + diff --git a/Open-ILS/xul/staff_client/chrome/content/main/menu.js b/Open-ILS/xul/staff_client/chrome/content/main/menu.js index f3c02228d1..5499ba58ec 100644 --- a/Open-ILS/xul/staff_client/chrome/content/main/menu.js +++ b/Open-ILS/xul/staff_client/chrome/content/main/menu.js @@ -834,6 +834,17 @@ main.menu.prototype = { open_eg_web_page("conify/global/asset/copy_template"); } ], + "cmd_local_admin_item_attribute_editor": [ + ["oncommand"], + function(event) { + obj.command_tab( + event, + urls.XUL_COPY_EDITOR, + { 'tab_name' : offlineStrings.getString('menu.local_admin.item_attribute_editor.tab') }, + { 'admin' : true, 'not_modal' : true } + ); + } + ], 'cmd_local_admin_patrons_due_refunds' : [ ['oncommand'], function(event) { diff --git a/Open-ILS/xul/staff_client/chrome/content/main/menu_frame_menus.xul b/Open-ILS/xul/staff_client/chrome/content/main/menu_frame_menus.xul index 836d2b3344..e763c82ed3 100644 --- a/Open-ILS/xul/staff_client/chrome/content/main/menu_frame_menus.xul +++ b/Open-ILS/xul/staff_client/chrome/content/main/menu_frame_menus.xul @@ -149,6 +149,7 @@ + + diff --git a/Open-ILS/xul/staff_client/chrome/locale/en-US/offline.properties b/Open-ILS/xul/staff_client/chrome/locale/en-US/offline.properties index 5a5b0c474b..68faca44f5 100644 --- a/Open-ILS/xul/staff_client/chrome/locale/en-US/offline.properties +++ b/Open-ILS/xul/staff_client/chrome/locale/en-US/offline.properties @@ -260,6 +260,7 @@ menu.cmd_authority_manage.tab=Manage Authorities menu.local_admin.barcode_completion.tab=Barcode Completion menu.local_admin.circ_matrix_matchpoint.tab=Circulation Policies menu.local_admin.hold_matrix_matchpoint.tab=Hold Policies +menu.local_admin.item_attribute_editor.tab=Admin Item Attribute Editor menu.local_admin.work_log.tab=Work Log menu.local_admin.patrons_due_refunds.tab=Patrons With Negative Balances menu.circulation.staged_patrons.tab=Pending Patrons diff --git a/Open-ILS/xul/staff_client/server/cat/copy_editor.js b/Open-ILS/xul/staff_client/server/cat/copy_editor.js index f4af66073d..f6088a50f7 100644 --- a/Open-ILS/xul/staff_client/server/cat/copy_editor.js +++ b/Open-ILS/xul/staff_client/server/cat/copy_editor.js @@ -53,6 +53,36 @@ function my_init() { g.callnumbers = xul_param('callnumbers',{'concat':true,'JSON2js_if_cgi':true,'JSON2js_if_xpcom':true,'stash_name':'temp_callnumbers','clear_xpcom':true,'modal_xulG':true}); /******************************************************************************************************/ + /* If invoked from the Local Admin menu, rig up a fake item and disable save/create functionality */ + + if (xulG.admin) { + xulG.edit = 1; + var fake_item = new acp(); + fake_item.id( -1 ); + fake_item.barcode( 'fake_item' ); + fake_item.call_number( -1 ); + fake_item.circ_lib(ses('ws_ou')); + /* FIXME -- use constants; really, refactor this into a library somewhere that can be used by chrome and + remote xul for new copies */ + fake_item.deposit(0); + fake_item.price(0); + fake_item.deposit_amount(0); + fake_item.fine_level(2); // Normal + fake_item.loan_duration(2); // Normal + fake_item.location(1); // Stacks + fake_item.status(0); + fake_item.circulate(get_db_true()); + fake_item.holdable(get_db_true()); + fake_item.opac_visible(get_db_true()); + fake_item.ref(get_db_false()); + fake_item.mint_condition(get_db_true()); + g.copies = [ fake_item ]; + $('save').hidden = true; + $('save').disabled = true; + $('non_unified_buttons').hidden = true; + } + + /******************************************************************************************************/ /* Get preference (if it exists) for copy location label order */ g.cl_first = false; // Default to legacy OU first mode @@ -611,10 +641,15 @@ g.apply_owning_lib = function(ou_id) { g.map_acn[copy.call_number()] = volume; } var old_volume = g.map_acn[copy.call_number()]; - var acn_blob = g.network.simple_request( - 'FM_ACN_FIND_OR_CREATE', - [ses(),old_volume.label(),old_volume.record(),ou_id,old_volume.prefix().id(),old_volume.suffix().id(),old_volume.label_class().id()] - ); + var acn_blob; + if (! xulG.admin) { + acn_blob = g.network.simple_request( + 'FM_ACN_FIND_OR_CREATE', + [ses(),old_volume.label(),old_volume.record(),ou_id,old_volume.prefix().id(),old_volume.suffix().id(),old_volume.label_class().id()] + ); + } else { + acn_blob = { 'acn_id' : -1 }; // spawned from Local Admin menu, so fake item and call number + } if (typeof acn_blob.ilsevent != 'undefined') { g.error.standard_unexpected_error_alert($('catStrings').getFormattedString('staff.cat.copy_editor.apply_owning_lib.call_number.error', [copy.barcode()]), acn_blob); continue; @@ -635,6 +670,7 @@ g.apply_owning_lib = function(ou_id) { g.safe_to_change_owning_lib = function() { try { if (xulG.unified_interface) { return false; } + if (xulG.admin) { return false; } var safe = true; for (var i = 0; i < g.copies.length; i++) { var cn = g.copies[i].call_number();