From 757c6c6c4f11efb499dc2c294eeef409523f5e77 Mon Sep 17 00:00:00 2001 From: Mike Rylander Date: Mon, 2 Feb 2015 12:06:04 -0500 Subject: [PATCH] LP#1402797 Profile Group no longer causes second search to fail, but it does not yet propagate Signed-off-by: Mike Rylander Signed-off-by: Bill Erickson --- .../js/ui/default/staff/circ/patron/app.js | 30 +++++++++++-------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/Open-ILS/web/js/ui/default/staff/circ/patron/app.js b/Open-ILS/web/js/ui/default/staff/circ/patron/app.js index 4afa173ffa..14a9bb8a70 100644 --- a/Open-ILS/web/js/ui/default/staff/circ/patron/app.js +++ b/Open-ILS/web/js/ui/default/staff/circ/patron/app.js @@ -771,9 +771,26 @@ function($scope, $q, $routeParams, $timeout, $window, $location, egCore, propagate = patronSvc.urlSearch.search; } + if (egCore.env.pgt) { + $scope.profiles = egCore.env.pgt.list; + } else { + egCore.pcrud.search('pgt', {parent : null}, + {flesh : -1, flesh_fields : {pgt : ['children']}} + ).then( + function(tree) { + egCore.env.absorbTree(tree, 'pgt') + $scope.profiles = egCore.env.pgt.list; + } + ); + } + if (propagate) { // populate the search form with our cached / preexisting search info angular.forEach(propagate, function(val, key) { + if (key == 'profile') + val.value = $scope.profiles.filter(function(p) { p.id() == val.value })[0]; + if (key == 'home_ou') + val.value = egCore.org.get(val.value); $scope.searchArgs[key] = val.value; }); } @@ -884,19 +901,6 @@ function($scope, $q, $routeParams, $timeout, $window, $location, egCore, $scope.patronSearchGridProvider = provider; - if (egCore.env.pgt) { - $scope.profiles = egCore.env.pgt.list; - } else { - egCore.pcrud.search('pgt', {parent : null}, - {flesh : -1, flesh_fields : {pgt : ['children']}} - ).then( - function(tree) { - egCore.env.absorbTree(tree, 'pgt') - $scope.profiles = egCore.env.pgt.list; - } - ); - } - // determine the tree depth of the profile group $scope.pgt_depth = function(grp) { var d = 0; -- 2.43.2