small tweaks, see diffs
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 18 Jul 2005 18:23:56 +0000 (18:23 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 18 Jul 2005 18:23:56 +0000 (18:23 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@1265 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/extras/org_tree_js.pl
Open-ILS/src/perlmods/OpenILS/Application/Cat.pm
Open-ILS/src/perlmods/OpenILS/Application/Circ/Rules.pm

index 83ff743..7d0be9e 100644 (file)
@@ -4,18 +4,17 @@
 use OpenSRF::AppSession;
 use OpenSRF::System;
 use JSON;
-OpenSRF::System->bootstrap_client(config_file => "/pines/conf/bootstrap.conf");
+OpenSRF::System->bootstrap_client(config_file => "/pines/conf/client.conf");
 
+my $ses = OpenSRF::AppSession->create("open-ils.actor");
+my $req = $ses->request("open-ils.actor.org_tree.retrieve");
 
-my $ses = OpenSRF::AppSession->create("open-ils.search");
-my $req = $ses->request("open-ils.search.actor.org_tree.slim.retrieve");
 my $tree = $req->gather(1);
 
 my $ses2 = OpenSRF::AppSession->create("open-ils.storage");
 my $req2 = $ses2->request("open-ils.storage.direct.actor.org_unit_type.retrieve.all.atomic");
 my $types = $req2->gather(1);
 
-
 my $tree_string = JSON->perl2JSON($tree);
 my $types_string = JSON->perl2JSON($types);
 
index af274bd..5a3ec3e 100644 (file)
@@ -241,6 +241,7 @@ sub biblio_record_tree_commit {
                throw OpenSRF::EX::ERROR ("Wormizing Failed for $docid" );
        };
 
+       warn "Committing db session...\n";
        OpenILS::Application::AppUtils->commit_db_session( $session );
 
        $nodeset = OpenILS::Utils::FlatXML->new()->xmldoc_to_nodeset($marcxml);
@@ -251,9 +252,10 @@ sub biblio_record_tree_commit {
 
        warn "Done wormizing\n";
 
-       use Data::Dumper;
-       warn "Returning tree:\n";
-       warn Dumper $tree;
+       #use Data::Dumper;
+       #warn "Returning tree:\n";
+       #warn Dumper $tree;
+
        return $tree;
 
 }
index df2d00c..555e78f 100644 (file)
@@ -379,15 +379,10 @@ sub permit_circ {
 
        # run the permissibility script
        run_script();
-       my $obj = $stash->get("circ_objects");
-
-       # turn the biblio record into a friendly object
-       my $u = OpenILS::Utils::ModsParser->new();
-       $u->start_mods_batch( $obj->{title}->marc() );
-       my $mods = $u->finish_mods_batch();
 
+       
        my $arr = $stash->get("result");
-       return { record => $mods, status => $arr->[0], text => $arr->[1] };
+       return { status => $arr->[0], text => $arr->[1] };
 
 }
 
@@ -420,7 +415,6 @@ sub circulate {
        my ($circ, $duration, $recurring, $max) =  run_circ_scripts($session);
 
 
-
        my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = 
                gmtime(OpenSRF::Utils->interval_to_seconds($circ->duration) + int(time()));
        $year += 1900; $mon += 1;
@@ -478,7 +472,14 @@ sub circulate {
        $circ->max_fine_rule($max);
        $circ->recuring_fine_rule($recurring);
 
-       return $circ;
+       # turn the biblio record into a friendly object
+       my $obj = $stash->get("circ_objects");
+       my $u = OpenILS::Utils::ModsParser->new();
+       $u->start_mods_batch( $circ_objects->{title}->marc() );
+       my $mods = $u->finish_mods_batch();
+
+
+       return { circ => $circ, copy => $copy, record => $mods };
 
 }
 
@@ -600,6 +601,7 @@ sub checkin {
 
        my $err;
        my $copy;
+       my $circ;
 
        try {
                my $session = $apputils->start_db_session();
@@ -632,7 +634,7 @@ sub checkin {
                        "open-ils.storage.direct.action.circulation.search.atomic",
                        { target_copy => $copy->id, xact_finish => undef } );
        
-               my $circ = $circ_req->gather(1)->[0];
+               $circ = $circ_req->gather(1)->[0];
        
                if(!$circ) {
                        $err = "No circulation exists for the given barcode";
@@ -679,8 +681,15 @@ sub checkin {
                my $u = OpenILS::Utils::ModsParser->new();
                $u->start_mods_batch( $record->marc() );
                my $mods = $u->finish_mods_batch();
-               return { record => $mods, status => 0, text => "OK", 
-                       route_to => $shelving_locations->{$copy->location} };
+
+               return { 
+                       record => $mods, 
+                       status => 0, 
+                       text => "OK", 
+                       circ => $circ,
+                       copy => $copy,
+                       route_to => $shelving_locations->{$copy->location} 
+               };
        }
 
        return 1;