Revision 58aebf4e
Von R. Karuschka vor mehr als 12 Jahren hinzugefügt
SL/Template/LaTeX.pm | ||
---|---|---|
63 | 63 |
$form->{"__odd__"} = (($i + 1) % 2) == 1; |
64 | 64 |
$form->{"__counter__"} = $i + 1; |
65 | 65 |
|
66 |
#everything from here to the next marker should be removed after the release of 2.7.0 |
|
67 |
if ( ref $description_array eq 'ARRAY' |
|
68 |
&& scalar @{$description_array} == scalar @{$ary} |
|
69 |
&& $self->{"chars_per_line"} != 0) |
|
70 |
{ |
|
71 |
my $lines = int(length($description_array->[$i]) / $self->{"chars_per_line"}); |
|
72 |
my $lpp; |
|
73 |
|
|
74 |
$description_array->[$i] =~ s/(\\newline\s?)*$//; |
|
75 |
$lines++ while ($description_array->[$i] =~ m/\\newline/g); |
|
76 |
$lines++; |
|
77 |
|
|
78 |
if ($current_page == 1) { |
|
79 |
$lpp = $self->{"lines_on_first_page"}; |
|
80 |
} else { |
|
81 |
$lpp = $self->{"lines_on_second_page"}; |
|
82 |
} |
|
83 |
|
|
84 |
# Yes we need a manual page break -- or the user has forced one |
|
85 |
if ( (($current_line + $lines) > $lpp) |
|
86 |
|| ($description_array->[$i] =~ /<pagebreak>/) |
|
87 |
|| ( ref $longdescription_array eq 'ARRAY' |
|
88 |
&& $longdescription_array->[$i] =~ /<pagebreak>/)) { |
|
89 |
my $pb = $self->{"pagebreak_block"}; |
|
90 |
|
|
91 |
# replace the special variables <%sumcarriedforward%> |
|
92 |
# and <%lastpage%> |
|
93 |
|
|
94 |
my $psum = $form->format_amount($self->{"myconfig"}, $sum, 2); |
|
95 |
$pb =~ s/$self->{tag_start_qm}sumcarriedforward$self->{tag_end_qm}/$psum/g; |
|
96 |
$pb =~ s/$self->{tag_start_qm}lastpage$self->{tag_end_qm}/$current_page/g; |
|
97 |
|
|
98 |
my $new_text = $self->parse_block($pb, (@indices, $i)); |
|
99 |
return undef unless (defined($new_text)); |
|
100 |
$new_contents .= $new_text; |
|
101 |
|
|
102 |
$current_page++; |
|
103 |
$current_line = 0; |
|
104 |
} |
|
105 |
$current_line += $lines; |
|
106 |
} |
|
107 |
#stop removing code here. |
|
108 |
|
|
66 | 109 |
if ( ref $linetotal_array eq 'ARRAY' |
67 | 110 |
&& $i < scalar(@{$linetotal_array})) { |
68 | 111 |
$sum += $form->parse_amount($self->{"myconfig"}, $linetotal_array->[$i]); |
... | ... | |
295 | 338 |
|
296 | 339 |
my $contents = join("", @lines); |
297 | 340 |
|
341 |
# detect pagebreak block and its parameters |
|
342 |
if ($contents =~ /$self->{tag_start_qm}pagebreak\s+(\d+)\s+(\d+)\s+(\d+)\s*$self->{tag_end_qm}(.*?)$self->{tag_start_qm}end(\s*pagebreak)?$self->{tag_end_qm}/s) { |
|
343 |
$self->{"chars_per_line"} = $1; |
|
344 |
$self->{"lines_on_first_page"} = $2; |
|
345 |
$self->{"lines_on_second_page"} = $3; |
|
346 |
$self->{"pagebreak_block"} = $4; |
|
347 |
|
|
348 |
substr($contents, length($`), length($&)) = ""; |
|
349 |
} |
|
350 |
|
|
351 |
$self->{"forced_pagebreaks"} = []; |
|
352 |
|
|
298 | 353 |
my $new_contents = $self->parse_block($contents); |
299 | 354 |
if (!defined($new_contents)) { |
300 | 355 |
$main::lxdebug->leave_sub(); |
Auch abrufbar als: Unified diff
In Absprache mit Sven pagebreak und sumcarriedforward wieder hergestellt, allerdings in der Upgrade-Doku als "deprecated" beschrieben.
Diese Aktion ist einzig dazu gedacht die Leute beim upgrade weich fallen zu lassen, da diese Funktionen bislang als "Standard" galten
und sogar in den Vorlagen propagiert wurden. nach dem Release soll die Funktion endgueltig raus.
Bugs zu pagebreak, sumcarriedforward etc werden kuenftig abgelehnt, unsupported feature.