From: Mike Rylander Date: Wed, 2 Aug 2017 16:21:45 +0000 (-0400) Subject: serials: Display alert notes at receive time X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=3675300b75276a2cd7a8f9cd7344bcccb7a6281b;p=working%2FEvergreen.git serials: Display alert notes at receive time Signed-off-by: Mike Rylander --- diff --git a/Open-ILS/src/templates/staff/serials/index.tt2 b/Open-ILS/src/templates/staff/serials/index.tt2 index 040bc21e62..e00e4e7279 100644 --- a/Open-ILS/src/templates/staff/serials/index.tt2 +++ b/Open-ILS/src/templates/staff/serials/index.tt2 @@ -58,15 +58,10 @@ angular.module('egCoreMod').run(['egStrings', function(s) { s.CONFIRM_DELETE_SCAP_MESSAGE = "[% l('Will delete the prediction pattern if there are no attached issuances.') %]"; s.CONFIRM_CHANGE_ITEMS = {}; - s.CONFIRM_CHANGE_ITEMS_MESSAGE = {}; s.CONFIRM_CHANGE_ITEMS.delete = "[% l('Delete selected item(s)?') %]"; - s.CONFIRM_CHANGE_ITEMS_MESSAGE.delete = "[% l('Will delete {{items}} item(s).') %]"; s.CONFIRM_CHANGE_ITEMS.reset = "[% l('Reset selected items?') %]" - s.CONFIRM_CHANGE_ITEMS_MESSAGE.reset = "[% l('Will reset {{items}} item(s) to Expected and remove unit(s).') %]"; s.CONFIRM_CHANGE_ITEMS.receive = "[% l('Receive selected items?') %]" - s.CONFIRM_CHANGE_ITEMS_MESSAGE.receive = "[% l('Will receive {{items}} item(s) without barcoding.') %]"; s.CONFIRM_CHANGE_ITEMS.status = "[% l('Change status selected items?') %]" - s.CONFIRM_CHANGE_ITEMS_MESSAGE.status = "[% l('Will change status of {{items}} item(s).') %]"; s.CONFIRM_DELETE_MFHDS = "[% l('Delete selected MFHD(s)?') %]"; s.CONFIRM_DELETE_MFHDS_MESSAGE = "[% l('Will delete {{items}} MFHD(s).') %]"; diff --git a/Open-ILS/src/templates/staff/serials/t_batch_receive.tt2 b/Open-ILS/src/templates/staff/serials/t_batch_receive.tt2 index d688669131..cec2820355 100644 --- a/Open-ILS/src/templates/staff/serials/t_batch_receive.tt2 +++ b/Open-ILS/src/templates/staff/serials/t_batch_receive.tt2 @@ -39,7 +39,7 @@
[% l('Library : Distribution/Stream') %]
-
[% l('Item notes') %]
+
[% l('Notes') %]
[% l('Issuance') %] @@ -105,9 +105,23 @@
{{item.stream().distribution().holding_lib().name()}}: {{item.stream().distribution().label()}}/{{item.stream().routing_label()}}
+
+
+
{{note.title()}}
+
{{note.value()}}
+
+
+
+
+
{{note.title()}}
+
{{note.value()}}
+
+
-
{{note.title()}}
-
{{note.value()}}
+
+
{{note.title()}}
+
{{note.value()}}
+
diff --git a/Open-ILS/web/js/ui/default/staff/serials/services/core.js b/Open-ILS/web/js/ui/default/staff/serials/services/core.js index d7012b8bd8..5fe4756834 100644 --- a/Open-ILS/web/js/ui/default/staff/serials/services/core.js +++ b/Open-ILS/web/js/ui/default/staff/serials/services/core.js @@ -815,6 +815,31 @@ function(egCore , orderByFilter , $q , $filter , $uibModal , ngToast , egConfirm var deferred = $q.defer(); var current_promise = deferred.promise; var last_promise; + + var sitem_alerts = []; + var sdist_alerts = []; + var ssub_alerts = list[0].stream().distribution().subscription().notes().filter(function(n){ + return n.alert() == 't'; + }) + + var dist_seen = {}; + angular.forEach(list, function(i) { + sitem_alerts = sitem_alerts.concat( + i.notes().filter(function(n){ + return n.alert() == 't'; + }) + ); + var sdist = '_'+i.stream().distribution().id(); + if (!dist_seen[sdist]) { + dist_seen[sdist] = 1; + sdist_alerts = sdist_alerts.concat( + i.stream().distribution().notes().filter(function(n){ + return n.alert() == 't'; + }) + ); + } + }); + if (do_barcode || bind) { last_promise = current_promise.then(function(){ return $uibModal.open({ @@ -830,6 +855,9 @@ function(egCore , orderByFilter , $q , $filter , $uibModal , ngToast , egConfirm $scope.force_bind = bind; $scope.bind = bind; $scope.items = list; + $scope.ssub_alerts = ssub_alerts; + $scope.sdist_alerts = sdist_alerts; + $scope.sitem_alerts = sitem_alerts; $scope.acn_list = []; $scope.acnp_labels = []; $scope.acns_labels = []; @@ -1023,17 +1051,28 @@ function(egCore , orderByFilter , $q , $filter , $uibModal , ngToast , egConfirm }] }).result}); } else { - last_promise = current_promise.then(function(){ - return egConfirmDialog.open( - egCore.strings.CONFIRM_CHANGE_ITEMS[mode], - egCore.strings.CONFIRM_CHANGE_ITEMS_MESSAGE[mode], - {items : list.length} - ).result.then(function () { + last_promise = current_promise.then(function(){ return $uibModal.open({ + templateUrl: './serials/t_receive_alerts', + controller: + ['$scope', '$uibModalInstance', function($scope, $uibModalInstance) { + $scope.title = egCore.strings.CONFIRM_CHANGE_ITEMS[mode]; + $scope.items = list.length; + $scope.list = list; + $scope.mode = mode; + $scope.ssub_alerts = ssub_alerts; + $scope.sdist_alerts = sdist_alerts; + $scope.sitem_alerts = sitem_alerts; + + $scope.ok = function(items) { $uibModalInstance.close(items) } + $scope.cancel = function () { $uibModalInstance.dismiss() } + }] + }).result.then( + function(items) { angular.forEach(list, function (i, index) { i._receive = true; }); return $q.when(list); - }); + }) }); }