fixes Edit Volumes action by flattening the volume objects before updating them
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 18 Apr 2011 15:37:12 +0000 (15:37 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 18 Apr 2011 15:37:12 +0000 (15:37 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@20158 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/server/cat/util.js

index b90453f..fe87355 100644 (file)
@@ -693,6 +693,13 @@ cat.util.batch_edit_volumes = function(fleshed_volumes) {
 
         if (volumes.length < 1) { return false; }
 
+        volumes = util.functional.map_list( volumes, function(o){
+            if (typeof o.suffix() == 'object') { o.suffix( o.suffix().id() ); }
+            if (typeof o.prefix() == 'object') { o.prefix( o.prefix().id() ); }
+            if (typeof o.label_class() == 'object') { o.label_class( o.label_class().id() ); }
+            return o;
+        });
+
         var r = net.simple_request(
             'FM_ACN_TREE_UPDATE',
             [ ses(), volumes, false, { 'auto_merge_vols' : my_xulG.auto_merge } ],