From e5f7e85b57d9bcd255427c3305f9ef0ecd98f72b Mon Sep 17 00:00:00 2001 From: Jason Etheridge Date: Tue, 8 Mar 2011 16:14:22 -0500 Subject: [PATCH] prevent edits to the owning lib from the item attribute editor if embedded in the unified interface --- Open-ILS/xul/staff_client/server/cat/copy_editor.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 116a21c99d..bb8275c7fc 100644 --- a/Open-ILS/xul/staff_client/server/cat/copy_editor.js +++ b/Open-ILS/xul/staff_client/server/cat/copy_editor.js @@ -521,6 +521,8 @@ g.apply_stat_cat = function(sc_id,entry_id) { g.apply_owning_lib = function(ou_id) { g.error.sdump('D_TRACE','ou_id = ' + ou_id + '\n'); + // but don't allow this when bundled with the volume/copy creator UI, or if we're editing pre-cats + if (! g.safe_to_change_owning_lib() ) { return; } for (var i = 0; i < g.copies.length; i++) { var copy = g.copies[i]; try { @@ -552,10 +554,11 @@ g.apply_owning_lib = function(ou_id) { } /******************************************************************************************************/ -/* This returns true if none of the copies being edited are pre-cats */ +/* This returns false if any of the copies being edited are pre-cats, or if we're embedded in the unified volume/copy UI */ g.safe_to_change_owning_lib = function() { try { + if (xulG.unified_interface) { return false; } var safe = true; for (var i = 0; i < g.copies.length; i++) { var cn = g.copies[i].call_number(); -- 2.11.0