From f0426b84fb5dbb23aff46d73c865d617df3cb845 Mon Sep 17 00:00:00 2001 From: djfiander Date: Fri, 14 Apr 2006 19:59:29 +0000 Subject: [PATCH] Added code to verify the institution id, and to manage due dates within the stub item db. --- ILS.pm | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ILS.pm b/ILS.pm index 407e942..c0a46e1 100644 --- a/ILS.pm +++ b/ILS.pm @@ -49,6 +49,15 @@ sub supports { return exists($supports{$op}) ? $supports{$op} : 0; } +sub check_inst_id { + my ($self, $id, $whence) = @_; + + if ($id ne $self->{institution}) { + syslog("WARNING", "%s: received institution '%s', expected '%s'", + $whence, $id, $self->{institution}); + } +} + sub checkout_ok { return 1; } @@ -87,6 +96,7 @@ sub checkout { if ($circ->{ok}) { $item->{patron} = $patron_id; + $item->{due_date} = time + (14*24*60*60); # two weeks push(@{$patron->{items}}, $item_id); $circ->{desensitize} = !$item->magnetic; @@ -112,6 +122,7 @@ sub checkin { if ($circ->{ok}) { $circ->{patron} = $patron = new ILS::Patron $item->{patron}; delete $item->{patron}; + delete $item->{due_date}; $patron->{items} = [ grep {$_ ne $item_id} @{$patron->{items}} ]; } # END TRANSACTION -- 2.11.0