Lines 27-32
Link Here
|
27 |
use Modern::Perl; |
27 |
use Modern::Perl; |
28 |
use CGI; |
28 |
use CGI; |
29 |
use C4::Auth; |
29 |
use C4::Auth; |
|
|
30 |
use C4::Context; |
31 |
use C4::Members::Attributes qw(GetBorrowerAttributes); |
30 |
use C4::Output; |
32 |
use C4::Output; |
31 |
use DateTime; |
33 |
use DateTime; |
32 |
use Koha::DateUtils; |
34 |
use Koha::DateUtils; |
Lines 56-69
my $visit_id = $input->param('visit_id') // q{};
Link Here
|
56 |
# Get patron |
58 |
# Get patron |
57 |
my $patron = eval { |
59 |
my $patron = eval { |
58 |
my $borrowernumber = $input->param('borrowernumber') // q{}; |
60 |
my $borrowernumber = $input->param('borrowernumber') // q{}; |
59 |
return Koha::Patrons->new->find($borrowernumber); |
61 |
return Koha::Patrons->find($borrowernumber); |
60 |
}; |
62 |
}; |
61 |
push @messages, { type => 'error', code => 'error_on_patron_load' } |
63 |
push @messages, { type => 'error', code => 'error_on_patron_load' } |
62 |
if ( $@ or !$patron ); |
64 |
if ( $@ or !$patron ); |
63 |
|
65 |
|
64 |
# Get supporting cast |
66 |
# Get supporting cast |
65 |
my ( $branch, $category, $houseboundprofile, $visit ); |
67 |
my ( $branch, $category, $houseboundprofile, $visit, $patron_image ); |
66 |
if ( $patron ) { |
68 |
if ( $patron ) { |
|
|
69 |
$patron_image = Koha::Patron::Images->find($patron->borrowernumber); |
67 |
$branch = Koha::Libraries->new->find($patron->branchcode); |
70 |
$branch = Koha::Libraries->new->find($patron->branchcode); |
68 |
$category = Koha::Patron::Categories->new->find($patron->categorycode); |
71 |
$category = Koha::Patron::Categories->new->find($patron->categorycode); |
69 |
$houseboundprofile = $patron->housebound_profile; |
72 |
$houseboundprofile = $patron->housebound_profile; |
Lines 156-163
if ( $method eq 'updateconfirm' and $houseboundprofile ) {
Link Here
|
156 |
# We don't have any profile information, so we must display a creation form. |
159 |
# We don't have any profile information, so we must display a creation form. |
157 |
$method = 'update_or_create' if ( !$houseboundprofile ); |
160 |
$method = 'update_or_create' if ( !$houseboundprofile ); |
158 |
|
161 |
|
|
|
162 |
# Ensure template has all patron details. |
163 |
$template->param(%{$patron->unblessed}) if ( $patron ); |
164 |
|
165 |
# Load extended patron attributes if necessary (taken from members/files.pl). |
166 |
if ( C4::Context->preference('ExtendedPatronAttributes') and $patron ) { |
167 |
my $attributes = GetBorrowerAttributes($patron->borrowernumber); |
168 |
$template->param( |
169 |
ExtendedPatronAttributes => 1, |
170 |
extendedattributes => $attributes |
171 |
); |
172 |
} |
173 |
|
159 |
$template->param( |
174 |
$template->param( |
160 |
patron => $patron, |
175 |
picture => $patron_image, |
161 |
housebound_profile => $houseboundprofile, |
176 |
housebound_profile => $houseboundprofile, |
162 |
visit => $houseboundvisit, |
177 |
visit => $houseboundvisit, |
163 |
branch => $branch, |
178 |
branch => $branch, |
164 |
- |
|
|