X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;ds=sidebyside;f=C4%2FPatroncards%2FPatroncard.pm;h=440a05c34e46ab81f74a34c975647420f62dd9b7;hb=509d673f10bf8e03529602b922d1fab603457ee2;hp=8aef3cd3cb1aa047ee57574eaddd903aabd09af1;hpb=d339abf0bfc334a819818bbb9b4c31f23326cbd1;p=srvgit diff --git a/C4/Patroncards/Patroncard.pm b/C4/Patroncards/Patroncard.pm index 8aef3cd3cb..440a05c34e 100644 --- a/C4/Patroncards/Patroncard.pm +++ b/C4/Patroncards/Patroncard.pm @@ -13,9 +13,9 @@ package C4::Patroncards::Patroncard; # 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; @@ -29,7 +29,7 @@ use C4::Creators::PDF 1.000000 qw(StrWidth); use C4::Patroncards::Lib 1.000000 qw(unpack_UTF8 text_alignment leading box get_borrower_attributes); BEGIN { - use version; our $VERSION = qv('1.0.0_1'); + use version; our $VERSION = qv('3.07.00.049'); } sub new { @@ -56,13 +56,13 @@ sub draw_barcode { my $barcode_width = 0.8 * $self->{'width'}; # this scales the barcode width to 80% of the label width my $barcode_y_scale_factor = 0.01 * $self->{'height'}; # this scales the barcode height to 1% of the label height _draw_barcode( $self, - llx => $self->{'llx'} + $self->{'layout'}->{'barcode'}->{'llx'}, - lly => $self->{'lly'} + $self->{'layout'}->{'barcode'}->{'lly'}, + llx => $self->{'llx'} + $self->{'layout'}->{'barcode'}->[0]->{'llx'}, + lly => $self->{'lly'} + $self->{'layout'}->{'barcode'}->[0]->{'lly'}, width => $barcode_width, y_scale_factor => $barcode_y_scale_factor, - barcode_type => $self->{'layout'}->{'barcode'}->{'type'}, - barcode_data => $self->{'layout'}->{'barcode'}->{'data'}, - text => $self->{'layout'}->{'barcode'}->{'text_print'}, + barcode_type => $self->{'layout'}->{'barcode'}->[0]->{'type'}, + barcode_data => $self->{'layout'}->{'barcode'}->[0]->{'data'}, + text => $self->{'layout'}->{'barcode'}->[0]->{'text_print'}, ); } @@ -83,8 +83,8 @@ sub draw_text { my ($self, $pdf, %params) = @_; warn sprintf('No pdf object passed in.') and return -1 if !$pdf; my @card_text = (); - my $text = $self->{'layout'}->{'text'}; - return unless (ref($text) eq 'ARRAY'); # just in case there is not text + return unless (ref($self->{'layout'}->{'text'}) eq 'ARRAY'); # just in case there is not text + my $text = [@{$self->{'layout'}->{'text'}}]; # make a copy of the arrayref *not* simply a pointer while (scalar @$text) { my $line = shift @$text; my $parse_line = $line; @@ -127,7 +127,7 @@ sub draw_text { while (1) { # $line =~ m/^.*(\s\b.*\b\s*|\s&|\<\b.*\b\>)$/; # original regexp... can be removed after dev stage is over $line =~ m/^.*(\s.*\s*|\s&|\<.*\>)$/; - warn sprintf('Line wrap failed. DEBUG INFO: Data: \'%s\'\n Method: C4::Patroncards->draw_text Additional Information: Line wrap regexp failed. (Please file in this information in a bug report at http://bugs.koha.org', $line) and last WRAP_LINES if !$1; + warn sprintf('Line wrap failed. DEBUG INFO: Data: \'%s\'\n Method: C4::Patroncards->draw_text Additional Information: Line wrap regexp failed. (Please file in this information in a bug report at http://bugs.koha-community.org', $line) and last WRAP_LINES if !$1; $trim = $1 . $trim; $line =~ s/$1//; $string_width = C4::Creators::PDF->StrWidth($line, $text_attribs->{'font'}, $text_attribs->{'font_size'}); @@ -190,7 +190,7 @@ sub draw_image { my $images = $self->{'layout'}->{'images'}; PROCESS_IMAGES: foreach my $image (keys %$images) { - next PROCESS_IMAGES if $images->{$image}->{'data_source'}->{'image_source'} eq 'none'; + next PROCESS_IMAGES if $images->{$image}->{'data_source'}->[0]->{'image_source'} eq 'none'; my $Tx = $self->{'llx'} + $images->{$image}->{'Tx'}; my $Ty = $self->{'lly'} + $images->{$image}->{'Ty'}; warn sprintf('No image passed in.') and next if !$images->{$image}->{'data'};