webstaff: Update all instances of the call number, mainly for copy display
authorMike Rylander <mrylander@gmail.com>
Tue, 18 Aug 2015 21:53:48 +0000 (17:53 -0400)
committerJason Stephenson <jstephenson@mvlc.org>
Mon, 14 Sep 2015 19:44:15 +0000 (15:44 -0400)
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js

index 5127c4f..33c1928 100644 (file)
@@ -279,26 +279,46 @@ function(egCore , $q) {
                 itemSvc.get_suffixes($scope.callNumber.owning_lib()).then(function(list){
                     $scope.suffix_list = list;
                 });
-                $scope.updateSuffix = function () { $scope.callNumber.suffix($scope.suffix); $scope.callNumber.ischanged(1); };
+                $scope.updateSuffix = function () {
+                    angular.forEach($scope.copies, function(cp) {
+                        cp.call_number().suffix($scope.suffix);
+                        cp.call_number().ischanged(1);
+                    });
+                }
 
                 $scope.prefix_list = [];
                 itemSvc.get_prefixes($scope.callNumber.owning_lib()).then(function(list){
                     $scope.prefix_list = list;
                 });
-                $scope.updatePrefix = function () { $scope.callNumber.prefix($scope.prefix); $scope.callNumber.ischanged(1); };
+                $scope.updatePrefix = function () {
+                    angular.forEach($scope.copies, function(cp) {
+                        cp.call_number().prefix($scope.prefix);
+                        cp.call_number().ischanged(1);
+                    });
+                }
 
                 $scope.classification_list = [];
                 itemSvc.get_classifications().then(function(list){
                     $scope.classification_list = list;
                 });
-                $scope.updateClassification = function () { $scope.callNumber.label_class($scope.classification); $scope.callNumber.ischanged(1); };
+                $scope.updateClassification = function () {
+                    angular.forEach($scope.copies, function(cp) {
+                        cp.call_number().label_class($scope.classification);
+                        cp.call_number().ischanged(1);
+                    });
+                }
 
                 $scope.classification = $scope.callNumber.label_class();
                 $scope.prefix = $scope.callNumber.prefix();
                 $scope.suffix = $scope.callNumber.suffix();
 
                 $scope.label = $scope.callNumber.label();
-                $scope.updateLabel = function () { $scope.callNumber.label($scope.label); $scope.callNumber.ischanged(1); };
+                $scope.updateLabel = function () {
+                    angular.forEach($scope.copies, function(cp) {
+                        cp.call_number().label($scope.label);
+                        cp.call_number().ischanged(1);
+                    });
+                }
 
                 $scope.copy_count = $scope.copies.length;
                 $scope.orig_copy_count = $scope.copy_count;