Bug 21637: Fixed upercase letter in EasyAnalyticalRecords syspref
[koha.git] / C4 / Print.pm
blobd0f2642412fc576754884965b2004699b19b679f
1 package C4::Print;
3 # Copyright 2000-2002 Katipo Communications
5 # This file is part of Koha.
7 # Koha is free software; you can redistribute it and/or modify it
8 # under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 3 of the License, or
10 # (at your option) any later version.
12 # Koha is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with Koha; if not, see <http://www.gnu.org/licenses>.
20 use strict;
21 #use warnings; FIXME - Bug 2505
22 use C4::Context;
24 use vars qw(@ISA @EXPORT);
26 BEGIN {
27 require Exporter;
28 @ISA = qw(Exporter);
29 @EXPORT = qw(&NetworkPrint);
32 =head1 NAME
34 C4::Print - Koha module dealing with printing
36 =head1 SYNOPSIS
38 use C4::Print;
40 =head1 DESCRIPTION
42 The functions in this module handle sending text to a printer.
44 =head1 FUNCTIONS
46 =head2 NetworkPrint
48 &NetworkPrint($text)
50 Queue some text for printing on the selected branch printer
52 =cut
54 sub NetworkPrint {
55 my ($text) = @_;
57 # FIXME - It'd be nifty if this could generate pretty PostScript.
59 my $queue = '';
61 # FIXME - If 'queue' is undefined or empty, then presumably it should
62 # mean "use the default queue", whatever the default is. Presumably
63 # the default depends on the physical location of the machine.
64 # FIXME - Perhaps "print to file" should be a supported option. Just
65 # set the queue to "file" (or " file", if real queues aren't allowed
66 # to have spaces in them). Or perhaps if $queue eq "" and
67 # $env->{file} ne "", then that should mean "print to $env->{file}".
69 my $fh;
70 if ( $queue eq "" || $queue eq 'nulllp' ) {
71 return;
72 #open( $fh, ">/tmp/kohaiss" );
74 else {
76 # FIXME - This assumes that 'lpr' exists, and works as expected.
77 # This is a reasonable assumption, but only because every other
78 # printing package has a wrapper script called 'lpr'. It'd still
79 # be better to be able to customize this.
80 open( $fh, "-|", "lpr -P $queue > /dev/null" )
81 or die "Couldn't write to queue:$queue!\n";
84 # print $queue;
85 #open (FILE,">/tmp/$file");
86 print $fh $text;
87 print $fh "\r\n" x 7 ;
88 close $fh;
90 #system("lpr /tmp/$file");
94 __END__
96 =head1 AUTHOR
98 Koha Development Team <http://koha-community.org/>
100 =head1 SEE ALSO
102 C4::Circulation::Circ2(3)
104 =cut