Bug 11944: use CGI( -utf8 ) everywhere
[srvgit] / members / moremember.pl
index d056580..92fe2d9 100755 (executable)
@@ -35,7 +35,7 @@
 
 use strict;
 #use warnings; FIXME - Bug 2505
-use CGI;
+use CGI qw ( -utf8 );
 use C4::Context;
 use C4::Auth;
 use C4::Output;
@@ -54,7 +54,7 @@ use List::MoreUtils qw/uniq/;
 use C4::Members::Attributes qw(GetBorrowerAttributes);
 use Koha::Borrower::Debarments qw(GetDebarments IsDebarred);
 use Module::Load;
-if ( C4::Context->preference('NorwegianPatronDBEnable') == 1 ) {
+if ( C4::Context->preference('NorwegianPatronDBEnable') && C4::Context->preference('NorwegianPatronDBEnable') == 1 ) {
     load Koha::NorwegianPatronDB, qw( NLGetSyncDataFromBorrowernumber );
 }
 #use Smart::Comments;
@@ -169,14 +169,14 @@ if ( $category_type eq 'C') {
 if ( $data->{'ethnicity'} || $data->{'ethnotes'} ) {
     $template->param( printethnicityline => 1 );
 }
-if ( $category_type eq 'A' || $category_type eq 'I') {
+my ( $count, $guarantees ) = GetGuarantees( $data->{'borrowernumber'} );
+if ( $count ) {
     $template->param( isguarantee => 1 );
 
     # FIXME
     # It looks like the $i is only being returned to handle walking through
     # the array, which is probably better done as a foreach loop.
     #
-    my ( $count, $guarantees ) = GetGuarantees( $data->{'borrowernumber'} );
     my @guaranteedata;
     for ( my $i = 0 ; $i < $count ; $i++ ) {
         push(@guaranteedata,
@@ -295,7 +295,7 @@ else {
 }
 
 # Add sync data to the user data
-if ( C4::Context->preference('NorwegianPatronDBEnable') == 1 ) {
+if ( C4::Context->preference('NorwegianPatronDBEnable') && C4::Context->preference('NorwegianPatronDBEnable') == 1 ) {
     my $sync = NLGetSyncDataFromBorrowernumber( $borrowernumber );
     if ( $sync ) {
         $data->{'sync'}       = $sync->sync;