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)
committerChris Sharp <csharp@georgialibraries.org>
Wed, 19 Aug 2020 15:07:36 +0000 (11:07 -0400)
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 8a4295f..3a82e54 100644 (file)
@@ -1218,6 +1218,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);
@@ -1242,6 +1243,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);
@@ -2290,6 +2292,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);