[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Koha-cvs] CVS: koha/C4 Print.pm,1.3.2.8,1.3.2.9 Scan.pm,1.1.1.1.2.2,1.1
From: |
Steve Tonnesen |
Subject: |
[Koha-cvs] CVS: koha/C4 Print.pm,1.3.2.8,1.3.2.9 Scan.pm,1.1.1.1.2.2,1.1.1.1.2.3 |
Date: |
Mon, 28 Oct 2002 11:56:37 -0800 |
Update of /cvsroot/koha/koha/C4
In directory usw-pr-cvs1:/tmp/cvs-serv2593/C4
Modified Files:
Tag: rel-1-2
Print.pm Scan.pm
Log Message:
Merging from trunk to rel-1-2
Index: Print.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Print.pm,v
retrieving revision 1.3.2.8
retrieving revision 1.3.2.9
diff -C2 -r1.3.2.8 -r1.3.2.9
*** Print.pm 28 Oct 2002 18:24:23 -0000 1.3.2.8
--- Print.pm 28 Oct 2002 19:56:02 -0000 1.3.2.9
***************
*** 31,61 ****
$VERSION = 0.01;
@ISA = qw(Exporter);
@EXPORT = qw(&remoteprint &printreserve &printslip);
sub remoteprint {
my ($env,$items,$borrower)address@hidden;
(return) unless (C4::Context->preference('printcirculationslips'));
! my $file=time;
my $queue = $env->{'queue'};
if ($queue eq "" || $queue eq 'nulllp') {
open (PRINTER,">/tmp/kohaiss");
! } else {
! open(PRINTER, "| lpr -P $queue >/dev/null") or die "Couldn't write to
queue:$queue!\n";
! }
#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: address@hidden";
print PRINTER "$borrower->{'cardnumber'}\r\n";
print PRINTER "$borrower->{'title'} $borrower->{'initials'}
$borrower->{'surname'}\r\n";
while ($items->[$i]){
my $itemdata = $items->[$i];
print PRINTER "$i $itemdata->{'title'}\r\n";
print PRINTER "$itemdata->{'barcode'}";
--- 31,117 ----
$VERSION = 0.01;
+ =head1 NAME
+
+ C4::Print - Koha module dealing with printing
+
+ =head1 SYNOPSIS
+
+ use C4::Print;
+
+ =head1 DESCRIPTION
+
+ The functions in this module handle sending text to a printer.
+
+ =head1 FUNCTIONS
+
+ =over 2
+
+ =cut
+
@ISA = qw(Exporter);
@EXPORT = qw(&remoteprint &printreserve &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)address@hidden;
(return) unless (C4::Context->preference('printcirculationslips'));
! 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 > /dev/null") 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: address@hidden";
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,71 ****
if ($env->{'printtype'} eq "docket"){
#print chr(27).chr(105);
! }
close PRINTER;
#system("lpr /tmp/$file");
--- 123,127 ----
if ($env->{'printtype'} eq "docket"){
#print chr(27).chr(105);
! }
close PRINTER;
#system("lpr /tmp/$file");
***************
*** 113,118 ****
}
sub printslip {
- warn "PRINTSLIP\n";
my($env, $slip)address@hidden;
my $printer = $env->{'printer'};
--- 169,186 ----
}
+ =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
+ #'
+ # FIXME - There's also a &printslip in circ/circulation.pl
sub printslip {
my($env, $slip)address@hidden;
my $printer = $env->{'printer'};
***************
*** 128,131 ****
END { } # module clean-up code here (global destructor)
!
!
--- 196,212 ----
END { } # module clean-up code here (global destructor)
!
! 1;
! __END__
!
! =back
!
! =head1 AUTHOR
!
! Koha Developement team <address@hidden>
!
! =head1 SEE ALSO
!
! C4::Circulation::Circ2(3)
!
! =cut
Index: Scan.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Scan.pm,v
retrieving revision 1.1.1.1.2.2
retrieving revision 1.1.1.1.2.3
diff -C2 -r1.1.1.1.2.2 -r1.1.1.1.2.3
*** Scan.pm 14 Aug 2002 18:30:50 -0000 1.1.1.1.2.2
--- Scan.pm 28 Oct 2002 19:56:03 -0000 1.1.1.1.2.3
***************
*** 27,37 ****
$VERSION = 0.01;
@ISA = qw(Exporter);
@EXPORT = qw(&getbarcode);
sub Getbarcode {
}
END { } # module clean-up code here (global destructor)
-
-
--- 27,50 ----
$VERSION = 0.01;
+ =head1 NAME
+
+ C4::Scan - Does nothing
+
+ =head1 SYNOPSIS
+
+ use C4::Scan;
+
+ =head1 DESCRIPTION
+
+ This module doesn't do anything.
+
+ =cut
+
@ISA = qw(Exporter);
@EXPORT = qw(&getbarcode);
+ # FIXME - Never used
sub Getbarcode {
}
END { } # module clean-up code here (global destructor)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Koha-cvs] CVS: koha/C4 Print.pm,1.3.2.8,1.3.2.9 Scan.pm,1.1.1.1.2.2,1.1.1.1.2.3,
Steve Tonnesen <=