returning title, copy, and circ objects on checkin
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 8 Feb 2006 23:08:03 +0000 (23:08 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 8 Feb 2006 23:08:03 +0000 (23:08 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@3017 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm

index fa98768..bbc699f 100644 (file)
@@ -795,19 +795,15 @@ sub checkin {
        my( $self, $client, $authtoken, $params ) = @_;
        $U->logmark;
 
-       my( $ctx, $requestor, $evt, $patron, $circ, $copy, $obt );
+       my( $ctx, $requestor, $evt, $circ, $copy, $obt );
 
        ( $requestor, $evt ) = $U->checkses($authtoken) if $__isrenewal;
        ( $requestor, $evt ) = $U->checksesperm( 
                $authtoken, 'COPY_CHECKIN' ) unless $__isrenewal;
        return $evt if $evt;
 
-       ( $patron, $evt ) = $U->fetch_user($params->{patron});
-       return $evt if $evt;
-
        if( !( $ctx = $params->{_ctx}) ) {
                ( $ctx, $evt ) = create_circ_ctx( %$params, 
-                       patron                                                  => $patron, 
                        requestor                                               => $requestor, 
                        session                                                 => $U->start_db_session(),
                        type                                                            => 'circ',
@@ -851,8 +847,16 @@ sub checkin {
                "session thread trace: ".$ctx->{session}->session_id);
        $U->commit_db_session($ctx->{session});
 
-       return OpenILS::Event->new('ITEM_NOT_CATALOGED') if $copy->call_number == -1;
-       return OpenILS::Event->new('SUCCESS');
+       my $record = $U->record_to_mvr($ctx->{title}) if($ctx->{title} and ! $ctx->{precat});
+       my $payload = { 
+               copy            => $ctx->{copy},
+               circ            => $ctx->{circ},
+               record  => $record };
+
+       return OpenILS::Event->new('ITEM_NOT_CATALOGED', 
+               payload => $payload ) if $copy->call_number == -1;
+
+       return OpenILS::Event->new('SUCCESS', payload => $payload );
 }