LP 1437103 user/vlewis/lp1437103-unexpected_popup_dialogues_at_checkin
authorVictoria Lewis <vlewis@catalystitservices.com>
Mon, 10 Aug 2015 17:09:43 +0000 (10:09 -0700)
committerVictoria Lewis <vlewis@catalystitservices.com>
Mon, 17 Aug 2015 16:14:36 +0000 (09:14 -0700)
Add code to suppress popups on checkin.

Signed-off-by: Victoria Lewis <vlewis@catalystitservices.com>
Signed-off-by: Victoria Lewis <vlewis@catalystitservices.com>
Open-ILS/web/js/ui/default/staff/circ/checkin/app.js
Open-ILS/web/js/ui/default/staff/circ/patron/items_out.js
Open-ILS/web/js/ui/default/staff/circ/services/circ.js

index d0407c6..8b5eb0c 100644 (file)
@@ -152,7 +152,8 @@ function($scope , $q , $window , $location , egCore , checkinSvc , egGridDataPro
             no_precat_alert : $scope.modifiers.no_precat_alert,
             auto_print_holds_transits : 
                 $scope.modifiers.auto_print_holds_transits,
-            suppress_popups : suppress_popups
+            suppress_popups : suppress_popups,
+            suppress_checkin_popups : suppress_popups
         };
 
         return {params : params, options: options};
index f8f4dd8..67d8546 100644 (file)
@@ -418,7 +418,17 @@ function($scope,  $q,  $routeParams,  egCore , egUser,  patronSvc ,
         }).result;
     }
 
+
+    var suppress_popups = false;
+    egCore.org.settings([
+        'ui.circ.suppress_checkin_popups' // add other settings as needed
+    ]).then(function(set) {
+        suppress_popups = set['ui.circ.suppress_checkin_popups'];
+    });
+
     $scope.checkin = function(items) {
+    var options = {suppress_popups : suppress_popups,
+                   suppress_checkin_popups : suppress_popups};
         if (!items.length) return;
         var barcodes = items.map(function(circ) 
             { return circ.target_copy().barcode() });
@@ -429,7 +439,7 @@ function($scope,  $q,  $routeParams,  egCore , egUser,  patronSvc ,
         }).result.then(function() {
             function do_one() {
                 if (bc = barcodes.pop()) {
-                    egCirc.checkin({copy_barcode : bc})
+                    egCirc.checkin({copy_barcode : bc}, options)
                     .finally(do_one);
                 } else {
                     reset_page();
index eea4a18..ccd0bfd 100644 (file)
@@ -1373,28 +1373,29 @@ function($modal , $q , egCore , egAlertDialog , egConfirmDialog) {
             if (options.auto_print_holds_transits) 
                 return print_transit();
 
-            return $modal.open({
-                templateUrl: tmpl,
-                controller: [
+            if(!options.suppress_popups){
+                return $modal.open({
+                    templateUrl: tmpl,
+                    controller: [
                             '$scope','$modalInstance',
                     function($scope , $modalInstance) {
+                        $scope.today = new Date();
 
-                    $scope.today = new Date();
-
-                    // copy the print scope into the dialog scope
-                    angular.forEach(print_context, function(val, key) {
-                        $scope[key] = val;
-                    });
+                        // copy the print scope into the dialog scope
+                        angular.forEach(print_context, function(val, key) {
+                            $scope[key] = val;
+                        });
 
-                    $scope.ok = function() {$modalInstance.close()}
+                        $scope.ok = function() {$modalInstance.close()}
 
-                    $scope.print = function() { 
-                        $modalInstance.close();
-                        print_transit();
-                    }
-                }]
+                        $scope.print = function() {
+                            $modalInstance.close();
+                            print_transit();
+                        }
+                    }]
 
-            }).result;
+                }).result;
+            } else {return};
         });
     }