View | Details | Raw Unified | Return to bug 5670
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/housebound.tt (-10 / +1 lines)
Lines 1-15 Link Here
1
[% USE Koha %]
1
[% USE Koha %]
2
[% USE KohaDates %]
2
[% USE KohaDates %]
3
[% USE AuthorisedValues %]
3
[% USE AuthorisedValues %]
4
[% borrowernumber = patron.borrowernumber %]
5
[% branchname = branch.branchname %]
6
[% categoryname = category.description %]
7
[% categorycode = category.categorycode %]
8
[% category_type = category.category_type %]
9
[% firstname = patron.firstname %]
10
[% surname = patron.surname %]
11
[% othernames = patron.othernames %]
12
[% invert_name = 0 %]
13
[% INCLUDE 'doc-head-open.inc' %]
4
[% INCLUDE 'doc-head-open.inc' %]
14
<title>Koha &rsaquo; Housebound &rsaquo; Details for [% INCLUDE 'patron-title.inc' %]</title>
5
<title>Koha &rsaquo; Housebound &rsaquo; Details for [% INCLUDE 'patron-title.inc' %]</title>
15
[% INCLUDE 'doc-head-close.inc' %]
6
[% INCLUDE 'doc-head-close.inc' %]
Lines 37-43 Link Here
37
        <div class="yui-g">
28
        <div class="yui-g">
38
29
39
          <!-- Title -->
30
          <!-- Title -->
40
          <h3>Housebound details for [% patron.title %] [% patron.firstname %] [% patron.surname %] ([% patron.cardnumber %])</h3>
31
          <h3>Housebound details for [% INCLUDE 'patron-title.inc' %]</h3>
41
          <div class="first">
32
          <div class="first">
42
33
43
            [% FOR m IN messages %]
34
            [% FOR m IN messages %]
(-)a/members/housebound.pl (-4 / +18 lines)
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
- 

Return to bug 5670