From: Galen Charlton Date: Mon, 7 Mar 2016 17:42:51 +0000 (-0500) Subject: LP#1436987: webstaff - fix patron search form X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=refs%2Fheads%2Fuser%2Fberick%2Flp1436987-webstaff-patron-search-propagate-signoff;p=working%2FEvergreen.git 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 --- 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 652a35f6dc..c475de1c2d 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 @@ -817,6 +817,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; } @@ -838,7 +843,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;