From: Sven Schöling Date: Fri, 15 May 2009 17:49:34 +0000 (+0000) Subject: Latex Parser: X-Git-Tag: release-2.6.0rc1~47 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=526173c2827375e04540a626a339d249a3648239;p=kivitendo-erp.git Latex Parser: if innerhalb von foreach schlägt fehl, wenn die Variable im neuen TEMPLATE_ARRAY Format abgelegt ist. if muss also auch dort suchen. Fix für Bug 992. --- diff --git a/SL/Template.pm b/SL/Template.pm index 4cbde74e6..8300458b7 100644 --- a/SL/Template.pm +++ b/SL/Template.pm @@ -223,9 +223,9 @@ sub parse_foreach { $sum += $form->parse_amount($self->{"myconfig"}, $form->{"linetotal"}->[$i]); } - + $form->{"cumulatelinetotal"}[$i] = $form->format_amount($self->{"myconfig"}, $sum, 2); - + my $new_text = $self->parse_block($text, (@indices, $i)); return undef unless (defined($new_text)); $new_contents .= $start_tag . $new_text . $end_tag; @@ -350,7 +350,11 @@ sub parse_block { return undef; } - my $value = $self->{"form"}->{$var}; + my $form = $self->{form}; + $form = $form->{TEMPLATE_ARRAYS} if @indices + && ref $form->{TEMPLATE_ARRAYS} eq 'HASH' + && ref $form->{TEMPLATE_ARRAYS}->{$var} eq 'ARRAY'; + my $value = $form->{$var}; for (my $i = 0; $i < scalar(@indices); $i++) { last unless (ref($value) eq "ARRAY"); $value = $value->[$indices[$i]]; @@ -1365,7 +1369,7 @@ sub uses_temp_file { #### ########################################################## -package XMLTemplate; +package XMLTemplate; use vars qw(@ISA);