[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Koha-cvs] koha/C4 Labels.pm [dev_week]
From: |
Mason James |
Subject: |
[Koha-cvs] koha/C4 Labels.pm [dev_week] |
Date: |
Mon, 03 Sep 2007 23:07:07 +0000 |
CVSROOT: /sources/koha
Module name: koha
Branch: dev_week
Changes by: Mason James <sushi> 07/09/03 23:07:07
Modified files:
C4 : Labels.pm
Log message:
draw_text_block_manual2() rename, and tidyup after dev.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Labels.pm?cvsroot=koha&only_with_tag=dev_week&r1=1.3.4.45&r2=1.3.4.46
Patches:
Index: Labels.pm
===================================================================
RCS file: /sources/koha/koha/C4/Labels.pm,v
retrieving revision 1.3.4.45
retrieving revision 1.3.4.46
diff -u -b -r1.3.4.45 -r1.3.4.46
--- Labels.pm 28 Aug 2007 12:06:58 -0000 1.3.4.45
+++ Labels.pm 3 Sep 2007 23:07:07 -0000 1.3.4.46
@@ -27,7 +27,7 @@
use Algorithm::CheckDigits;
# use Data::Dumper;
-use Smart::Comments '####';
+# use Smart::Comments '####';
$VERSION = 0.01;
@@ -54,8 +54,7 @@
&GetSingleLabelTemplate &SaveTemplate
&CreateTemplate &SetActiveTemplate
&SaveConf &DrawSpineText
- &DrawSpineTextManual draw_text_block_manual
- draw_text_block_manual2
+ draw_text_block_manual
&GetTextWrapCols
&GetUnitsValue &DrawBarcode
@@ -703,81 +702,13 @@
sub draw_text_block_manual {
my (
- $x_pos, $y_pos, $label_height,
- $fontsize, $gutter, $text_wrap_cols,
- @fields, $no_wrap, $justify
+ $x_pos, $y_pos, $label_width,
+ $label_height, $fontsize, $startrow,
+ $gutter, $justify, @fields,
) = @_;
- # hack to fix column name mismatch betwen labels_conf.class,
- # and bibitems.classification
-
- $Text::Wrap::columns = $text_wrap_cols;
- $Text::Wrap::separator = "\n";
-
- my $str;
-
- # $item
-
- my $top_text_margin = ( $fontsize + $gutter );
- my $line_spacer = ($fontsize); # number of pixels between text rows.
-
- # add your printable fields manually in here
-
#### @fields
-
- my $vPos = ( $y_pos + ( $label_height - $top_text_margin ) );
- my $hPos = ( $x_pos + $gutter );
-
- # warn Dumper $conf_data;
- #warn Dumper $item;
-
- 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.
-
-
- # get the string
- $str = $field;
-#### $str
-
- # strip out naughty existing nl/cr's
- $str =~ s/\n//g;
- $str =~ s/\r//g;
-
- # chop the string up into _upto_ 12 chunks
- # and seperate the chunks with newlines
-
- $str = wrap( "", "", "$str" );
- $str = wrap( "", "", "$str" );
-
- # split the chunks between newline's, into an array
- my @strings = split /\n/, $str;
-
- # then loop for each string line
- foreach my $str (@strings) {
-
-warn "HPOS , VPOS $hPos, $vPos ";
- # set the font size A
-
- # prText( $hPos, $vPos, $str );
- PrintText( $hPos, $vPos, $fontsize, $str );
- $vPos = $vPos - $line_spacer;
- }
- }
-}
-
-sub draw_text_block_manual2 {
-
- my (
- $x_pos, $y_pos, $label_width, $label_height,
- $fontsize, $startrow, $gutter, $justify, @fields,
- ) = @_;
-
-
-#### @fields
-my $text_wrap_cols = GetTextWrapCols( $fontsize, $label_width );
-
+ my $text_wrap_cols = GetTextWrapCols( $fontsize, $label_width );
# hack to fix column name mismatch betwen labels_conf.class,
# and bibitems.classification
@@ -798,8 +729,7 @@
#warn Dumper $item;
my $vPos = ( $y_pos + ( $label_height - $top_text_margin ) );
-$vPos = $vPos - ($line_spacer * --$startrow) if $startrow > 0;
-
+ $vPos = $vPos - ( $line_spacer * --$startrow ) if $startrow > 0;
my $hPos = ( $x_pos + $gutter );
@@ -810,7 +740,6 @@
# if the display option for this field is selected in the DB,
# and the item record has some values for this field, display it.
-
# get the string
$str = $field;
#### $str
@@ -828,19 +757,18 @@
# split the chunks between newline's, into an array
my @strings = split /\n/, $str;
-
# then loop for each string line
foreach my $str (@strings) {
if ( $justify eq 'r' ) {
my $strwidth = prStrWidth( $str, 'C', $fontsize );
#### $strwidth
- $hPos = $x_pos + $label_width - ( $gutter + $strwidth);
-
+ $hPos = $x_pos + $label_width - ( $gutter + $strwidth );
}
warn "HPOS , VPOS $hPos, $vPos\n";
+
# set the font size A
# prText( $hPos, $vPos, $str );
@@ -851,8 +779,7 @@
}
}
-=c
- sub DrawSpineText {
+sub DrawSpineText {
my (
$x_pos, $y_pos, $label_height,
@@ -930,8 +857,7 @@
}
} # if field is } #foreach feild
}
- }
-=cut
+}
sub PrintText {
my ( $hPos, $vPos, $fontsize, $text ) = @_;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Koha-cvs] koha/C4 Labels.pm [dev_week],
Mason James <=