prevent edits to the owning lib from the item attribute editor if embedded in the...
authorJason Etheridge <jason@esilibrary.com>
Tue, 8 Mar 2011 21:14:22 +0000 (16:14 -0500)
committerJason Etheridge <jason@esilibrary.com>
Tue, 8 Mar 2011 21:14:22 +0000 (16:14 -0500)
Open-ILS/xul/staff_client/server/cat/copy_editor.js

index 116a21c..bb8275c 100644 (file)
@@ -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();