From d54585f529b1719e2468c3a8d910ff5e8116c9ae Mon Sep 17 00:00:00 2001 From: McCanna Date: Wed, 20 Dec 2017 13:45:44 -0500 Subject: [PATCH] Fix for PINES-Specific Holdings Sort Order See Tom Berezansky's original fix at: http://git.evergreen-ils.org/?p=evergreen/pines.git;a=commit;h=adc566e152d10796b73c992a16ae46e69cc3ab77 Some changes to the base code required this fix to be updated. Signed-off-by: Terran McCanna --- .../perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm | 27 ++++++++++++---------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm index c4c14d04ae..28de3b162d 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm @@ -393,19 +393,22 @@ sub mk_copy_query { 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', -- 2.11.0