From 9e946f5af3be4ecfe7d694a902c5a2ce8f9a4d23 Mon Sep 17 00:00:00 2001 From: Adam Bowling Date: Mon, 19 Jan 2015 16:04:04 -0500 Subject: [PATCH] LP#1406370 Set Search Preferences Ordered by Name Set search preferences is currently ordered by shortname in Admin > Workstation Administration > Set Search Preferences. This patch adds functionality that orders each org unit and its children in alphabetical order by name, rather than by shortname. Signed-off-by: Adam Bowling Signed-off-by: Terran McCanna Signed-off-by: Jason Stephenson --- .../xul/staff_client/chrome/content/main/search_prefs.xul | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Open-ILS/xul/staff_client/chrome/content/main/search_prefs.xul b/Open-ILS/xul/staff_client/chrome/content/main/search_prefs.xul index c4bf6f90af..e8f93ed681 100644 --- a/Open-ILS/xul/staff_client/chrome/content/main/search_prefs.xul +++ b/Open-ILS/xul/staff_client/chrome/content/main/search_prefs.xul @@ -60,6 +60,13 @@ } } function add_aou(aou, depth) { + if (aou.children().length > 0) { + aou.children().sort(function(a, b) { + if (a.name() < b.name()) return -1; + if (a.name() > b.name()) return 1; + return 0; + }); + } search_lib_box.appendItem(depth + aou.name(), aou.id(), ''); pref_lib_box.appendItem(depth + aou.name(), aou.id(), ''); for(var i = 0; i < aou.children().length; i++) -- 2.43.2