LP1832735 - Allow copy alerts to be applied to multiple copies
authorJosh Stompro <stompro@stompro.org>
Fri, 8 Nov 2019 04:00:21 +0000 (22:00 -0600)
committerJane Sandberg <sandbej@linnbenton.edu>
Wed, 22 Jan 2020 23:31:34 +0000 (15:31 -0800)
Signed-off-by: Josh Stompro <stompro@stompro.org>
Signed-off-by: Beth Willis <willis@noblenet.org>
Signed-off-by: Jane Sandberg <sandbej@linnbenton.edu>
Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js

index 20b819e..f19c4c9 100644 (file)
@@ -1229,6 +1229,7 @@ function($scope , $q , $window , $routeParams , $location , $timeout , egCore ,
                 angular.forEach(
                     $scope.workingGridControls.selectedItems(),
                     function (cp) {
+                        if (!angular.isArray(cp.copy_alerts())) cp.copy_alerts([]);
                         $scope.dirty = true;
                         angular.forEach(alerts, function(alrt) {
                             var a = egCore.idl.fromHash('aca', alrt);
@@ -1253,6 +1254,7 @@ function($scope , $q , $window , $routeParams , $location , $timeout , egCore ,
             angular.forEach(
                 $scope.workingGridControls.selectedItems(),
                 function (cp) {
+                    if (!angular.isArray(cp.notes())) cp.notes([]);
                     $scope.dirty = true;
                     angular.forEach(notes, function(note) {
                         var n = egCore.idl.fromHash('acpn', note);
@@ -2301,6 +2303,7 @@ function($scope , $q , $window , $routeParams , $location , $timeout , egCore ,
                     if (typeof(copy_alert.note) != 'undefined' &&
                         copy_alert.note != '') {
                         angular.forEach(copy_list, function (cp) {
+                            if (!angular.isArray(cp.copy_alerts())) cp.copy_alerts([]);
                             var a = new egCore.idl.aca();
                             a.isnew(1);
                             a.create_staff(copy_alert.create_staff);