push @ROWS, { ROW1 => \@ROW1, ROW2 => \@ROW2, HIDDENS => \@HIDDENS, colspan => $colspan, };
}
- print $form->parse_html_template('oe/sales_order', { ROWS => \@ROWS,
- HEADER => \@HEADER,
- show_details_checked => ($form->{show_details} ? "checked" : ""),
- show_details_new => !$form->{show_details},
- });
+ print $form->parse_html_template2('oe/sales_order', { ROWS => \@ROWS,
+ HEADER => \@HEADER,
+ });
if (0 != ($form->{sellprice_total} * 1)) {
$form->{marge_percent} = ($form->{sellprice_total} - $form->{lastcost_total}) / $form->{sellprice_total} * 100;
-
+[% USE HTML %]
<tr>
<td>
- <input type="hidden" name="show_details" value="<TMPL_VAR show_details>" />
- <input type="checkbox" id="cb_show_details" onclick="show_form_details(<TMPL_VAR show_details_new>);" <TMPL_VAR show_details_checked>>
+ <input type="hidden" name="show_details" value="[% HTML.escape(show_details) %]">
+ <input type="checkbox" id="cb_show_details" onclick="show_form_details([% IF show_details %]0[% ELSE %]1[% END %]);"[%- IF show_details %] checked[% END %]>
<label for="cb_show_details">Details anzeigen</label><br>
<table width="100%">
- <tr class="listheading"><TMPL_LOOP HEADER><TMPL_IF display>
- <th align="left" nowrap width="<TMPL_VAR width>" class="listheading"><TMPL_VAR value></th></TMPL_IF></TMPL_LOOP>
+ <tr class="listheading">[% FOREACH header = HEADER %][% IF header.display %]
+ <th align="left" nowrap width="[% header.width %]" class="listheading">[% header.value %]</th>[% END %][% END %]
</tr>
- <TMPL_LOOP ROWS>
- <tr valign="top" class="listrow<TMPL_VAR __odd__>"><TMPL_LOOP ROW1>
- <td align="<TMPL_VAR align>"><TMPL_VAR value></td></TMPL_LOOP>
+ [% FOREACH row = ROWS %]
+ <tr valign="top" class="listrow[% loop.count % 2 %]">[% FOREACH row1 = row.ROW1 %]
+ <td align="[% row1.align %]">[% row1.value %]</td>[% END %]
</tr>
-
- <TMPL_LOOP HIDDENS><TMPL_VAR value>
- </TMPL_LOOP>
-
- <tr class="listrow<TMPL_VAR __odd__>" <TMPL_UNLESS show_details>style="display:none;"</TMPL_UNLESS>><td colspan="<TMPL_VAR colspan>"><TMPL_LOOP ROW2>
- <TMPL_VAR value></TMPL_LOOP>
+
+ [% FOREACH hidden = HIDDENS %][% hidden.value %]
+ [% END %]
+
+ <tr class="listrow[% loop.count % 2 %]" [% UNLESS show_details %]style="display:none;"[% END %]><td colspan="[% row.colspan %]">[% FOREACH row2 = row.ROW2 %]
+ [% row2.value %][% END %]
</td></tr>
- </TMPL_LOOP>
+ [% END %]
</table>
</td>
-
+[% USE HTML %]
<tr>
<td>
- <input type="hidden" name="show_details" value="<TMPL_VAR show_details>" />
- <input type="checkbox" id="cb_show_details" onclick="show_form_details(<TMPL_VAR show_details_new>);" <TMPL_VAR show_details_checked>>
+ <input type="hidden" name="show_details" value="[% HTML.escape(show_details) %]">
+ <input type="checkbox" id="cb_show_details" onclick="show_form_details([% IF show_details %]0[% ELSE %]1[% END %]);"[%- IF show_details %] checked[% END %]>
<label for="cb_show_details"><translate>Show details</translate></label><br>
<table width="100%">
- <tr class="listheading"><TMPL_LOOP HEADER><TMPL_IF display>
- <th align="left" nowrap width="<TMPL_VAR width>" class="listheading"><TMPL_VAR value></th></TMPL_IF></TMPL_LOOP>
+ <tr class="listheading">[% FOREACH header = HEADER %][% IF header.display %]
+ <th align="left" nowrap width="[% header.width %]" class="listheading">[% header.value %]</th>[% END %][% END %]
</tr>
- <TMPL_LOOP ROWS>
- <tr valign="top" class="listrow<TMPL_VAR __odd__>"><TMPL_LOOP ROW1>
- <td align="<TMPL_VAR align>"><TMPL_VAR value></td></TMPL_LOOP>
+ [% FOREACH row = ROWS %]
+ <tr valign="top" class="listrow[% loop.count % 2 %]">[% FOREACH row1 = row.ROW1 %]
+ <td align="[% row1.align %]">[% row1.value %]</td>[% END %]
</tr>
-
- <TMPL_LOOP HIDDENS><TMPL_VAR value>
- </TMPL_LOOP>
-
- <tr class="listrow<TMPL_VAR __odd__>" <TMPL_UNLESS show_details>style="display:none;"</TMPL_UNLESS>><td colspan="<TMPL_VAR colspan>"><TMPL_LOOP ROW2>
- <TMPL_VAR value></TMPL_LOOP>
+
+ [% FOREACH hidden = HIDDENS %][% hidden.value %]
+ [% END %]
+
+ <tr class="listrow[% loop.count % 2 %]" [% UNLESS show_details %]style="display:none;"[% END %]><td colspan="[% row.colspan %]">[% FOREACH row2 = row.ROW2 %]
+ [% row2.value %][% END %]
</td></tr>
- </TMPL_LOOP>
+ [% END %]
</table>
</td>