[% USE Koha %]
[% USE KohaDates %]
[% USE AuthorisedValues %]
-[% borrowernumber = patron.borrowernumber %]
-[% branchname = branch.branchname %]
-[% categoryname = category.description %]
-[% categorycode = category.categorycode %]
-[% category_type = category.category_type %]
-[% firstname = patron.firstname %]
-[% surname = patron.surname %]
-[% othernames = patron.othernames %]
-[% invert_name = 0 %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha › Housebound › Details for [% INCLUDE 'patron-title.inc' %]</title>
[% INCLUDE 'doc-head-close.inc' %]
<div class="yui-g">
<!-- Title -->
- <h3>Housebound details for [% patron.title %] [% patron.firstname %] [% patron.surname %] ([% patron.cardnumber %])</h3>
+ <h3>Housebound details for [% INCLUDE 'patron-title.inc' %]</h3>
<div class="first">
[% FOR m IN messages %]
use Modern::Perl;
use CGI;
use C4::Auth;
+use C4::Context;
+use C4::Members::Attributes qw(GetBorrowerAttributes);
use C4::Output;
use DateTime;
use Koha::DateUtils;
# Get patron
my $patron = eval {
my $borrowernumber = $input->param('borrowernumber') // q{};
- return Koha::Patrons->new->find($borrowernumber);
+ return Koha::Patrons->find($borrowernumber);
};
push @messages, { type => 'error', code => 'error_on_patron_load' }
if ( $@ or !$patron );
# Get supporting cast
-my ( $branch, $category, $houseboundprofile, $visit );
+my ( $branch, $category, $houseboundprofile, $visit, $patron_image );
if ( $patron ) {
+ $patron_image = Koha::Patron::Images->find($patron->borrowernumber);
$branch = Koha::Libraries->new->find($patron->branchcode);
$category = Koha::Patron::Categories->new->find($patron->categorycode);
$houseboundprofile = $patron->housebound_profile;
# We don't have any profile information, so we must display a creation form.
$method = 'update_or_create' if ( !$houseboundprofile );
+# Ensure template has all patron details.
+$template->param(%{$patron->unblessed}) if ( $patron );
+
+# Load extended patron attributes if necessary (taken from members/files.pl).
+if ( C4::Context->preference('ExtendedPatronAttributes') and $patron ) {
+ my $attributes = GetBorrowerAttributes($patron->borrowernumber);
+ $template->param(
+ ExtendedPatronAttributes => 1,
+ extendedattributes => $attributes
+ );
+}
+
$template->param(
- patron => $patron,
+ picture => $patron_image,
housebound_profile => $houseboundprofile,
visit => $houseboundvisit,
branch => $branch,