# 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;
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'},
);
}
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;
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'});
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'};