From bb0c2fce1b87222933bfa5dd02ca614521ba2a0c Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 5 Jan 2016 14:37:20 +0000 Subject: [PATCH] Bug 15353: Display the patron image where needed MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit On the 3 following pages, the patron image was not displayed: members/discharge.pl members/pay.pl members/paycollect.pl Test plan: Apply this patch and confirm the image is now displayed Followed test plan, image displays as expected. Signed-off-by: Marc Véron Signed-off-by: Katrin Fischer Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com --- members/discharge.pl | 3 +++ members/pay.pl | 3 +++ members/paycollect.pl | 7 +++---- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/members/discharge.pl b/members/discharge.pl index 6c0715bb62..466c119773 100755 --- a/members/discharge.pl +++ b/members/discharge.pl @@ -102,6 +102,9 @@ if ( $input->param('borrowernumber') ) { borrowernumber => $borrowernumber, }); + my ($picture, $dberror) = GetPatronImage($borrowernumber); + $template->param( picture => 1 ) if $picture; + $template->param( borrowernumber => $borrowernumber, biblionumber => $data->{'biblionumber'}, diff --git a/members/pay.pl b/members/pay.pl index 04991d87fd..b2e3a1f904 100755 --- a/members/pay.pl +++ b/members/pay.pl @@ -136,6 +136,8 @@ sub add_accounts_to_template { $template->param(%$borrower); + my ($picture, $dberror) = GetPatronImage($borrower->{'borrowernumber'}); + $template->param( picture => 1 ) if $picture; $template->param( accounts => $accounts, borrower => $borrower, @@ -224,6 +226,7 @@ sub borrower_add_additional_fields { } elsif ( $b_ref->{category_type} eq 'A' ) { $b_ref->{adultborrower} = 1; } + my ( $picture, $dberror ) = GetPatronImage( $b_ref->{borrowernumber} ); if ($picture) { $b_ref->{has_picture} = 1; diff --git a/members/paycollect.pl b/members/paycollect.pl index 7254a3aaea..9525464ce5 100755 --- a/members/paycollect.pl +++ b/members/paycollect.pl @@ -175,10 +175,9 @@ sub borrower_add_additional_fields { } elsif ( $b_ref->{category_type} eq 'A' ) { $b_ref->{adultborrower} = 1; } - my ( $picture, $dberror ) = GetPatronImage( $b_ref->{borrowernumber} ); - if ($picture) { - $b_ref->{has_picture} = 1; - } + + my ($picture, $dberror) = GetPatronImage($borrower->{'borrowernumber'}); + $template->param( picture => 1 ) if $picture; if (C4::Context->preference('ExtendedPatronAttributes')) { $b_ref->{extendedattributes} = GetBorrowerAttributes($borrowernumber); -- 2.39.5