persist partial changes to new copies in vol/copy editor has new copies are gathered.
authorJason Etheridge <jason@esilibrary.com>
Mon, 16 May 2011 16:12:40 +0000 (12:12 -0400)
committerJason Etheridge <jason@esilibrary.com>
Mon, 16 May 2011 16:20:32 +0000 (12:20 -0400)
In other words, you can do something like enter 5 in the "# of Copies" field, enter the first barcode (say b1), edit an attribute (say, set Circulate = No), and then enter a second barcode (b2).  Previously, the changes made to b1 would be lost as b2 was entered (or as other movement around the barcode entry textboxes happened) and both copies would get a Circulate = Yes, but now in this scenario, you would see 1 copy set to No and 1 copy set to Yes for the Circulate attribute.

Signed-off-by: Jason Etheridge <jason@esilibrary.com>

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

index 9656044..1aea205 100644 (file)
@@ -875,6 +875,9 @@ g.gather_copies = function() {
 
         for (var i = 0; i < barcodes.length; i++) {
             var acp_id = barcodes[i].getAttribute('acp_id') || g.new_acp_id--;
+            if (acp_id < 0) {
+                barcodes[i].setAttribute('acp_id',acp_id);
+            }
             var ou_id = barcodes[i].getAttribute('ou_id');
             var callnumber_composite_key = barcodes[i].getAttribute('callkey');
             var barcode = barcodes[i].value;