use strict;
#use warnings; FIXME - Bug 2505
-use CGI;
+use CGI qw ( -utf8 );
use C4::Context;
use C4::Auth;
use C4::Output;
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;
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,
}
# 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;