From e1f1016e52419a03b49ae7493289b629f541f5ee Mon Sep 17 00:00:00 2001 From: miker Date: Mon, 26 Oct 2009 14:07:45 +0000 Subject: [PATCH] allow the CircIsOpen and CircIsOverdue validators to reuse the MaxPassiveDelayAge validator in the presense of a max_delay_age param 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 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Trigger/Validator.pm b/Open-ILS/src/perlmods/OpenILS/Application/Trigger/Validator.pm index f73cbffb5..6efe8c48f 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Trigger/Validator.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Trigger/Validator.pm @@ -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; -- 2.11.0