bug 2473: correct display of items.content
[koha_fer] / labels / label-print-pdf.pl
index cb0939c..7d54a6f 100755 (executable)
@@ -36,6 +36,7 @@ my @resultsloop;
 
 #$DB::single = 1;
 
+my $batch_type   = $conf_data->{'type'};
 my $barcodetype  = $conf_data->{'barcodetype'};
 my $printingtype = $conf_data->{'printingtype'};
 my $guidebox     = $conf_data->{'guidebox'};
@@ -49,7 +50,7 @@ my $units        = $template->{'units'};
 if ($printingtype eq 'PATCRD') {
     @resultsloop = GetPatronCardItems($batch_id);
 } else {
-    @resultsloop = get_label_items($batch_id);
+    @resultsloop = GetLabelItems($batch_id);
 }
 
 #warn "UNITS $units";
@@ -221,7 +222,7 @@ foreach $item (@resultsloop) {
         DrawBarcode( $x_pos, $barcode_y, $barcode_height, $label_width,
             $item->{'barcode'}, $barcodetype );
         DrawSpineText( $x_pos, $y_pos, $label_height, $label_width, $fontname, $fontsize,
-            $left_text_margin, $text_wrap_cols, \$item, \$conf_data );
+            $left_text_margin, $text_wrap_cols, \$item, \$conf_data, $printingtype, '1' );
 
         CalcNextLabelPos();
 
@@ -232,7 +233,7 @@ foreach $item (@resultsloop) {
         DrawBarcode( $x_pos, $y_pos, $barcode_height, $label_width, $item->{'barcode'},
             $barcodetype );
         DrawSpineText( $x_pos, $y_pos, $label_height, $label_width, $fontname, $fontsize,
-            $left_text_margin, $text_wrap_cols, \$item, \$conf_data );
+            $left_text_margin, $text_wrap_cols, \$item, \$conf_data, $printingtype, '1' );
 
         CalcNextLabelPos();
     }
@@ -244,7 +245,7 @@ foreach $item (@resultsloop) {
         CalcNextLabelPos();
         drawbox( $x_pos, $y_pos, $label_width, $label_height ) if $guidebox;
         DrawSpineText( $x_pos, $y_pos, $label_height, $label_width, $fontname, $fontsize,
-            $left_text_margin, $text_wrap_cols, \$item, \$conf_data );
+            $left_text_margin, $text_wrap_cols, \$item, \$conf_data, $printingtype, '1' );
 
         CalcNextLabelPos();
     }
@@ -253,12 +254,11 @@ foreach $item (@resultsloop) {
     elsif ( $printingtype eq 'BIB' ) {
         drawbox( $x_pos, $y_pos, $label_width, $label_height ) if $guidebox;
         DrawSpineText( $x_pos, $y_pos, $label_height, $label_width, $fontname, $fontsize,
-            $left_text_margin, $text_wrap_cols, \$item, \$conf_data, $printingtype );
+            $left_text_margin, $text_wrap_cols, \$item, \$conf_data, $printingtype, '0' );
         CalcNextLabelPos();
     }
 
     elsif ( $printingtype eq 'PATCRD' ) {
-        my $borrowernumber = '3';       # Hardcoded for testing purposes...
         my $patron_data = $item;
 
         #FIXME: This needs to be paramatized and passed in from the user...