From 0a68edd5aa8d1198a3d88958f9ef95e1eca7fa4c Mon Sep 17 00:00:00 2001 From: Josh Stompro Date: Fri, 28 Feb 2020 10:36:22 -0600 Subject: [PATCH] LP#172113 - Patron Search Form Reset Enhancement The patron search "Clear Form" button clears the value from the Home Library selector and sets it to undefined. This can cause some strange results for subsequent searches, where the workstation ou can get inserted unintentionally. This branch changes the Clear Form input from a reset button to just a button, so the clearForm() function does all the work. The clearForm() function is changed to set the Home Lib to cons and the Include Inactive to true, so a reset results in the broadest search possible. Testing Notes: 1. Clear browser pref for eg.circ.patron.search.ou in admin -> workstation -> stored preferences. 2. Load patron search. 3. Press clear form. (Home library gets cleared) 4. Add some search args and perform a search that returns some patrons. 5. Open a patron. 6. Click on patron search in upper right corner to return to results. 7. Note that home library is now set to workstation ou. After fix applied. Perform above steps, but note that clear form sets Home Lib to cons, and doesn't unset Include Inactive. Signed-off-by: Josh Stompro --- Open-ILS/src/templates/staff/share/t_patron_search_form.tt2 | 2 +- Open-ILS/web/js/ui/default/staff/services/patron_search.js | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Open-ILS/src/templates/staff/share/t_patron_search_form.tt2 b/Open-ILS/src/templates/staff/share/t_patron_search_form.tt2 index 2152cab70c..9527c8fc4f 100644 --- a/Open-ILS/src/templates/staff/share/t_patron_search_form.tt2 +++ b/Open-ILS/src/templates/staff/share/t_patron_search_form.tt2 @@ -74,7 +74,7 @@ ng-model="searchArgs.email" placeholder="[% l('Email') %]"/>
-
diff --git a/Open-ILS/web/js/ui/default/staff/services/patron_search.js b/Open-ILS/web/js/ui/default/staff/services/patron_search.js index 07e961eefa..108e1da381 100644 --- a/Open-ILS/web/js/ui/default/staff/services/patron_search.js +++ b/Open-ILS/web/js/ui/default/staff/services/patron_search.js @@ -740,7 +740,11 @@ function($scope, $q, $routeParams, $timeout, $window, $location, egCore, } $scope.clearForm = function () { - $scope.searchArgs={}; + //reset values to broadest possible search + $scope.searchArgs={ + home_ou : egCore.org.tree(), + inactive : true + }; if (lastFormElement) lastFormElement.focus(); } -- 2.11.0