use Modern::Perl;
use CGI qw ( -utf8 );
-use C4::Auth;
-use C4::Output;
+use C4::Auth qw( get_template_and_user );
+use C4::Output qw( output_html_with_http_headers );
my $scheme = C4::Context->preference('SpineLabelFormat');
my $query = CGI->new;
query => $query,
type => "intranet",
flagsrequired => { catalogue => 1 },
- debug => 1,
}
);
$sth->execute($barcode);
$item = $sth->fetchrow_hashref;
-unless (defined $item) {
- $template->param( 'Barcode' => $barcode );
- $template->param( 'BarcodeNotFound' => 1 );
-}
+$template->param(
+ Barcode => $barcode,
+ BarcodeNotFound => 1,
+) unless defined $item;
my $body;
$body = $scheme;
-$template->param( autoprint => C4::Context->preference("SpineLabelAutoPrint") );
-$template->param( content => $body );
+$template->param(
+ autoprint => C4::Context->preference("SpineLabelAutoPrint"),
+ content => $body,
+ itemholdingbranch => $item->{holdingbranch},
+ itemhomebranch => $item->{homebranch},
+);
output_html_with_http_headers $query, $cookie, $template->output;