allow the CircIsOpen and CircIsOverdue validators to reuse the MaxPassiveDelayAge...
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 26 Oct 2009 14:07:45 +0000 (14:07 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 26 Oct 2009 14:07:45 +0000 (14:07 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@14601 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Trigger/Validator.pm

index f73cbff..6efe8c4 100644 (file)
@@ -13,7 +13,10 @@ sub CircIsOpen {
     my $self = shift;
     my $env = shift;
 
-    return defined($env->{target}->checkin_time) ? 0 : 1;
+    return 0 if (defined($env->{target}->checkin_time));
+    return 0 if ($env->{params}->{max_delay_age} && !$self->MaxPassiveDelayAge($env));
+
+    return 1;
 }
 
 sub MaxPassiveDelayAge {
@@ -36,6 +39,7 @@ sub CircIsOverdue {
 
     return 0 if $circ->checkin_time;
     return 0 if $circ->stop_fines and not $circ->stop_fines =~ /MAXFINES|LONGOVERDUE/;
+    return 0 if ($env->{params}->{max_delay_age} && !$self->MaxPassiveDelayAge($env));
 
     my $due_date = DateTime::Format::ISO8601->new->parse_datetime(clense_ISO8601($circ->due_date));
     return 0 if $due_date > DateTime->now;