Quick Spine Label Printer - Minors fixes

This new version of the patch does away with the need for 2 spinelabel css files.

This patch address two points brought up:
[1] (minor) if an item is not found, it should say so and return to
spinelabel-home.pl, not show an empty label
[2] (minor) can the print button be excluded from the printout?

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
This commit is contained in:
Kyle M Hall 2009-08-03 16:26:26 +00:00 committed by Galen Charlton
parent eb849c690a
commit 9f3ecc8a29
2 changed files with 26 additions and 8 deletions

View file

@ -2,13 +2,26 @@
<head>
<title>Koha &rsaquo; Tools &rsaquo; Spine Labels</title>
<link rel="stylesheet" type="text/css" href="<!-- TMPL_VAR name="themelang" -->/css/spinelabel.css" />
<style type="text/css">
@media print {
.noprint { display: none; }
}
</style>
</head>
<body <!-- TMPL_IF NAME="autoprint">onLoad="window.print()"<!-- /TMPL_IF> >
<span id="spinelabel" class="label">
<!-- TMPL_VAR NAME="content" -->
</span>
<span id="print_button">
<form><input type="button" value="Print This Label" onClick="window.print()" /></form>
</span>
</body>
<!-- TMPL_IF NAME="BarcodeNotFound" -->
<body>
<p>The barcode <!-- TMPL_VAR NAME="Barcode" --> was not found.</p>
<p><a href="spinelabel-home.pl">Return To Spine Label Printer</a></p>
</body>
<!-- TMPL_ELSE -->
<body <!-- TMPL_IF NAME="autoprint">onLoad="window.print()"<!-- /TMPL_IF> >
<span id="spinelabel" class="label">
<!-- TMPL_VAR NAME="content" -->
</span>
<span id="print_button" class="noprint">
<form><input type="button" value="Print This Label" onClick="window.print()" /></form>
</span>
</body>
<!-- /TMPL_IF -->
</html>

View file

@ -48,6 +48,11 @@ $sth = $dbh->prepare($sql);
$sth->execute($barcode);
$item = $sth->fetchrow_hashref;
if ( $item->{'itemnumber'} eq '' ) {
$template->param( 'Barcode' => $barcode );
$template->param( 'BarcodeNotFound' => 1 );
}
my $body;
my $data;