lp1437103 Suppress Popups on Patron Items Out Checkin
authorKyle Huckins <khuckins@catalyte.io>
Wed, 26 Jun 2019 15:36:09 +0000 (15:36 +0000)
committerBill Erickson <berickxx@gmail.com>
Fri, 1 Nov 2019 19:37:59 +0000 (15:37 -0400)
- Make Patron Items Out UI respect Suppress Popups setting.

Signed-off-by: Kyle Huckins <khuckins@catalyte.io>
 Changes to be committed:
modified:   Open-ILS/web/js/ui/default/staff/circ/patron/items_out.js

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/web/js/ui/default/staff/circ/patron/items_out.js

index 327eeb5..96cc65c 100644 (file)
@@ -30,6 +30,12 @@ function($scope , $q , $routeParams , $timeout , egCore , egUser , patronSvc ,
 
     // list of alt circs (lost, etc.) and/or check-in with fines circs
     $scope.alt_list = []; 
+    
+    egCore.org.settings([
+        'ui.circ.suppress_checkin_popups' // add other settings as needed
+    ]).then(function(set) {
+        $scope.suppress_popups = set['ui.circ.suppress_checkin_popups'];
+    });
 
     // these are fetched during startup (i.e. .configure())
     // By default, show lost/lo/cr items in the alt list
@@ -511,26 +517,31 @@ function($scope , $q , $routeParams , $timeout , egCore , egUser , patronSvc ,
         if (!items.length) return;
         var copies = items.map(function(circ) { return circ.target_copy() });
         var barcodes = copies.map(function(copy) { return copy.barcode() });
-
-        return egConfirmDialog.open(
-            egCore.strings.CHECK_IN_CONFIRM, barcodes.join(' '), {
-
-        }).result.then(function() {
-            var copy;
-            function do_one() {
-                if (copy = copies.pop()) {
-                    // Checkin expects a barcode, but will pass other
-                    // parameters too.  Passing the copy ID allows
-                    // for the checkin of deleted copies on the server.
-                    egCirc.checkin(
-                        {copy_barcode: copy.barcode(), copy_id: copy.id()})
-                    .finally(do_one);
-                } else {
-                    reset_page();
-                }
+        
+        var copy;
+        function do_one() {
+            if (copy = copies.pop()) {
+                // Checkin expects a barcode, but will pass other
+                // parameters too.  Passing the copy ID allows
+                // for the checkin of deleted copies on the server.
+                egCirc.checkin(
+                    {copy_barcode: copy.barcode(), copy_id: copy.id()},
+                    {suppress_popups: $scope.suppress_popups})
+                .finally(do_one);
+            } else {
+                reset_page();
             }
-            do_one(); // kick it off
-        });
+        }
+        if ($scope.suppress_popups) {
+            do_one();
+        } else {
+            return egConfirmDialog.open(
+                egCore.strings.CHECK_IN_CONFIRM, barcodes.join(' '), {
+
+            }).result.then(function() {
+                do_one(); // kick it off
+            });
+        }
     }
 
     $scope.add_billing = function(items) {