[Koha-cvs] CVS: koha/C4 Print.pm,1.9,1.10
Andrew Arensburger
arensb at users.sourceforge.net
Mon Sep 23 15:54:57 CEST 2002
Update of /cvsroot/koha/koha/C4
In directory usw-pr-cvs1:/tmp/cvs-serv12439
Modified Files:
Print.pm
Log Message:
Added POD.
Index: Print.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Print.pm,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** Print.pm 20 Aug 2002 22:40:12 -0000 1.9
--- Print.pm 23 Sep 2002 13:54:54 -0000 1.10
***************
*** 28,34 ****
$VERSION = 0.01;
@ISA = qw(Exporter);
! @EXPORT = qw(&remoteprint &printreserve &printslip);
sub remoteprint {
my ($env,$items,$borrower)=@_;
--- 28,73 ----
$VERSION = 0.01;
+ =head1 NAME
+
+ C4::Print - FIXME
+
+ =head1 SYNOPSIS
+
+ use C4::Print;
+
+ =head1 DESCRIPTION
+
+ FIXME
+
+ =head1 FUNCTIONS
+
+ =over 2
+
+ =cut
+
@ISA = qw(Exporter);
! @EXPORT = qw(&remoteprint &printslip);
!
! =item remoteprint
!
! &remoteprint($env, $items, $borrower);
!
! Prints the list of items in C<$items> to a printer.
!
! C<$env> is a reference-to-hash. C<$env-E<gt>{queue}> specifies the
! queue to print to; if it is empty or has the special value C<nulllp>,
! C<&remoteprint> will print to the file F</tmp/kohaiss>.
!
! C<$borrower> is a reference-to-hash giving information about a patron.
! This may be gotten from C<&getpatroninformation>. The patron's name
! will be printed in the output.
!
! C<$items> is a reference-to-list, where each element is a
! reference-to-hash describing a borrowed item. C<$items> may be gotten
! from C<¤tissues>.
+ =cut
+ #'
+ # FIXME - It'd be nifty if this could generate pretty PostScript.
sub remoteprint {
my ($env,$items,$borrower)=@_;
***************
*** 37,61 ****
#close FILE;
#debug_msg($env,"In print");
! my $file=time;
my $queue = $env->{'queue'};
if ($queue eq "" || $queue eq 'nulllp') {
open (PRINTER,">/tmp/kohaiss");
! } else {
open(PRINTER, "| lpr -P $queue") or die "Couldn't write to queue:$queue!\n";
! }
# print $queue;
#open (FILE,">/tmp/$file");
my $i=0;
! my $brdata = $env->{'brdata'};
print PRINTER "Horowhenua Library Trust\r\n";
# print PRINTER "$brdata->{'branchname'}\r\n";
! print PRINTER "Phone: 368-1953\r\n";
! print PRINTER "Fax: 367-9218\r\n";
print PRINTER "Email: renewals\@library.org.nz\r\n\r\n\r\n";
print PRINTER "$borrower->{'cardnumber'}\r\n";
print PRINTER "$borrower->{'title'} $borrower->{'initials'} $borrower->{'surname'}\r\n";
while ($items->[$i]){
# print $i;
my $itemdata = $items->[$i];
print PRINTER "$i $itemdata->{'title'}\r\n";
print PRINTER "$itemdata->{'barcode'}";
--- 76,116 ----
#close FILE;
#debug_msg($env,"In print");
! my $file=time; # FIXME - Not used
my $queue = $env->{'queue'};
+ # FIXME - If 'queue' is undefined or empty, then presumably it should
+ # mean "use the default queue", whatever the default is. Presumably
+ # the default depends on the physical location of the machine.
+ # FIXME - Perhaps "print to file" should be a supported option. Just
+ # set the queue to "file" (or " file", if real queues aren't allowed
+ # to have spaces in them). Or perhaps if $queue eq "" and
+ # $env->{file} ne "", then that should mean "print to $env->{file}".
if ($queue eq "" || $queue eq 'nulllp') {
open (PRINTER,">/tmp/kohaiss");
! } else {
! # FIXME - This assumes that 'lpr' exists, and works as expected.
! # This is a reasonable assumption, but only because every other
! # printing package has a wrapper script called 'lpr'. It'd still
! # be better to be able to customize this.
open(PRINTER, "| lpr -P $queue") or die "Couldn't write to queue:$queue!\n";
! }
# print $queue;
#open (FILE,">/tmp/$file");
my $i=0;
! my $brdata = $env->{'brdata'}; # FIXME - Not used
! # FIXME - This is HLT-specific. Put this stuff in a customizable
! # site-specific file somewhere.
print PRINTER "Horowhenua Library Trust\r\n";
# print PRINTER "$brdata->{'branchname'}\r\n";
! print PRINTER "Phone: 368-1953\r\n";
! print PRINTER "Fax: 367-9218\r\n";
print PRINTER "Email: renewals\@library.org.nz\r\n\r\n\r\n";
print PRINTER "$borrower->{'cardnumber'}\r\n";
print PRINTER "$borrower->{'title'} $borrower->{'initials'} $borrower->{'surname'}\r\n";
+ # FIXME - Use for ($i = 0; $items->[$i]; $i++)
+ # Or better yet, foreach $item (@{$items})
while ($items->[$i]){
# print $i;
my $itemdata = $items->[$i];
+ # FIXME - This is just begging for a Perl format.
print PRINTER "$i $itemdata->{'title'}\r\n";
print PRINTER "$itemdata->{'barcode'}";
***************
*** 67,76 ****
if ($env->{'printtype'} eq "docket"){
#print chr(27).chr(105);
! }
close PRINTER;
#system("lpr /tmp/$file");
}
sub printslip {
my($env, $slip)=@_;
--- 122,142 ----
if ($env->{'printtype'} eq "docket"){
#print chr(27).chr(105);
! }
close PRINTER;
#system("lpr /tmp/$file");
}
+ =item printslip
+
+ &printslip($env, $text)
+ Prints the string C<$text> to a printer. C<$env-E<gt>{queue}>
+ specifies the queue to print to.
+
+ If C<$env-E<gt>{queue}> is empty or set to C<nulllp>, C<&printslip>
+ will print to the file F</tmp/kohares>.
+
+ =cut
+ #'
sub printslip {
my($env, $slip)=@_;
***************
*** 86,89 ****
END { } # module clean-up code here (global destructor)
!
!
--- 152,170 ----
END { } # module clean-up code here (global destructor)
!
! 1;
! __END__
!
! =back
!
! =head1 AUTHOR
!
! Koha Developement team <info at koha.org>
!
! =head1 SEE ALSO
!
! L<perl>.
!
! L<C4::Circulation::Circ2(3)>
!
! =cut
More information about the Koha-cvs
mailing list