fixed age protect logic
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 18 Sep 2006 13:17:57 +0000 (13:17 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 18 Sep 2006 13:17:57 +0000 (13:17 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@6131 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Utils/PermitHold.pm

index 0489797..e8dd91f 100644 (file)
@@ -130,9 +130,11 @@ sub check_age_protect {
                OpenSRF::Utils::clense_ISO8601($copy->create_date));
        my $age = $create_date->epoch;
 
-       $logger->debug("age_protect create_date = $create_date : age=$age, start_date=$start_date");
+       $logger->info("age_protect interval=$interval, create_date=$create_date, age=$age, start_date=$start_date");
 
-       unless( $start_date < $age ) {
+       if( $start_date < $age ) { 
+               # if start date is older (less than) than the age of the item, 
+               # the item falls within the age protect range
                $logger->info("age_protect prevents copy from having a hold placed on it: ".$copy->id);
                return OpenILS::Event->new('ITEM_AGE_PROTECTED', copy => $copy->id );
        }