From: Bill Erickson Date: Mon, 29 Jun 2020 21:51:26 +0000 (-0400) Subject: LPXXX Angular Volcopy data api X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=75568995caad6066858550e6c16891d540b6e47a;p=working%2FEvergreen.git LPXXX Angular Volcopy data api Signed-off-by: Bill Erickson --- 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 ];