3 # Copyright 2000-2002 Katipo Communications
4 # Copyright 2010 BibLibre
6 # This file is part of Koha.
8 # Koha is free software; you can redistribute it and/or modify it
9 # under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 3 of the License, or
11 # (at your option) any later version.
13 # Koha is distributed in the hope that it will be useful, but
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with Koha; if not, see <http://www.gnu.org/licenses>.
24 script to do a borrower enquiry/bring up borrower details etc
25 Displays all the details about a borrower
26 written 20/12/99 by chris@katipo.co.nz
27 last modified 21/1/2000 by chris@katipo.co.nz
28 modified 31/1/2001 by chris@katipo.co.nz
29 to not allow items on request to be renewed
31 needs html removed and to use the C4::Output more, but its tricky
38 use C4::Auth qw/:DEFAULT get_session/;
45 my $sessionID = $input->cookie("CGISESSID");
46 my $session = get_session($sessionID);
48 my $print = $input->param('print');
49 my $error = $input->param('error');
51 # circ staff who process checkouts but can't edit
52 # patrons still need to be able to print receipts
53 my $flagsrequired = { circulate => "circulate_remaining_permissions" };
55 my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
57 template_name => "circ/printslip.tt",
60 flagsrequired => $flagsrequired,
64 my $borrowernumber = $input->param('borrowernumber');
66 my $logged_in_user = Koha::Patrons->find( $loggedinuser );
67 my $patron = Koha::Patrons->find( $borrowernumber );
68 output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } );
70 my $branch=C4::Context->userenv->{'branch'};
72 if ( $print eq 'checkinslip' ) {
73 my $checkinslip_branch = $session->param('branch') ? $session->param('branch') : $branch;
75 # get today's checkins
76 my @itemnumbers = $patron->old_checkouts->search( { branchcode => $checkinslip_branch } )
77 ->filter_by_todays_checkins->get_column('itemnumber');
80 old_issues => \@itemnumbers,
83 my $letter = C4::Letters::GetPreparedLetter(
84 module => 'circulation',
85 letter_code => 'CHECKINSLIP',
86 branchcode => $checkinslip_branch,
87 lang => $patron->lang,
89 branches => $checkinslip_branch,
90 borrowers => $borrowernumber,
93 message_transport_type => 'print'
96 $slip = $letter->{content};
97 $is_html = $letter->{is_html};
99 } elsif (my $letter = IssueSlip ($session->param('branch') || $branch, $borrowernumber, $print eq "qslip")) {
100 $slip = $letter->{content};
101 $is_html = $letter->{is_html};
107 borrowernumber => $borrowernumber,
109 stylesheet => C4::Context->preference("SlipCSS"),
113 $template->param( IntranetSlipPrinterJS => C4::Context->preference('IntranetSlipPrinterJS' ) );
115 output_html_with_http_headers $input, $cookie, $template->output;