Fix for org unit order in OPAC holdings list (adapted from
authorTerran McCanna <tmccanna@georgialibraries.org>
Wed, 20 Jan 2016 15:29:51 +0000 (10:29 -0500)
committerChris Sharp <csharp@georgialibraries.org>
Tue, 31 Oct 2017 19:13:15 +0000 (15:13 -0400)
http://git.evergreen-ils.org/?p=evergreen/pines.git;a=commit;h=adc566e152d10796b73c992a16ae46e69cc3ab77)

Signed-off-by: Terran McCanna <tmccanna@georgialibraries.org>
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm

index a7f56a2..f7f3f3e 100644 (file)
@@ -310,9 +310,19 @@ sub mk_copy_query {
                         where => {id => $org}
                     }
                 }
-            }
+            },
+                                join => { 'parent' => { 'class' => 'aou', 'fkey' => 'parent_ou'} }
+        }
+    }
+        else {
+                $query->{from}->{acp}->{aou} = { join => { 'parent' => { 'class' => 'aou', 'fkey' => 'parent_ou'} } };
         };
-    };
+
+        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}},