where => {id => $filter_orgs}
}
}
- }
- }};
+ },
+ join => { 'parent' => { 'class' => 'aou', 'fkey' => 'parent_ou'} }
+ }
+ }}
+ else {
+ $query->{from}->{acp}->[1] = {aou => {
+ join => { 'parent' => { 'class' => 'aou', 'fkey' => 'parent_ou'} } }
+ };
};
-
- my $ou_sort_param = [$org, $pref_ou ];
- if ($coords
- && ref($coords)
- && $$coords{latitude}
- && $$coords{longitude}
- ) {
- push(@$ou_sort_param, $$coords{latitude}, $$coords{longitude});
- }
-
+
+ unshift(@{$query->{order_by}},
+ {
+ class => 'parent', field => 'name'
+ }
+ );
+
# Unsure if we want these in the shared function, leaving here for now
unshift(@{$query->{order_by}},
{ class => "aou", field => 'id',