Bugfix: Remove Debian packaging files remaining from old packaging effort.
[koha.git] / patroncards / create-pdf.pl
index 656c31f..5604f17 100755 (executable)
@@ -13,9 +13,9 @@
 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
 # A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
 #
-# You should have received a copy of the GNU General Public License along with
-# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
-# Suite 330, Boston, MA  02111-1307 USA
+# You should have received a copy of the GNU General Public License along
+# with Koha; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 use strict;
 use warnings;
@@ -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'};
@@ -120,7 +120,7 @@ foreach my $item (@{$items}) {
                 layout                  => $layout_xml,
                 text_wrap_cols          => 30, #FIXME: hardcoded
         );
-        $patron_card->draw_guide_box($pdf);
+        $patron_card->draw_guide_box($pdf) if $layout_xml->{'guide_box'};
         $patron_card->draw_barcode($pdf) if $layout_xml->{'barcode'};
 
 #       Do image foo and place binary image data into layout hash
@@ -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;