X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=members%2Ffiles.pl;h=dc08751228997845ba1b2bfeb633d020f9be6dcd;hb=0f6882896d6a806fb474b1fd172e3e93919d960c;hp=ccd11bc28b3c714c9f558976c39887076c2abdd7;hpb=612b12f41ba59a6508fcbf306be66455a6f0012b;p=koha.git diff --git a/members/files.pl b/members/files.pl index ccd11bc28b..dc08751228 100755 --- a/members/files.pl +++ b/members/files.pl @@ -23,8 +23,10 @@ use warnings; 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; @@ -73,7 +75,7 @@ else { 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 ); @@ -99,11 +101,28 @@ else { $bf->DelFile( id => $cgi->param('file_id') ); } + $template->param( + categoryname => $data->{'description'}, + branchname => GetBranchName($data->{'branchcode'}), + RoutingSerials => C4::Context->preference('RoutingSerials'), + ); + + if (C4::Context->preference('ExtendedPatronAttributes')) { + my $attributes = GetBorrowerAttributes($borrowernumber); + $template->param( + ExtendedPatronAttributes => 1, + extendedattributes => $attributes + ); + } + + my ($picture, $dberror) = GetPatronImage($data->{'borrowernumber'}); + $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; }