PINES Cust: Reset Patron Search Form with Defaults
authorTerran McCanna <tmccanna@georgialibraries.org>
Wed, 27 Dec 2017 20:58:15 +0000 (15:58 -0500)
committerChris Sharp <csharp@georgialibraries.org>
Fri, 16 Nov 2018 01:04:07 +0000 (20:04 -0500)
Change code to refresh page instead of clearing individual fields,
which resets fields to the defaults we want (inactive checked and
org unit to consortium).

Signed-off-by: Terran McCanna <tmccanna@georgialibraries.org>
Open-ILS/web/js/ui/default/staff/services/patron_search.js

index 07e961e..fdf62ff 100644 (file)
@@ -524,6 +524,9 @@ function($scope,  $q,  $routeParams,  $timeout,  $window,  $location,  egCore,
         home_ou : egCore.org.tree()
     };
 
+    // PINES Customization - default to search inactive
+    $scope.searchArgs.inactive = true;
+    
     // last used patron search form element
     var lastFormElement;
 
@@ -740,9 +743,12 @@ function($scope,  $q,  $routeParams,  $timeout,  $window,  $location,  egCore,
     }
 
     $scope.clearForm = function () {
-        $scope.searchArgs={};
-        if (lastFormElement) lastFormElement.focus();
-    }
+        //PINES Customization - instead of resetting fields, refresh page
+        //because this allows us to get the correct field defaults 
+        //$scope.searchArgs={};
+        //if (lastFormElement) lastFormElement.focus();
+        $window.location.reload();
+        }
 
     $scope.applyShowExtras = function($event, bool) {
         if (bool) {