])
});
+ # 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}},
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
];