From 929ef5ca171f1db8029f87fb38fc6e11a97c38f9 Mon Sep 17 00:00:00 2001 From: Jason Etheridge Date: Thu, 18 May 2017 14:06:08 -0400 Subject: [PATCH] webstaff: fix Owning Lib for new Serials Templates instead of using the workstation lib, use the library from the list filter Signed-off-by: Jason Etheridge --- Open-ILS/web/js/ui/default/staff/admin/serials/app.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Open-ILS/web/js/ui/default/staff/admin/serials/app.js b/Open-ILS/web/js/ui/default/staff/admin/serials/app.js index a1f67ade55..1837a33636 100644 --- a/Open-ILS/web/js/ui/default/staff/admin/serials/app.js +++ b/Open-ILS/web/js/ui/default/staff/admin/serials/app.js @@ -33,9 +33,9 @@ function(egCore , $q , $uibModal , ngToast ) { var service = { }; - service.create_or_edit_template = function(id,cb) { + service.create_or_edit_template = function(id,ou,cb) { $uibModal.open({ - template: '', + template: '', controller: ['sharedScope','$uibModalInstance', function(sharedScope , $uibModalInstance ) { @@ -196,10 +196,10 @@ function($scope , $q , $window , $routeParams , $location , $timeout , egCore , $scope.grid_actions = { create_template : function() { - templateSvc.create_or_edit_template(null,refresh_page); + templateSvc.create_or_edit_template(null,$scope.context_ou.id(),refresh_page); }, edit_template : function(items) { - templateSvc.create_or_edit_template(items[0].id,refresh_page); + templateSvc.create_or_edit_template(items[0].id,$scope.context_ou.id(),refresh_page); }, delete_template : function(items) { var promises = []; @@ -213,7 +213,7 @@ function($scope , $q , $window , $routeParams , $location , $timeout , egCore , } $scope.grid_controls = { activateItem : function(item) { - templateSvc.create_or_edit_template(item.id,refresh_page); + templateSvc.create_or_edit_template(item.id,$scope.context_ou.id(),refresh_page); }, setQuery : function(x) { return x || current_query(); }, setSort : function() { return ['name','id'] } @@ -246,6 +246,7 @@ function($scope , $q , $window , $routeParams , $location , $timeout , egCore , template: '
', scope: { templateId: '=', + owningLib: '=' }, controller : ['$scope','$q','$window','itemSvc','egCore','ngToast','sharedScope', function ( $scope , $q , $window , itemSvc , egCore , ngToast , sharedScope ) { @@ -392,7 +393,7 @@ function($scope , $q , $window , $routeParams , $location , $timeout , egCore , console.log('create'); act_obj.isnew('t'); act_obj.creator( egCore.auth.user().id() ); - act_obj.owning_lib( egCore.auth.user().ws_ou() ); + act_obj.owning_lib( $scope.owningLib ); act_obj.create_date( new Date() ); } var some_failure = false; -- 2.11.0