more moving of code out to the common packages
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 27 Oct 2008 21:58:55 +0000 (21:58 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 27 Oct 2008 21:58:55 +0000 (21:58 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@10929 dcc99617-32d9-48b4-a31d-7c20da2025e4

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

index 9239b10..d7278d8 100644 (file)
@@ -607,17 +607,6 @@ sub update_volume {
 
 
 
-sub copy_perm_org {
-       my( $vol, $copy ) = @_;
-       my $org = $vol->owning_lib;
-       if( $vol->id == OILS_PRECAT_CALL_NUMBER ) {
-               $org = ref($copy->circ_lib) ? $copy->circ_lib->id : $copy->circ_lib;
-       }
-       $logger->debug("using copy perm org $org");
-       return $org;
-}
-
-
 __PACKAGE__->register_method (
        method => 'delete_bib_record',
        api_name => 'open-ils.cat.biblio.record_entry.delete');
index 7f09f2c..29258c6 100644 (file)
@@ -179,7 +179,7 @@ sub update_fleshed_copies {
                }
 
                return $editor->event unless 
-                       $editor->allowed('UPDATE_COPY', copy_perm_org($vol, $copy));
+                       $editor->allowed('UPDATE_COPY', $class->copy_perm_org($vol, $copy));
 
                $copy->editor($editor->requestor->id);
                $copy->edit_date('now');
@@ -220,7 +220,7 @@ sub delete_copy {
        my($class, $editor, $override, $vol, $copy ) = @_;
 
    return $editor->event unless 
-      $editor->allowed('DELETE_COPY',copy_perm_org($vol, $copy));
+      $editor->allowed('DELETE_COPY', $class->copy_perm_org($vol, $copy));
 
        my $stat = $U->copy_status($copy->status)->id;
 
@@ -393,4 +393,12 @@ sub remove_empty_objects {
 }
 
 
-
+sub copy_perm_org {
+       my($class, $vol, $copy) = @_;
+       my $org = $vol->owning_lib;
+       if( $vol->id == OILS_PRECAT_CALL_NUMBER ) {
+               $org = ref($copy->circ_lib) ? $copy->circ_lib->id : $copy->circ_lib;
+       }
+       $logger->debug("using copy perm org $org");
+       return $org;
+}