From: Galen Charlton Date: Fri, 30 Jun 2017 20:39:21 +0000 (-0400) Subject: webstaff: have Quick Receive make operator select subscription rather than OU X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=7d3dbfe141e33bd51e83db451ad8713d64f0aa66;p=working%2FEvergreen.git webstaff: have Quick Receive make operator select subscription rather than OU Signed-off-by: Galen Charlton --- diff --git a/Open-ILS/src/templates/staff/cat/catalog/index.tt2 b/Open-ILS/src/templates/staff/cat/catalog/index.tt2 index f5178795b2..50a1f8f7bd 100644 --- a/Open-ILS/src/templates/staff/cat/catalog/index.tt2 +++ b/Open-ILS/src/templates/staff/cat/catalog/index.tt2 @@ -11,7 +11,9 @@ [% INCLUDE 'staff/serials/share/serials_strings.tt2' %] + + [% INCLUDE 'staff/cat/share/marcedit_strings.tt2' %] @@ -51,8 +53,8 @@ s.MARK_OVERLAY_TARGET = "[% l('Record Overlay Target set') %]"; - s.SERIALS_NO_SUBS = "[% l('No subscriptions at the selected library') %]"; - s.SERIALS_NO_ITEMS = "[% l('No items at the selected library') %]"; + s.SERIALS_NO_SUBS = "[% l('No subscription selected') %]"; + s.SERIALS_NO_ITEMS = "[% l('No items expected for the selected subscription') %]"; s.SERIALS_ISSUANCE_FAIL_SAVE = "[% l('Failed to save issuance') %]"; s.SERIALS_ISSUANCE_SUCCESS_SAVE = "[% l('Issuance saved') %]"; diff --git a/Open-ILS/src/templates/staff/share/t_subscription_select_dialog.tt2 b/Open-ILS/src/templates/staff/share/t_subscription_select_dialog.tt2 new file mode 100644 index 0000000000..eeea5d86a3 --- /dev/null +++ b/Open-ILS/src/templates/staff/share/t_subscription_select_dialog.tt2 @@ -0,0 +1,22 @@ + +
+ + + +
diff --git a/Open-ILS/web/js/ui/default/staff/cat/catalog/app.js b/Open-ILS/web/js/ui/default/staff/cat/catalog/app.js index 1fa43f0254..f6b813bacf 100644 --- a/Open-ILS/web/js/ui/default/staff/cat/catalog/app.js +++ b/Open-ILS/web/js/ui/default/staff/cat/catalog/app.js @@ -7,7 +7,7 @@ * */ -angular.module('egCatalogApp', ['ui.bootstrap','ngRoute','ngLocationUpdate','egCoreMod','egGridMod', 'egMarcMod', 'egUserMod', 'egHoldingsMod', 'ngToast', 'egSerialsMod']) +angular.module('egCatalogApp', ['ui.bootstrap','ngRoute','ngLocationUpdate','egCoreMod','egGridMod', 'egMarcMod', 'egUserMod', 'egHoldingsMod', 'ngToast', 'egSerialsMod', 'egSerialsAppDep']) .config(['ngToastProvider', function(ngToastProvider) { ngToastProvider.configure({ @@ -369,58 +369,53 @@ function($scope , $routeParams , $location , $window , $q , egCore , egHolds , e var list = []; var next_per_stream = {}; + var recId = $scope.record_id; return $uibModal.open({ - templateUrl: './share/t_org_select_dialog', + templateUrl: './share/t_subscription_select_dialog', controller: ['$scope', '$uibModalInstance', function($scope, $uibModalInstance) { $scope.focus = true; $scope.rememberMe = 'eg.serials.quickreceive.last_org'; + $scope.record_id = recId; + $scope.ssubId = null; - $scope.ok = function() { $uibModalInstance.close($scope.ws_ou.id()) } + $scope.ok = function() { $uibModalInstance.close($scope.ssubId) } $scope.cancel = function() { $uibModalInstance.dismiss(); } } ] - }).result.then(function(org) { - if (org) { - return egSerialsCoreSvc.fetch($scope.record_id, egCore.org.descendants(org, true)).then(function(sub_list){ - if (!sub_list.length) { - ngToast.warning(egCore.strings.SERIALS_NO_SUBS); - return $q.reject(); - } - - var promises = []; - angular.forEach(sub_list, function (sub) { - promises.push(egSerialsCoreSvc.fetchItemsForSub(sub.id(),{status:'Expected'}).then(function(){ - angular.forEach(egSerialsCoreSvc.itemTree, function (item) { - if (next_per_stream[item.stream().id()]) return; - if (item.status() == 'Expected') { - next_per_stream[item.stream().id()] = item; - list.push(egCore.idl.Clone(item)); - } - }); - })); + }).result.then(function(ssubId) { + if (ssubId) { + var promises = []; + promises.push(egSerialsCoreSvc.fetchItemsForSub(ssubId,{status:'Expected'}).then(function(){ + angular.forEach(egSerialsCoreSvc.itemTree, function (item) { + if (next_per_stream[item.stream().id()]) return; + if (item.status() == 'Expected') { + next_per_stream[item.stream().id()] = item; + list.push(egCore.idl.Clone(item)); + } }); + })); - return $q.all(promises).then(function() { + return $q.all(promises).then(function() { - if (!list.length) { - ngToast.warning(egCore.strings.SERIALS_NO_ITEMS); - return $q.reject(); - } + if (!list.length) { + ngToast.warning(egCore.strings.SERIALS_NO_ITEMS); + return $q.reject(); + } - return egSerialsCoreSvc.process_items( - 'receive', - $scope.record_id, - list, - true, // barcode - false,// bind - false, // print by default - function() { $scope.holdings_record_id_changed($scope.record_id) } - ); - }); + return egSerialsCoreSvc.process_items( + 'receive', + $scope.record_id, + list, + true, // barcode + false,// bind + false, // print by default + function() { $scope.holdings_record_id_changed($scope.record_id) } + ); }); } else { + ngToast.warning(egCore.strings.SERIALS_NO_SUBS); return $q.reject(); } });