webstaff: Item Status bugs with Transfer Items...
authorJason Etheridge <jason@equinoxinitiative.org>
Fri, 9 Jun 2017 14:11:21 +0000 (10:11 -0400)
committerGalen Charlton <gmc@equinoxinitiative.org>
Fri, 9 Jun 2017 19:31:17 +0000 (15:31 -0400)
...to Previously Marked Volume

Now it throws up the override dialog only if an ils event is returned,
and it doesn't prematurely refresh the screen or re-scan a barcode
while the dialog is open.

Signed-off-by: Jason Etheridge <jason@equinoxinitiative.org>
Signed-off-by: Andrea Neiman <abneiman@equinoxinitiative.org>
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Open-ILS/web/js/ui/default/staff/cat/item/app.js

index bada28c..48d2d82 100644 (file)
@@ -840,26 +840,32 @@ function(egCore , egCirc , $uibModal , $q , $timeout , $window , egConfirmDialog
             ).then(
                 function(resp) { // oncomplete
                     var evt = egCore.evt.parse(resp);
-                    egConfirmDialog.open(
-                        egCore.strings.OVERRIDE_TRANSFER_COPIES_TO_MARKED_VOLUME_TITLE,
-                        egCore.strings.OVERRIDE_TRANSFER_COPIES_TO_MARKED_VOLUME_BODY,
-                        {'evt_desc': evt}
-                    ).result.then(function() {
-                        egCore.net.request(
-                            'open-ils.cat',
-                            'open-ils.cat.transfer_copies_to_volume.override',
-                            egCore.auth.token(),
-                            xfer_target,
-                            copy_ids,
-                            { events: ['TITLE_LAST_COPY', 'COPY_DELETE_WARNING'] }
-                        );
-                    });
+                    console.log('evt',evt);
+                    if (evt) {
+                        egConfirmDialog.open(
+                            egCore.strings.OVERRIDE_TRANSFER_COPIES_TO_MARKED_VOLUME_TITLE,
+                            egCore.strings.OVERRIDE_TRANSFER_COPIES_TO_MARKED_VOLUME_BODY,
+                            {'evt_desc': evt}
+                        ).result.then(function() {
+                            egCore.net.request(
+                                'open-ils.cat',
+                                'open-ils.cat.transfer_copies_to_volume.override',
+                                egCore.auth.token(),
+                                xfer_target,
+                                copy_ids,
+                                { events: ['TITLE_LAST_COPY', 'COPY_DELETE_WARNING'] }
+                            );
+                        }).then(function() {
+                            angular.forEach(items, function(cp){service.add_barcode_to_list(cp.barcode)});
+                        });
+                    } else {
+                        angular.forEach(items, function(cp){service.add_barcode_to_list(cp.barcode)});
+                    }
+
                 },
                 null, // onerror
                 null // onprogress
-            ).then(function() {
-                    angular.forEach(items, function(cp){service.add_barcode_to_list(cp.barcode)});
-            });
+            );
         }
     }