Lines 38-58
sub new {
Link Here
|
38 |
my ($class, $patron_id) = @_; |
38 |
my ($class, $patron_id) = @_; |
39 |
my $type = ref($class) || $class; |
39 |
my $type = ref($class) || $class; |
40 |
my $self; |
40 |
my $self; |
41 |
$kp = GetMember(cardnumber=>$patron_id); |
41 |
$kp = GetMember( cardnumber => $patron_id ); |
42 |
$debug and warn "new Patron (GetMember): " . Dumper($kp); |
42 |
$debug and warn "new Patron (GetMember): " . Dumper($kp); |
43 |
unless (defined $kp) { |
43 |
unless ( defined $kp ) { |
44 |
syslog("LOG_DEBUG", "new ILS::Patron(%s): no such patron", $patron_id); |
44 |
syslog( "LOG_DEBUG", "new ILS::Patron(%s): no such patron", $patron_id ); |
45 |
return undef; |
45 |
return undef; |
46 |
} |
46 |
} |
47 |
$kp = GetMemberDetails(undef,$patron_id); |
47 |
$kp = GetMemberDetails( undef, $patron_id ); |
48 |
$debug and warn "new Patron (GetMemberDetails): " . Dumper($kp); |
48 |
$debug and warn "new Patron (GetMemberDetails): " . Dumper($kp); |
49 |
my $pw = $kp->{password}; ### FIXME - md5hash -- deal with . |
49 |
my $pw = $kp->{password}; ### FIXME - md5hash -- deal with . |
50 |
my $flags = $kp->{flags}; # or warn "Warning: No flags from patron object for '$patron_id'"; |
50 |
my $flags = $kp->{flags}; # or warn "Warning: No flags from patron object for '$patron_id'"; |
51 |
my $debarred = $kp->{debarred}; # 1 if ($kp->{flags}->{DBARRED}->{noissues}); |
51 |
my $debarred = defined($kp->{flags}->{DEBARRED}); # 1 if ($kp->{flags}->{DBARRED}->{noissues}); |
52 |
$debug and warn sprintf("Debarred = %s : ", ($debarred||'undef')) . Dumper(%{$kp->{flags}}); |
52 |
$debug and warn sprintf( "Debarred = %s : ", ( $debarred || 'undef' ) ) . Dumper( %{ $kp->{flags} } ); |
53 |
my ($day, $month, $year) = (localtime)[3,4,5]; |
53 |
my ( $day, $month, $year ) = (localtime)[ 3, 4, 5 ]; |
54 |
my $today = sprintf '%04d-%02d-%02d', $year+1900, $month+1, $day; |
54 |
my $today = sprintf '%04d-%02d-%02d', $year + 1900, $month + 1, $day; |
55 |
my $expired = ($today gt $kp->{dateexpiry}) ? 1 : 0; |
55 |
my $expired = ( $today gt $kp->{dateexpiry} ) ? 1 : 0; |
|
|
56 |
|
56 |
if ($expired) { |
57 |
if ($expired) { |
57 |
if ($kp->{opacnote} ) { |
58 |
if ($kp->{opacnote} ) { |
58 |
$kp->{opacnote} .= q{ }; |
59 |
$kp->{opacnote} .= q{ }; |