Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Bug 8442 - labels creator fixes for plack

- remove all exit(1) and replace them with __END__ which benefits CGI
- insert correct =cut markers at end of POD (required for CGI::Compile
  under plack to correctly parse source code and exeute it)
- scope variables with our which are used inside sub for plack

Signed-off-by: Mirko Tietgen <5p4m@gmx.de>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
  • Loading branch information...
commit 664ecc9acadc47d990f80c98f5df44de9a7d664d 1 parent 217fef5
@dpavlin dpavlin authored PaulPoulain committed
View
5 labels/label-create-csv.pl
@@ -72,7 +72,6 @@
my $csv = Text::CSV_XS->new();
-CSV_ITEMS:
foreach my $item (@$items) {
my $label = C4::Labels::Label->new(
batch_id => $batch_id,
@@ -85,11 +84,10 @@
}
else {
warn sprintf('Text::CSV_XS->combine() returned the following error: %s', $csv->error_input);
- next CSV_ITEMS;
}
}
-exit(1);
+__END__
=head1 NAME
@@ -122,3 +120,4 @@ =head1 DISCLAIMER OF WARRANTY
Koha is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+=cut
View
6 labels/label-create-pdf.pl
@@ -58,9 +58,9 @@
-attachment => "$pdf_file.pdf",
);
-my $pdf = C4::Creators::PDF->new(InitVars => 0);
+our $pdf = C4::Creators::PDF->new(InitVars => 0);
my $batch = C4::Labels::Batch->retrieve(batch_id => $batch_id);
-my $template = C4::Labels::Template->retrieve(template_id => $template_id, profile_id => 1);
+our $template = C4::Labels::Template->retrieve(template_id => $template_id, profile_id => 1);
my $layout = C4::Labels::Layout->retrieve(layout_id => $layout_id);
sub _calc_next_label_pos {
@@ -205,7 +205,7 @@ sub _print_text {
$pdf->End();
-exit(1);
+__END__
=head1 NAME
View
4 labels/label-create-xml.pl
@@ -74,7 +74,6 @@
my $item_count = 0;
-XML_ITEMS:
foreach my $item (@$items) {
push(@{$xml_data->{'label'}}, {'item_number' => $item->{'item_number'}});
my $label = C4::Labels::Label->new(
@@ -98,7 +97,7 @@
#die "XML OUT:\n" . Dumper($xml_out);
print $xml_out;
-exit(1);
+__END__
=head1 NAME
@@ -132,3 +131,4 @@ =head1 DISCLAIMER OF WARRANTY
Koha is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+=cut
Please sign in to comment.
Something went wrong with that request. Please try again.