From: Mike Rylander Date: Wed, 5 Jul 2017 19:34:48 +0000 (-0400) Subject: serials: Locally remember values given for stream routing destinations X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=5a66742020a9bba183876c3b338e784079b183a1;p=working%2FEvergreen.git serials: Locally remember values given for stream routing destinations Signed-off-by: Mike Rylander --- diff --git a/Open-ILS/src/templates/staff/serials/t_subscription_manager.tt2 b/Open-ILS/src/templates/staff/serials/t_subscription_manager.tt2 index b761b0830d..d96a52d3c5 100644 --- a/Open-ILS/src/templates/staff/serials/t_subscription_manager.tt2 +++ b/Open-ILS/src/templates/staff/serials/t_subscription_manager.tt2 @@ -71,7 +71,7 @@
- +
diff --git a/Open-ILS/web/js/ui/default/staff/serials/directives/subscription_manager.js b/Open-ILS/web/js/ui/default/staff/serials/directives/subscription_manager.js index 5fe407794e..7bd1d98f5d 100644 --- a/Open-ILS/web/js/ui/default/staff/serials/directives/subscription_manager.js +++ b/Open-ILS/web/js/ui/default/staff/serials/directives/subscription_manager.js @@ -31,6 +31,12 @@ function($scope , $q , egSerialsCoreSvc , egCore , egGridDataProvider , } reload(); + $scope.localStreamNames = []; + egCore.hatch.getItem('eg.serials.stream_names') + .then(function(list) { + if (list) $scope.localStreamNames = list; + }); + $scope.distStreamGridControls = { activateItem : function (item) { } // TODO }; @@ -84,6 +90,17 @@ function($scope , $q , egSerialsCoreSvc , egCore , egGridDataProvider , reload(); form.$setPristine(); } + function updateLocalStreamNames (new_name) { + if (new_name && $scope.localStreamNames.filter(function(x){ return x == new_name}).length == 0) { + $scope.localStreamNames.push(new_name); + egCore.hatch.setItem('eg.serials.stream_names', $scope.localStreamNames) + } + } + + $scope.dirtyForm = function () { + $scope.ssubform.$dirty = true; + } + $scope.save_subscriptions = function(form) { // traverse through structure and set _ischanged // TODO add more granular dirty input detection @@ -93,6 +110,7 @@ function($scope , $q , egSerialsCoreSvc , egCore , egGridDataProvider , if (!sdist._isnew) sdist._ischanged = true; angular.forEach(sdist.streams, function(sstr) { if (!sstr._isnew) sstr._ischanged = true; + updateLocalStreamNames(sstr.routing_label); }); }); });