View | Details | Raw Unified | Return to bug 8056
Collapse All | Expand All

(-)a/C4/Members.pm (-1 lines)
Lines 997-1003 sub GetPendingIssues { Link Here
997
    # must avoid biblioitems.* to prevent large marc and marcxml fields from killing performance
997
    # must avoid biblioitems.* to prevent large marc and marcxml fields from killing performance
998
    # FIXME: namespace collision: each table has "timestamp" fields.  Which one is "timestamp" ?
998
    # FIXME: namespace collision: each table has "timestamp" fields.  Which one is "timestamp" ?
999
    # FIXME: circ/ciculation.pl tries to sort by timestamp!
999
    # FIXME: circ/ciculation.pl tries to sort by timestamp!
1000
    # FIXME: C4::Print::printslip tries to sort by timestamp!
1001
    # FIXME: namespace collision: other collisions possible.
1000
    # FIXME: namespace collision: other collisions possible.
1002
    # FIXME: most of this data isn't really being used by callers.
1001
    # FIXME: most of this data isn't really being used by callers.
1003
    my $query =
1002
    my $query =
(-)a/C4/Print.pm (-36 / +7 lines)
Lines 28-34 BEGIN { Link Here
28
	$VERSION = 3.01;
28
	$VERSION = 3.01;
29
	require Exporter;
29
	require Exporter;
30
	@ISA    = qw(Exporter);
30
	@ISA    = qw(Exporter);
31
	@EXPORT = qw(&printslip);
31
	@EXPORT = qw(&NetworkPrint);
32
}
32
}
33
33
34
=head1 NAME
34
=head1 NAME
Lines 45-89 The functions in this module handle sending text to a printer. Link Here
45
45
46
=head1 FUNCTIONS
46
=head1 FUNCTIONS
47
47
48
=cut
48
=head2 NetworkPrint
49
50
=for comment
51
    my $slip = <<"EOF";
52
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
53
Date: $todaysdate;
54
55
ITEM RESERVED:
56
$itemdata->{'title'} ($itemdata->{'author'})
57
barcode: $itemdata->{'barcode'}
58
59
COLLECT AT: $branchname
60
61
BORROWER:
62
$bordata->{'surname'}, $bordata->{'firstname'}
63
card number: $bordata->{'cardnumber'}
64
Phone: $bordata->{'phone'}
65
$bordata->{'streetaddress'}
66
$bordata->{'suburb'}
67
$bordata->{'town'}
68
$bordata->{'emailaddress'}
69
49
50
  &NetworkPrint($text)
70
51
71
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
52
Queue some text for printing on the selected branch printer
72
EOF
73
=cut
74
75
=head2 printslip
76
77
  &printslip($slip)
78
79
print a slip for the given $borrowernumber and $branchcode
80
53
81
=cut
54
=cut
82
55
83
sub printslip ($) {
56
sub NetworkPrint {
84
    my ($slip) = @_;
57
    my ($text) = @_;
85
86
    return unless ( C4::Context->boolean_preference('printcirculationslips') );
87
58
88
# FIXME - It'd be nifty if this could generate pretty PostScript.
59
# FIXME - It'd be nifty if this could generate pretty PostScript.
89
60
Lines 112-118 sub printslip ($) { Link Here
112
83
113
    #  print $queue;
84
    #  print $queue;
114
    #open (FILE,">/tmp/$file");
85
    #open (FILE,">/tmp/$file");
115
    print PRINTER $slip;
86
    print PRINTER $text;
116
    print PRINTER "\r\n" x 7 ;
87
    print PRINTER "\r\n" x 7 ;
117
    close PRINTER;
88
    close PRINTER;
118
89
(-)a/circ/circulation.pl (-1 / +5 lines)
Lines 25-30 use strict; Link Here
25
use warnings;
25
use warnings;
26
use CGI;
26
use CGI;
27
use C4::Output;
27
use C4::Output;
28
use C4::Print;
28
use C4::Auth qw/:DEFAULT get_session/;
29
use C4::Auth qw/:DEFAULT get_session/;
29
use C4::Dates qw/format_date/;
30
use C4::Dates qw/format_date/;
30
use C4::Branch; # GetBranches
31
use C4::Branch; # GetBranches
Lines 172-178 if ( $barcode eq '' && $query->param('charges') eq 'yes' ) { Link Here
172
}
173
}
173
174
174
if ( $print eq 'yes' && $borrowernumber ne '' ) {
175
if ( $print eq 'yes' && $borrowernumber ne '' ) {
175
    PrintIssueSlip($session->param('branch') || $branch, $borrowernumber);
176
    if ( C4::Context->boolean_preference('printcirculationslips') ) {
177
        my $letter = IssueSlip($branch, $borrowernumber, "QUICK");
178
        NetworkPrint($letter->{content});
179
    }
176
    $query->param( 'borrowernumber', '' );
180
    $query->param( 'borrowernumber', '' );
177
    $borrowernumber = '';
181
    $borrowernumber = '';
178
}
182
}
(-)a/t/db_dependent/lib/KohaTest/Print.pm (-2 / +1 lines)
Lines 12-18 sub testing_class { 'C4::Print' }; Link Here
12
12
13
sub methods : Test( 1 ) {
13
sub methods : Test( 1 ) {
14
    my $self = shift;
14
    my $self = shift;
15
    my @methods = qw( printslip );
15
    my @methods = qw( NetworkPrint );
16
    
16
    
17
    can_ok( $self->testing_class, @methods );    
17
    can_ok( $self->testing_class, @methods );    
18
}
18
}
19
- 

Return to bug 8056