From ed60b87ec9a0b8f88497cdd9f27d486f72e631e0 Mon Sep 17 00:00:00 2001 From: Jason Etheridge Date: Tue, 16 May 2017 09:15:28 -0400 Subject: [PATCH] webstaff: serials Receiving Template selector under Manage Subscriptions Signed-off-by: Jason Etheridge --- .../src/templates/staff/serials/t_subscription_manager.tt2 | 11 +++++++---- .../staff/serials/directives/subscription_manager.js | 13 +++++++++++++ Open-ILS/web/js/ui/default/staff/serials/services/core.js | 11 +++++++++-- 3 files changed, 29 insertions(+), 6 deletions(-) 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 d0f2c28a8b..b0dcbf8ee5 100644 --- a/Open-ILS/src/templates/staff/serials/t_subscription_manager.tt2 +++ b/Open-ILS/src/templates/staff/serials/t_subscription_manager.tt2 @@ -35,6 +35,11 @@ + +
@@ -67,8 +72,6 @@ grid-controls="distStreamGridControls" persist-key="serials.dist_stream_grid"> - - + - + 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 b7f88683ef..50464f4c73 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 @@ -39,6 +39,19 @@ function($scope , $q , egSerialsCoreSvc , egCore , egGridDataProvider , return true; }; + $scope.receiving_templates = {}; + var promises = []; + angular.forEach(egCore.org.list(), function(org) { + promises.push( + egSerialsCoreSvc.fetch_templates(org.id()).then(function(list){ + $scope.receiving_templates[org.id()] = list; + }) + ); + }); + $q.all(promises).then(function() { + //console.log('finis',$scope.receiving_templates); + }); + $scope.add_subscription = function() { var new_ssub = egCore.idl.toTypedHash(new egCore.idl.ssub()); new_ssub._isnew = true; 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 3394585f61..edbf12ffd2 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 @@ -21,8 +21,8 @@ function(egCore , orderByFilter , $q) { flesh_fields : { 'ssub' : ['owning_lib','distributions', 'scaps', 'notes'], 'sdist' : [ 'record_entry','holding_lib', - 'receive_call_number','receive_unit_template', - 'bind_call_number','bind_unit_template', + 'receive_call_number', + 'bind_call_number', 'streams','notes'], 'sstr' : ['routing_list_users'] } @@ -175,5 +175,12 @@ function(egCore , orderByFilter , $q) { }); } + service.fetch_templates = function(org) { + return egCore.pcrud.search('act', + {owning_lib : egCore.org.fullPath(org, true)}, + {order_by : { act : 'name' }}, {atomic : true} + ); + }; + return service; }]); -- 2.11.0