added check for inactive card
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 28 Jul 2006 22:23:57 +0000 (22:23 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 28 Jul 2006 22:23:57 +0000 (22:23 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@5164 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/extras/ils_events.xml
Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm
Open-ILS/src/perlmods/OpenILS/Application/Circ/ScriptBuilder.pm

index 0a3596a..8c980cb 100644 (file)
                </desc>
        </event>
 
+       <event code='1216' textcode='PATRON_INACTIVE_CARD'>
+               <desc xml:lang="en-US">The patron's card is not active</desc>
+       </event>
+
 
 
 
index 38315e2..2ced559 100644 (file)
@@ -1096,7 +1096,11 @@ sub walk_org_tree {
        }
 }
 
-
+sub is_true {
+       my( $self, $item ) = @_;
+       return 1 if $item and $item !~ /^f$/i;
+       return 0;
+}
 
 
 1;
index 892733c..1389ba8 100644 (file)
@@ -217,6 +217,9 @@ sub fetch_user_data {
 
        $patron->card($e->retrieve_actor_card($patron->card));
 
+       return OpenILS::Event->new('PATRON_INACTIVE_CARD')
+               unless $U->is_true($patron->card->active);
+
        $ctx->{requestor} = $ctx->{requestor} || $e->requestor;
 
        # this could alter the requestor object within the editor..