return $q.when(tree);
}
+ // sort orgs at each level by shortname
+ function sort_aou(node) {
+ node.children(node.children().sort(function(a, b) {
+ return a.shortname() < b.shortname() ? -1 : 1;
+ }));
+ angular.forEach(node.children(), sort_aou);
+ }
+
return egPCRUD.search('aou', {parent_ou : null},
{flesh : -1, flesh_fields : {aou : ['children', 'ou_type']}}
).then(
function(tree) {
+ sort_aou(tree);
$window.sessionStorage.setItem(
'eg.env.aou.tree', js2JSON(tree));
service.absorbTree(tree, 'aou')