use base qw/OpenSRF::Application/;
use strict; use warnings;
use Data::Dumper;
+$Data::Dumper::Indent = 0;
use OpenILS::Event;
use Digest::MD5 qw(md5_hex);
use OpenILS::Utils::Fieldmapper;
use OpenILS::Application::Search::Actor;
use OpenILS::Utils::ModsParser;
-use OpenSRF::Utils::Logger;
-my $logger = "OpenSRF::Utils::Logger";
+use OpenSRF::Utils::Logger qw/$logger/;
use OpenSRF::Utils::Cache;
}
my $apputils = "OpenILS::Application::AppUtils";
+my $U = $apputils;
sub _d { warn "Patron:\n" . Dumper(shift()); }
my $session = $apputils->start_db_session();
my $err = undef;
+ $logger->debug("Updating Patron: " . Dumper($patron));
+
#warn $user_session . " " . $patron . "\n";
#_d($patron);
my $req = $session->request($method, $map);
my $status = $req->gather(1);
-
- #warn "Updated\n";
-
- if(!$status) {
+
+ if( $map->isnew() and !$status) {
throw OpenSRF::EX::ERROR
- ("Error updating stat map with method $method");
+ ("Error creating permission map with method $method");
}
-
}
return $new_patron;
my $req = $session->request($method, $map);
my $status = $req->gather(1);
- #warn "Updated\n";
-
- if(!$status) {
+ if($map->isnew and !$status) {
throw OpenSRF::EX::ERROR
- ("Error updating permission map with method $method");
+ ("Error creating permission map with method $method");
}
}
my($self, $client, $user_session, $barcode) = @_;
$logger->debug("Searching for user with barcode $barcode");
- #my $user_obj = $apputils->check_user_session( $user_session );
- my ($user_obj, $evt) = $apputils->check_ses($user_session);
+ my ($user_obj, $evt) = $apputils->checkses($user_session);
return $evt if $evt;
my $session = OpenSRF::AppSession->create("open-ils.storage");
sub patron_adv_search {
my( $self, $client, $staff_login, $search_hash ) = @_;
- use Data::Dumper;
#warn "patron adv with $staff_login and search " .
#Dumper($search_hash) . "\n";