From: erickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Date: Fri, 11 Jun 2010 14:07:15 +0000 (+0000)
Subject: when configuring sort order for copy locations, allow local sorting on locations... 
X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=6493d61a61cbcd12116fb810d8851dac087cb52c;p=evergreen%2Ftadl.git

when configuring sort order for copy locations, allow local sorting on locations defined at parent orgs (in the UI, finally)

git-svn-id: svn://svn.open-ils.org/ILS/trunk@16678 dcc99617-32d9-48b4-a31d-7c20da2025e4
---

diff --git a/Open-ILS/web/js/ui/default/conify/global/asset/copy_location_order.js b/Open-ILS/web/js/ui/default/conify/global/asset/copy_location_order.js
index f444df7a0b..5f3c783354 100644
--- a/Open-ILS/web/js/ui/default/conify/global/asset/copy_location_order.js
+++ b/Open-ILS/web/js/ui/default/conify/global/asset/copy_location_order.js
@@ -36,7 +36,10 @@ function filterGrid(org) {
     // fetch the locations and order entries
     var pcrud = new openils.PermaCrud({authtoken : user.authtoken});
     orders = pcrud.search('acplo', {org : org}, {order_by : {acplo : 'position'}});
-    locations = pcrud.search('acpl', {owning_lib : org}, {order_by : {acpl : 'name'}}); // TODO
+    locations = pcrud.search('acpl', 
+        {owning_lib : fieldmapper.aou.orgNodeTrail(fieldmapper.aou.findOrgUnit(org), true)}, 
+        {order_by : {acpl : 'name'}}
+    ); 
 
     // init the DnD environment
     source.selectAll();
@@ -65,6 +68,7 @@ function filterGrid(org) {
     // shove them into the DnD environment
     dojo.forEach(locs,
         function(loc) {
+            if(!loc) return;
             var node = source.insertNodes(false, [ 
                 { 
                     data : loc.name() + ' (' + fieldmapper.aou.findOrgUnit(loc.owning_lib()).shortname()+')',