protecting destinations that cannot have volumes
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 8 Aug 2006 13:45:36 +0000 (13:45 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 8 Aug 2006 13:45:36 +0000 (13:45 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@5362 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Cat.pm

index ad13346..dc9ff04 100644 (file)
@@ -1197,6 +1197,15 @@ sub batch_volume_transfer {
        return $e->event unless $e->checkauth;
        return $e->event unless $e->allowed('VOLUME_UPDATE');
 
+       my $dorg = $e->retrieve_actor_org_unit($o_lib)
+               or return $e->event;
+
+       my $ou_type = $e->retrieve_actor_org_unit_type($dorg->ou_type)
+               or return $e->event;
+
+       return OpenILS::Event->new('ORG_CANNOT_HAVE_VOLS')
+               unless $U->is_true($ou_type->can_have_vols);
+
        my $vols = $e->batch_retrieve_asset_call_number($vol_ids);
        my @seen;