Bug 19933: Remove patronflags - In CanBookBeIssued
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Sun, 7 Jan 2018 16:48:16 +0000 (13:48 -0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Fri, 23 Mar 2018 14:45:38 +0000 (11:45 -0300)
The change is trivial here, we only want to pass gonenoaddress, lost and
is_debared to the template.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
C4/Circulation.pm

index d583e53..d150ce1 100644 (file)
@@ -724,17 +724,15 @@ sub CanBookBeIssued {
         return( { STATS => 1 }, {});
     }
 
-    my $flags = C4::Members::patronflags( $patron_unblessed );
-    if ( ref $flags ) {
-        if ( $flags->{GNA} ) {
-            $issuingimpossible{GNA} = 1;
-        }
-        if ( $flags->{'LOST'} ) {
-            $issuingimpossible{CARD_LOST} = 1;
-        }
-        if ( $flags->{'DBARRED'} ) {
-            $issuingimpossible{DEBARRED} = 1;
-        }
+    if ( $patron->gonenoaddress == 1 ) {
+        $issuingimpossible{GNA} = 1;
+    }
+
+    if ( $patron->lost == 1 ) {
+        $issuingimpossible{CARD_LOST} = 1;
+    }
+    if ( $patron->is_debarred ) {
+        $issuingimpossible{DEBARRED} = 1;
     }
 
     if ( $patron->is_expired ) {