$circ->ok($circ->patron && $circ->item);
if ($circ->ok) {
+ # If the item is already associated with this patron, then
+ # we're renewing it.
+ $circ->renew_ok($item->{patron} eq $patron_id);
$item->{patron} = $patron_id;
$item->{due_date} = time + (14*24*60*60); # two weeks
push(@{$patron->{items}}, $item_id);
my %fields = (
security_inhibit => 0,
due => undef,
+ renew_ok => 0,
);
sub new {
return bless $self, $class;
}
-sub renew_ok {
- my $self = shift;
- my $patron = $self->{patron};
- my $item = $self->{item};
-
- return ($item->{patron} eq $patron->{id});
-}
-
1;