[Koha-cvs] koha/barcodes label-print-pdf.pl [rel_2_2]

Mason James szrj1m at yahoo.com
Tue Aug 1 01:41:01 CEST 2006


CVSROOT:	/sources/koha
Module name:	koha
Branch:		rel_2_2
Changes by:	Mason James <sushi>	06/07/31 23:41:01

Modified files:
	barcodes       : label-print-pdf.pl 

Log message:
	replacing hard-coded values with vars. 

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/barcodes/label-print-pdf.pl?cvsroot=koha&only_with_tag=rel_2_2&r1=1.1.2.10&r2=1.1.2.11

Patches:
Index: label-print-pdf.pl
===================================================================
RCS file: /sources/koha/koha/barcodes/label-print-pdf.pl,v
retrieving revision 1.1.2.10
retrieving revision 1.1.2.11
diff -u -b -r1.1.2.10 -r1.1.2.11
--- label-print-pdf.pl	31 Jul 2006 23:29:48 -0000	1.1.2.10
+++ label-print-pdf.pl	31 Jul 2006 23:41:01 -0000	1.1.2.11
@@ -68,7 +68,8 @@
 prFontSize(9);
 
 my $margin       = 36;
-my $text_margin  = 10;
+my $top_text_margin  = 10;
+my $left_text_margin  = 3;
 my $label_height = 90;
 my $spine_width  = 72;
 my $circ_width   = 207;
@@ -78,6 +79,7 @@
 my $x_pos_circ2  = 369;
 my $pageheight   = 792;
 my $line_spacer  = 10;
+my $label_rows = 8;
 
 my $str;
 
@@ -96,7 +98,7 @@
 my $page_break_count = $startrow;
 my $codetype         = 'Code39';
 
-DrawBorder( 0, 0, 612, 792, );
+DrawBorder ( $lowerLeftX, $lowerLeftY, $upperRightX, $upperRightY );
 
 my $item;
 
@@ -129,14 +131,16 @@
         # add your printable fields manually in here
         my @fields =
           qw (dewey isbn classification itemtype subclass itemcallnumber);
-        my $vPos = ( $y_pos + ( $label_height - $text_margin ) );
-        my $hPos = ( 36 + 3 );
+        my $vPos = ( $y_pos + ( $label_height - $top_text_margin ) );
+        my $hPos = ( $x_pos_spine + $left_text_margin );
         foreach my $field (@fields) {
 
             # if the display option for this field is selected in the DB,
             # and the item record has some values for this field, display it.
             if ( $conf_data->{"$field"} && $item->{"$field"} ) {
 
+warn "CONF_TYPE = $field";
+
                 # get the string
                 $str = $item->{"$field"};
 
@@ -168,7 +172,7 @@
     #-----------------draw spine text
 
     # the gaylord labels have 8 rows per sheet, this pagebreaks after 8 rows
-    if ( $page_break_count == 8 ) {
+    if ( $page_break_count == $label_rows ) {
         prPage();
         $page_break_count = 0;
         $i2               = 0;





More information about the Koha-cvs mailing list