4 # script to display borrowers reading record
6 # Copyright 2000-2002 Katipo Communications
8 # This file is part of Koha.
10 # Koha is free software; you can redistribute it and/or modify it under the
11 # terms of the GNU General Public License as published by the Free Software
12 # Foundation; either version 2 of the License, or (at your option) any later
15 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
16 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
17 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License along with
20 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
21 # Suite 330, Boston, MA 02111-1307 USA
29 use C4::Dates qw/format_date/;
33 my $borrowernumber=$input->param('borrowernumber');
35 my $data=GetMember($borrowernumber,'borrowernumber');
36 my $order=$input->param('order');
39 $order2="date_due desc";
41 my $limit=$input->param('limit');
44 if ($limit eq 'full'){
51 my ($count,$issues)=GetAllIssues($borrowernumber,$order2,$limit);
53 my ($template, $loggedinuser, $cookie)
54 = get_template_and_user({template_name => "members/readingrec.tmpl",
58 flagsrequired => {borrowers => 1},
64 for (my $i=0;$i<$count;$i++){
69 $line{biblionumber}=$issues->[$i]->{'biblionumber'};
70 $line{title}=$issues->[$i]->{'title'};
71 $line{author}=$issues->[$i]->{'author'};
72 $line{classification} = $issues->[$i]->{'classification'};
73 $line{date_due}=format_date($issues->[$i]->{'date_due'});
74 $line{returndate}=format_date($issues->[$i]->{'returndate'});
75 $line{volumeddesc}=$issues->[$i]->{'volumeddesc'};
76 push(@loop_reading,\%line);
79 my $borrowercategory = GetBorrowercategory( $data->{'categorycode'} );
80 my $category_type = $borrowercategory->{'category_type'};
81 ( $template->param( adultborrower => 1 ) ) if ( $category_type eq 'A' );
84 biblionumber => $data->{'biblionumber'},
85 title => $data->{'title'},
86 initials => $data->{'initials'},
87 surname => $data->{'surname'},
88 borrowernumber => $borrowernumber,
90 firstname => $data->{'firstname'},
91 cardnumber => $data->{'cardnumber'},
92 categorycode => $data->{'categorycode'},
93 category_type => $data->{'category_type'},
94 category_description => $data->{'description'},
95 address => $data->{'address'},
96 address2 => $data->{'address2'},
97 city => $data->{'city'},
98 zipcode => $data->{'zipcode'},
99 phone => $data->{'phone'},
100 email => $data->{'email'},
101 branchcode => $data->{'branchcode'},
102 showfulllink => ($count > 50),
103 loop_reading => \@loop_reading);
104 output_html_with_http_headers $input, $cookie, $template->output;