use CGI;
use C4::Auth;
+use C4::Branch;
use C4::Output;
use C4::Members;
+use C4::Members::Attributes qw(GetBorrowerAttributes);
use C4::Debug;
use Koha::DateUtils;
my $filename = $cgi->param('uploadfile');
my $mimetype = $cgi->uploadInfo($filename)->{'Content-Type'};
- $errors{'empty_upload'} = 1 unless ( length($uploaded_file) > 0 );
+ $errors{'empty_upload'} = 1 if ( -z $uploaded_file );
if (%errors) {
$template->param( errors => %errors );
}
$template->param(
+ categoryname => $data->{'description'},
+ branchname => GetBranchName($data->{'branchcode'}),
+ );
+
+ if (C4::Context->preference('ExtendedPatronAttributes')) {
+ my $attributes = GetBorrowerAttributes($borrowernumber);
+ $template->param(
+ ExtendedPatronAttributes => 1,
+ extendedattributes => $attributes
+ );
+ }
+
+ my ($picture, $dberror) = GetPatronImage($data->{'cardnumber'});
+ $template->param( picture => 1 ) if $picture;
+
+ $template->param(
files => Koha::Borrower::Files->new( borrowernumber => $borrowernumber )
->GetFilesInfo(),
- errors => %errors
+ errors => \%errors
);
output_html_with_http_headers $cgi, $cookie, $template->output;
}