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
30 use C4::Dates qw/format_date/;
34 my $borrowernumber=$input->param('borrowernumber');
36 my $data=GetMember($borrowernumber,'borrowernumber');
37 my $order=$input->param('order');
40 $order2="date_due desc";
42 my $limit=$input->param('limit');
45 if ($limit eq 'full'){
52 my ($count,$issues)=GetAllIssues($borrowernumber,$order2,$limit);
54 my ($template, $loggedinuser, $cookie)
55 = get_template_and_user({template_name => "members/readingrec.tmpl",
59 flagsrequired => {borrowers => 1},
65 for (my $i=0;$i<$count;$i++){
70 $line{biblionumber}=$issues->[$i]->{'biblionumber'};
71 $line{title}=$issues->[$i]->{'title'};
72 $line{author}=$issues->[$i]->{'author'};
73 $line{classification} = $issues->[$i]->{'classification'};
74 $line{date_due}=format_date($issues->[$i]->{'date_due'});
75 $line{returndate}=format_date($issues->[$i]->{'returndate'});
76 $line{volumeddesc}=$issues->[$i]->{'volumeddesc'};
77 push(@loop_reading,\%line);
80 if ( $data->{'category_type'} eq 'C') {
81 my ( $catcodes, $labels ) = GetborCatFromCatType( 'A', 'WHERE category_type = ?' );
82 my $cnt = scalar(@$catcodes);
83 $template->param( 'CATCODE_MULTI' => 1) if $cnt > 1;
84 $template->param( 'catcode' => $catcodes->[0]) if $cnt == 1;
87 $template->param( adultborrower => 1 ) if ( $data->{'category_type'} eq 'A' );
92 my ($picture, $dberror) = GetPatronImage($data->{'cardnumber'});
93 $template->param( picture => 1 ) if $picture;
96 readingrecordview => 1,
97 biblionumber => $data->{'biblionumber'},
98 title => $data->{'title'},
99 initials => $data->{'initials'},
100 surname => $data->{'surname'},
101 borrowernumber => $borrowernumber,
103 firstname => $data->{'firstname'},
104 cardnumber => $data->{'cardnumber'},
105 categorycode => $data->{'categorycode'},
106 category_type => $data->{'category_type'},
107 # category_description => $data->{'description'},
108 categoryname => $data->{'description'},
109 address => $data->{'address'},
110 address2 => $data->{'address2'},
111 city => $data->{'city'},
112 zipcode => $data->{'zipcode'},
113 phone => $data->{'phone'},
114 email => $data->{'email'},
115 branchcode => $data->{'branchcode'},
116 is_child => ($data->{'category_type'} eq 'C'),
117 branchname => GetBranchName($data->{'branchcode'}),
118 showfulllink => ($count > 50),
119 loop_reading => \@loop_reading);
120 output_html_with_http_headers $input, $cookie, $template->output;