patron search result order sorting
authorJason Etheridge <jason@esilibrary.com>
Mon, 23 Jan 2012 15:05:19 +0000 (10:05 -0500)
committerChris Sharp <csharp@georgialibraries.org>
Tue, 24 Jan 2012 02:44:12 +0000 (21:44 -0500)
The default patron search "order by" on the server side is last name, first
name, and actor.usr.id.

The staff client intended to request last name, first name, middle name, and
date of birth (when actor.usr.id to be tacked on in the middle layer), but a bug
prevented this.

This fixes that.

Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Open-ILS/xul/staff_client/server/patron/search_result.js

index d4beaca..7c3cac6 100644 (file)
@@ -235,11 +235,15 @@ patron.search_result.prototype = {
         try {
             var results = [];
 
+            var sort_params = obj.search_sort;
+            if (!sort_params) {
+                sort_params = [ 'family_name ASC', 'first_given_name ASC', 'second_given_name ASC', 'dob DESC' ];
+            }
             var params = [ 
                 ses(), 
                 search_hash, 
                 typeof obj.search_limit != 'undefined' && typeof obj.search_limit != 'null' ? obj.search_limit : obj.result_cap + 1, 
-                typeof obj.search_sort != 'undefined' ? obj.search_sort : [ 'family_name ASC', 'first_given_name ASC', 'second_given_name ASC', 'dob DESC' ] 
+                sort_params
             ];
             if (inactive) {
                 params.push(1);