3 # Displays sent notices for a given borrower
5 # Copyright (c) 2009 BibLibre
7 # This file is part of Koha.
9 # Koha is free software; you can redistribute it and/or modify it
10 # under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; either version 3 of the License, or
12 # (at your option) any later version.
14 # Koha is distributed in the hope that it will be useful, but
15 # WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with Koha; if not, see <http://www.gnu.org/licenses>.
23 #use warnings; FIXME - Bug 2505
30 use C4
::Members
::Attributes
qw(GetBorrowerAttributes);
32 use C4
::Dates qw
/format_date/;
36 my $borrowernumber = $input->param('borrowernumber');
38 my $borrower = GetMember
(borrowernumber
=> $borrowernumber);
40 my ($template, $loggedinuser, $cookie)
41 = get_template_and_user
({template_name
=> "members/notices.tt",
45 flagsrequired
=> {borrowers
=> 1},
49 $template->param( $borrower );
50 my ($picture, $dberror) = GetPatronImage
($borrower->{'borrowernumber'});
51 $template->param( picture
=> 1 ) if $picture;
53 # Getting the messages
54 my $queued_messages = C4
::Letters
::GetQueuedMessages
({borrowernumber
=> $borrowernumber});
56 if (C4
::Context
->preference('ExtendedPatronAttributes')) {
57 my $attributes = GetBorrowerAttributes
($borrowernumber);
59 ExtendedPatronAttributes
=> 1,
60 extendedattributes
=> $attributes
64 my $roadtype = C4
::Koha
::GetAuthorisedValueByCode
( 'ROADTYPE', $borrower->{'streettype'} );
65 $template->param(%$borrower);
68 QUEUED_MESSAGES
=> $queued_messages,
69 borrowernumber
=> $borrowernumber,
71 branchname
=> GetBranchName
($borrower->{'branchcode'}),
72 categoryname
=> $borrower->{'description'},
73 roadtype
=> $roadtype,
74 activeBorrowerRelationship
=> (C4
::Context
->preference('borrowerRelationship') ne ''),
75 RoutingSerials
=> C4
::Context
->preference('RoutingSerials'),
77 output_html_with_http_headers
$input, $cookie, $template->output;