}
+__PACKAGE__->register_method(
+ method => "user_retrieve_fleshed_by_id",
+ api_name => "open-ils.actor.user.fleshed.retrieve",);
+
+sub user_retrieve_fleshed_by_id {
+ my( $self, $client, $user_session, $user_id ) = @_;
+ my $user_obj = $apputils->check_user_session( $user_session );
+ return flesh_user($user_id);
+}
+
+
sub flesh_user {
my $id = shift;
my $session = shift;
+
my $kill = 0;
if(!$session) {
__PACKAGE__->register_method(
method => "user_retrieve_by_barcode",
- api_name => "open-ils.actor.user.fleshed.retrieve_by_barcode",
-);
+ api_name => "open-ils.actor.user.fleshed.retrieve_by_barcode",);
sub user_retrieve_by_barcode {
- my($self, $client, $barcode) = @_;
+ my($self, $client, $user_session, $barcode) = @_;
warn "Searching for user with barcode $barcode\n";
+ my $user_obj = $apputils->check_user_session( $user_session );
my $session = OpenSRF::AppSession->create("open-ils.storage");
# copy the doc so that we can mangle the namespace.
my $marcxml = OpenILS::Utils::FlatXML->new()->nodeset_to_xml($nodeset);
- my $copy_marcxml = XML::LibXML->new->parse_string($marcxml);
+ my $copy_marcxml = XML::LibXML->new->parse_string($marcxml->toString);
$marcxml->documentElement->setNamespace( "http://www.loc.gov/MARC21/slim", "marc", 1 );
my $tcn;
+
+ warn "Starting db session in import\n";
+ my $session = $apputils->start_db_session();
+ my $source = 2; # system local source
+
my $xpath = '//controlfield[@tag="001"]';
$tcn = $marcxml->documentElement->findvalue($xpath);
+ if(_tcn_exists($session, $tcn)) {$tcn = undef;}
my $tcn_source = "External";
- my $source = 2; # system local source
- warn "Starting db session in import\n";
- my $session = $apputils->start_db_session();
if(!$tcn) {
$xpath = '//datafield[@tag="020"]';
if(_tcn_exists($session, $tcn)) {$tcn = undef;}
}
- warn "Record import with tcn: $tcn\n";
+ warn "Record import with tcn: $tcn and source $tcn_source\n";
my $record = Fieldmapper::biblio::record_entry->new;
use OpenSRF::Utils::SettingsClient;
use OpenILS::Utils::Fieldmapper;
+use OpenILS::EX;
use Template qw(:template);
use Template::Stash;
my $copy = $circ_objects->{copy};
+ use Data::Dumper;
+ warn "Building a new circulation object with\n".
+ "=> copy " . Dumper($copy) .
+ "=> duration_rule " . Dumper($duration_rule) .
+ "=> rec_files_rule " . Dumper($rec_fines_rule) .
+ "=> duration " . Dumper($duration) .
+ "=> recurring " . Dumper($recurring) .
+ "=> max " . Dumper($max);
+
+
# build the new circ object
my $circ = build_circ_object($session, $copy, $duration_rule->[1],
$rec_fines_rule->[1], $duration, $recurring, $max );
);
sub checkin {
- my( $self, $user_session, $client, $barcode ) = @_;
+ my( $self, $client, $user_session, $barcode ) = @_;
my $err;
my $copy;
"open-ils.storage.direct.asset.copy.search.barcode",
$barcode );
$copy = $copy_req->gather(1)->[0];
+ if(!$copy) {
+ $client->respond_complete(
+ OpenILS::EX->new("UNKNOWN_BARCODE")->ex);
+ }
+
$copy->status(0);
# find circ's where the transaction is still open for the
"open-ils.storage.biblio.record_entry.retrieve_by_barcode",
$barcode );
- return { ids => $title->id, count => 1 };
+ if($title) {
+ return { ids => $title->id, count => 1 };
+ } else {
+ return { count => 0 };
+ }
+
=head
my $u = OpenILS::Utils::ModsParser->new();
$mods->doc_id($title->id());
return $mods;
=cut
+
}
# grab the mr id's from storage
- my $method = "open-ils.storage.metabib.$class.search_fts.metarecord_count";
- if($self->api_name =~ /staff/) { $method = "$method.staff"; }
+ my $method = "open-ils.storage.cachable.metabib.$class.search_fts.metarecord_count";
+ if($self->api_name =~ /staff/) {
+ $method = "$method.staff";
+ $method =~ s/\.cachable//o;
+ }
warn "Performing count method $method\n";
warn "API name " . $self->api_name() . "\n";
my $request = $session->request( $method,
term => $string,
org_unit => $org_id,
+ cache_page_size => 1,
depth =>$org_type );
my $count = $request->gather(1);
throw OpenSRF::EX::InvalidArg ("Not a valid search class: $class")
}
- my $method = "open-ils.storage.metabib.$class.search_fts.metarecord.atomic";
+ #my $method = "open-ils.storage.metabib.$class.search_fts.metarecord.atomic";
+ my $method = "open-ils.storage.cachable.metabib.$class.search_fts.metarecord.atomic";
if($self->api_name =~ /order/) {
- $method = "open-ils.storage.metabib.$class.search_fts.metarecord.unordered.atomic";
+ $method = "open-ils.storage.cachable.metabib.$class.search_fts.metarecord.unordered.atomic",
+ #$method = "open-ils.storage.metabib.$class.search_fts.metarecord.unordered.atomic";
}
if($self->api_name =~ /staff/) {
$method =~ s/atomic/staff\.atomic/og;
+ $method =~ s/\.cachable//o;
}
warn "Performing search method $method\n";
warn "Search making request " . time() . "\n";
my $request = $session->request(
- #"open-ils.storage.cachable.metabib.$class.search_fts.metarecord.atomic",
$method,
term => $string,
org_unit => $org_id,
depth => $org_type,
limit => $limit,
offset => $offset,
+ cache_page_size => 200,
);
my $records = $request->gather(1);
my %ex_types = (
UNKNOWN => 1,
SEARCH_TOO_LARGE => 2,
+ UNKNOWN_BARCODE => 3,
);
use overload ( '""' => sub { $_[0]->ex()->err_msg(); } );
IF onmouseout; " onmouseout='" _ onmouseout _ "'"; END;
IF onmouseover; " onmouseover='" _ onmouseover _ "'"; END;
IF onclick; " onclick='" _ onclick _ "'"; END;
+ IF title; " title='" _ title _ "'"; END;
"/>";
%]
"<option";
IF value; " value='" _ value _ "'"; END;
IF id; " id='" _ id _ "'"; END;
+ IF selected; " selected='" _ selected _ "'"; END;
IF ! content; "/"; END;
">";
IF content;