From 75568995caad6066858550e6c16891d540b6e47a Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Mon, 29 Jun 2020 17:51:26 -0400 Subject: [PATCH] LPXXX Angular Volcopy data api Signed-off-by: Bill Erickson --- Open-ILS/src/perlmods/lib/OpenILS/Application/Cat.pm | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat.pm index 40527a5133..b2ef7bdf68 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat.pm @@ -1948,6 +1948,14 @@ sub volcopy_data { ]) }); + # Provide a reasonable default copy location. Typically "Stacks" + $client->respond({ + acp_default_location => $e->search_asset_copy_location([ + {deleted => 'f', owning_lib => $org_ids}, + {order_by => {acpl => 'id'}, limit => 1} + ])->[0] + }); + $client->respond({ acp_status => $e->search_config_copy_status([ {id => {'!=' => undef}}, @@ -2018,14 +2026,10 @@ sub volcopy_data { sort { my $d1 = $a->owner->ou_type->depth; my $d2 = $b->owner->ou_type->depth; + return $a->name cmp $b->name if $d1 == $d2; - if ($d1 > $d2) { - return -1; - } elsif ($d1 < $d2) { - return 1; - } else { - return $a->name cmp $b->name; - } + # Sort cats closer to the workstation org unit to the front. + return $d1 > $d2 ? -1 : 1; } @$cats ]; -- 2.11.0