From 1e97c662b573b962a69ffa39be790555e4dd47f0 Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Wed, 8 Feb 2012 14:47:53 +0100 Subject: [PATCH] bounce browser to printer URL and return with station This allows us to recurect to printer REST API, send ZPL file to printer and return to Koha with station/printer IP address to record in log. --- labels/spinelabel-print.pl | 49 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/labels/spinelabel-print.pl b/labels/spinelabel-print.pl index d1e81ea14b..c72284052e 100755 --- a/labels/spinelabel-print.pl +++ b/labels/spinelabel-print.pl @@ -52,6 +52,35 @@ unless (defined $item) { $template->param( 'BarcodeNotFound' => 1 ); } +# XXX FFZG #1059 -- dpavlin 2012-02-07 print spine labels + +use URI::Escape; + +my $ip = $query->remote_addr; + +if ( my $station = $query->param('station') ) { + + warn "PRINTED $barcode on $station\n"; + + my $insert = $dbh->prepare(qq{ + insert into items_print_log (barcode,itemnumber,station) values (?,?,?) + }); + $insert->execute( $item->{barcode}, $item->{biblioitemnumber}, $station ); + +} else { + + my $print_data = join(' ', + $item->{barcode}, + $item->{itemcallnumber}, + ); + + print $query->redirect( 'http://printer-zebra.vbz.ffzg.hr/print.cgi?print=' . uri_escape($print_data) . '&return=' . uri_escape($query->self_url) ); + exit 0; + +} + +# XXX /FFZG + my $body; my $data; @@ -84,6 +113,26 @@ while ( my ( $key, $value ) = each(%$data) ) { $body = $scheme; +# XXX FFZG + +$body .= qq| + + +|; + +# XXX /FFZG + $template->param( autoprint => C4::Context->preference("SpineLabelAutoPrint") ); $template->param( content => $body ); -- 2.20.1