From: Jason Etheridge Date: Mon, 23 Jan 2012 15:05:19 +0000 (-0500) Subject: patron search result order sorting X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=c07d9c47393e6af0b7b99ace23aea6283dbca9f9;p=evergreen%2Fpines.git patron search result order sorting 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 Signed-off-by: Jason Stephenson Signed-off-by: Mike Rylander --- diff --git a/Open-ILS/xul/staff_client/server/patron/search_result.js b/Open-ILS/xul/staff_client/server/patron/search_result.js index 0512e1c146..3984074021 100644 --- a/Open-ILS/xul/staff_client/server/patron/search_result.js +++ b/Open-ILS/xul/staff_client/server/patron/search_result.js @@ -236,11 +236,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);