From 0eb65d1902046ee8c8964361947fa2340701c3f8 Mon Sep 17 00:00:00 2001 From: Chris Nighswonger Date: Tue, 9 Feb 2010 08:35:58 -0500 Subject: [PATCH] Bugfix: Uncommenting pagination code Pagination code was commented out during development causing the spill over page one to be wrapped back onto page one. This patch fixes that problem. Signed-off-by: Galen Charlton --- C4/Creators/Template.pm | 1 - patroncards/create-pdf.pl | 8 ++++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/C4/Creators/Template.pm b/C4/Creators/Template.pm index 6e943358bb..9ae486b44d 100644 --- a/C4/Creators/Template.pm +++ b/C4/Creators/Template.pm @@ -271,7 +271,6 @@ sub get_next_label_pos { $current_label->{'llx'} = $self->get_attr('left_margin'); if ($current_label->{'row_count'} eq $self->get_attr('rows')) { $new_page = 1; - #$pdf->Page(); # after invoking this method, the calling script should check row, col and if they are both one then insert a new pdf page $current_label->{'lly'} = ($self->get_attr('page_height') - $self->get_attr('top_margin') - $self->get_attr('label_height')); $current_label->{'row_count'} = 1; } diff --git a/patroncards/create-pdf.pl b/patroncards/create-pdf.pl index 02ba79348a..eb768e096b 100755 --- a/patroncards/create-pdf.pl +++ b/patroncards/create-pdf.pl @@ -41,7 +41,8 @@ my $start_label = $cgi->param('start_label') || 1; my @label_ids = $cgi->param('label_id') if $cgi->param('label_id'); my @borrower_numbers = $cgi->param('borrower_number') if $cgi->param('borrower_number'); -my $items = undef; # items = cards +my $items = undef; # items = cards +my $new_page = 0; my $pdf_file = (@label_ids || @borrower_numbers ? "card_single_" . scalar(@label_ids || @borrower_numbers) : "card_batch_$batch_id"); print $cgi->header( -type => 'application/pdf', @@ -101,7 +102,6 @@ if ($layout_xml->{'page_side'} eq 'B') { # rearrange items on backside of page t CARD_ITEMS: foreach my $item (@{$items}) { - my $new_page = 0; #FIXME: this needs to be implimented or removed if ($item) { my $borrower_number = $item->{'borrower_number'}; my $card_number = GetMember(borrowernumber => $borrower_number)->{'cardnumber'}; @@ -193,11 +193,11 @@ foreach my $item (@{$items}) { $patron_card->draw_text($pdf); } ($llx, $lly, $new_page) = $template->get_next_label_pos(); - #$pdf->Page() if $new_page; + $pdf->Page() if $new_page; } $pdf->End(); # FIXME: Possibly do a redirect here if there were error encountered during PDF creation. -exit 0; +1; -- 2.39.5