From ee711968b69b8e4a6613f630d975965d28162e27 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Mon, 7 Mar 2016 12:42:51 -0500 Subject: [PATCH] LP#1436987: webstaff - fix patron search form This patch ensures that the patron profile and search OU values are retained when going from a patron search to a single record and back to the patron search. To test the fix for this bug: [1] Search for a patron using the expanded patron search fields, making sure to select values for the profile and search OU dropdowns. [2] Open a record, then click "Patron Search" to return to the search form. [3] Verify that the profile and search library are set and that the same patron records are retrieved. This patch includes elements from a patch originally written by Victoria Lewis Signed-off-by: Galen Charlton Signed-off-by: Bill Erickson Signed-off-by: Mike Rylander --- Open-ILS/web/js/ui/default/staff/circ/patron/app.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 687dd3c1a8..c860364833 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 @@ -824,6 +824,11 @@ function($scope, $q, $routeParams, $timeout, $window, $location, egCore, var propagate; if (patronSvc.lastSearch) { propagate = patronSvc.lastSearch.search; + // home_ou needs to be treated specially + propagate.home_ou = { + value : patronSvc.lastSearch.home_ou, + group : 0 + }; } else if (patronSvc.urlSearch) { propagate = patronSvc.urlSearch.search; } @@ -845,7 +850,7 @@ function($scope, $q, $routeParams, $timeout, $window, $location, egCore, // 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]; + val.value = $scope.profiles.filter(function(p) { return p.id() == val.value })[0]; if (key == 'home_ou') val.value = egCore.org.get(val.value); $scope.searchArgs[key] = val.value; -- 2.11.0