webstaff: Special case for egOrgSelector value reading/writing in copy templates
authorMike Rylander <mrylander@gmail.com>
Mon, 28 Sep 2015 14:41:29 +0000 (10:41 -0400)
committerKathy Lussier <klussier@masslnc.org>
Tue, 2 Feb 2016 19:58:47 +0000 (14:58 -0500)
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>

Open-ILS/web/js/ui/default/staff/cat/volcopy/app.js

index f922cd6..d38cdd7 100644 (file)
@@ -846,7 +846,9 @@ function($scope , $q , $window , $routeParams , $location , $timeout , egCore ,
 
          $scope.applyTemplate = function (n) {
             angular.forEach($scope.templates[n], function (v,k) {
-                if (!angular.isObject(v)) {
+                if (k == 'circ_lib') {
+                    $scope.working[k] = egCore.org.get(v);
+                } else if (!angular.isObject(v)) {
                     $scope.working[k] = angular.copy(v);
                 } else {
                     angular.forEach(v, function (sv,sk) {
@@ -1446,7 +1448,9 @@ function($scope , $q , $window , $routeParams , $location , $timeout , egCore ,
             
                 $scope.applyTemplate = function (n) {
                     angular.forEach($scope.templates[n], function (v,k) {
-                        if (!angular.isObject(v)) {
+                        if (k == 'circ_lib') {
+                            $scope.working[k] = egCore.org.get(v);
+                        } else if (!angular.isObject(v)) {
                             $scope.working[k] = angular.copy(v);
                         } else {
                             angular.forEach(v, function (sv,sk) {
@@ -1621,7 +1625,6 @@ function($scope , $q , $window , $routeParams , $location , $timeout , egCore ,
                 });
                 createSimpleUpdateWatcher('age_protect');
             
-                createSimpleUpdateWatcher('circ_lib');
                 createSimpleUpdateWatcher('circulate');
                 createSimpleUpdateWatcher('holdable');
                 createSimpleUpdateWatcher('fine_level');