result cap warning if cap reached
authorpines <pines@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sat, 26 Aug 2006 23:34:32 +0000 (23:34 +0000)
committerpines <pines@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sat, 26 Aug 2006 23:34:32 +0000 (23:34 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@5711 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/server/patron/search_result.js

index fce61b0..e94fd17 100644 (file)
@@ -10,6 +10,8 @@ patron.search_result = function (params) {
 
 patron.search_result.prototype = {
 
+       'result_cap' : 50,
+
        'init' : function( params ) {
 
                var obj = this;
@@ -171,7 +173,7 @@ patron.search_result.prototype = {
                try {
                        var results = [];
 
-                       var params = [ ses(), search_hash, 50, [ 'family_name ASC', 'first_given_name ASC', 'second_given_name ASC', 'dob DESC' ] ];
+                       var params = [ ses(), search_hash, obj.result_cap + 1, [ 'family_name ASC', 'first_given_name ASC', 'second_given_name ASC', 'dob DESC' ] ];
                        if (inactive) {
                                params.push(1);
                                if (document.getElementById('active')) {
@@ -186,6 +188,10 @@ patron.search_result.prototype = {
                                        alert('No patrons found matching search criteria.');
                                        return;
                                }
+                               if (results.length == obj.result_cap+1) {
+                                       results.pop();
+                                       alert('Results capped at ' + obj.result_cap + ' patrons.');
+                               }
                        } else {
                                alert('Please enter some search terms.');
                                return;