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 under the
10 # terms of the GNU General Public License as published by the Free Software
11 # Foundation; either version 2 of the License, or (at your option) any later
14 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
15 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
16 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License along with
19 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
20 # Suite 330, Boston, MA 02111-1307 USA
30 use C4::Dates qw/format_date/;
34 my $borrowernumber = $input->param('borrowernumber');
36 my $borrower = GetMember(borrowernumber => $borrowernumber);
38 my ($template, $loggedinuser, $cookie)
39 = get_template_and_user({template_name => "members/notices.tmpl",
43 flagsrequired => {borrowers => 1},
47 $template->param( $borrower );
48 my ($picture, $dberror) = GetPatronImage($borrower->{'cardnumber'});
49 $template->param( picture => 1 ) if $picture;
51 # Getting the messages
52 my $queued_messages = C4::Letters::GetQueuedMessages({$borrowernumber});
54 warn Data::Dumper::Dumper( $queued_messages );
56 QUEUED_MESSAGES => $queued_messages,
57 BORROWER_INFO => [ $borrower ],
58 firstname => $borrower->{'firstname'},
59 surname => $borrower->{'surname'},
60 borrowernumber => $borrowernumber,
63 output_html_with_http_headers $input, $cookie, $template->output;