Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 858ce394

Von Moritz Bunkus vor etwa 17 Jahren hinzugefügt

  • ID 858ce3946daa658e51ee3adb70c322ba5af9d920
  • Vorgänger 421d94f7
  • Nachfolger b9882bee

Umstellung weiterer Vorlagen von HTML::Template auf Template. Zusätzlich Bugfix: Sobald die Checkbox "Details anzeigen" einmal aktiviert war, konnte sie nicht mehr deaktiviert werden.

Unterschiede anzeigen:

bin/mozilla/oe.pl
2199 2199
    push @ROWS, { ROW1 => \@ROW1, ROW2 => \@ROW2, HIDDENS => \@HIDDENS, colspan => $colspan, };
2200 2200
  }
2201 2201

  
2202
  print $form->parse_html_template('oe/sales_order', { ROWS   => \@ROWS, 
2203
                                                       HEADER => \@HEADER,
2204
                                                       show_details_checked => ($form->{show_details} ? "checked" : ""),
2205
                                                       show_details_new     => !$form->{show_details},
2206
                                                     });
2202
  print $form->parse_html_template2('oe/sales_order', { ROWS   => \@ROWS,
2203
                                                        HEADER => \@HEADER,
2204
                                                      });
2207 2205

  
2208 2206
  if (0 != ($form->{sellprice_total} * 1)) {
2209 2207
    $form->{marge_percent} = ($form->{sellprice_total} - $form->{lastcost_total}) / $form->{sellprice_total} * 100;
templates/webpages/oe/sales_order_de.html
1

  
1
[% USE HTML %]
2 2
<tr>
3 3
 <td>
4
  <input type="hidden" name="show_details" value="<TMPL_VAR show_details>"  /> 
5
  <input type="checkbox" id="cb_show_details" onclick="show_form_details(<TMPL_VAR show_details_new>);" <TMPL_VAR show_details_checked>>
4
  <input type="hidden" name="show_details" value="[% HTML.escape(show_details) %]">
5
  <input type="checkbox" id="cb_show_details" onclick="show_form_details([% IF show_details %]0[% ELSE %]1[% END %]);"[%- IF show_details %] checked[% END %]>
6 6
  <label for="cb_show_details">Details anzeigen</label><br>
7 7
  <table width="100%">
8
   <tr class="listheading"><TMPL_LOOP HEADER><TMPL_IF display>
9
    <th align="left" nowrap width="<TMPL_VAR width>" class="listheading"><TMPL_VAR value></th></TMPL_IF></TMPL_LOOP>
8
   <tr class="listheading">[% FOREACH header = HEADER %][% IF header.display %]
9
    <th align="left" nowrap width="[% header.width %]" class="listheading">[% header.value %]</th>[% END %][% END %]
10 10
   </tr>
11 11

  
12
   <TMPL_LOOP ROWS>
13
     <tr valign="top" class="listrow<TMPL_VAR __odd__>"><TMPL_LOOP ROW1>
14
      <td align="<TMPL_VAR align>"><TMPL_VAR value></td></TMPL_LOOP>
12
   [% FOREACH row = ROWS %]
13
     <tr valign="top" class="listrow[% loop.count % 2 %]">[% FOREACH row1 = row.ROW1 %]
14
      <td align="[% row1.align %]">[% row1.value %]</td>[% END %]
15 15
     </tr>
16
     
17
     <TMPL_LOOP HIDDENS><TMPL_VAR value>
18
     </TMPL_LOOP>
19
     
20
     <tr class="listrow<TMPL_VAR __odd__>" <TMPL_UNLESS show_details>style="display:none;"</TMPL_UNLESS>><td colspan="<TMPL_VAR colspan>"><TMPL_LOOP ROW2>
21
      <TMPL_VAR value></TMPL_LOOP>
16

  
17
     [% FOREACH hidden = HIDDENS %][% hidden.value %]
18
     [% END %]
19

  
20
     <tr class="listrow[% loop.count % 2 %]" [% UNLESS show_details %]style="display:none;"[% END %]><td colspan="[% row.colspan %]">[% FOREACH row2 = row.ROW2 %]
21
      [% row2.value %][% END %]
22 22
     </td></tr>
23
   </TMPL_LOOP>
23
   [% END %]
24 24

  
25 25
  </table>
26 26
 </td>
templates/webpages/oe/sales_order_master.html
1

  
1
[% USE HTML %]
2 2
<tr>
3 3
 <td>
4
  <input type="hidden" name="show_details" value="<TMPL_VAR show_details>"  /> 
5
  <input type="checkbox" id="cb_show_details" onclick="show_form_details(<TMPL_VAR show_details_new>);" <TMPL_VAR show_details_checked>>
4
  <input type="hidden" name="show_details" value="[% HTML.escape(show_details) %]">
5
  <input type="checkbox" id="cb_show_details" onclick="show_form_details([% IF show_details %]0[% ELSE %]1[% END %]);"[%- IF show_details %] checked[% END %]>
6 6
  <label for="cb_show_details"><translate>Show details</translate></label><br>
7 7
  <table width="100%">
8
   <tr class="listheading"><TMPL_LOOP HEADER><TMPL_IF display>
9
    <th align="left" nowrap width="<TMPL_VAR width>" class="listheading"><TMPL_VAR value></th></TMPL_IF></TMPL_LOOP>
8
   <tr class="listheading">[% FOREACH header = HEADER %][% IF header.display %]
9
    <th align="left" nowrap width="[% header.width %]" class="listheading">[% header.value %]</th>[% END %][% END %]
10 10
   </tr>
11 11

  
12
   <TMPL_LOOP ROWS>
13
     <tr valign="top" class="listrow<TMPL_VAR __odd__>"><TMPL_LOOP ROW1>
14
      <td align="<TMPL_VAR align>"><TMPL_VAR value></td></TMPL_LOOP>
12
   [% FOREACH row = ROWS %]
13
     <tr valign="top" class="listrow[% loop.count % 2 %]">[% FOREACH row1 = row.ROW1 %]
14
      <td align="[% row1.align %]">[% row1.value %]</td>[% END %]
15 15
     </tr>
16
     
17
     <TMPL_LOOP HIDDENS><TMPL_VAR value>
18
     </TMPL_LOOP>
19
     
20
     <tr class="listrow<TMPL_VAR __odd__>" <TMPL_UNLESS show_details>style="display:none;"</TMPL_UNLESS>><td colspan="<TMPL_VAR colspan>"><TMPL_LOOP ROW2>
21
      <TMPL_VAR value></TMPL_LOOP>
16

  
17
     [% FOREACH hidden = HIDDENS %][% hidden.value %]
18
     [% END %]
19

  
20
     <tr class="listrow[% loop.count % 2 %]" [% UNLESS show_details %]style="display:none;"[% END %]><td colspan="[% row.colspan %]">[% FOREACH row2 = row.ROW2 %]
21
      [% row2.value %][% END %]
22 22
     </td></tr>
23
   </TMPL_LOOP>
23
   [% END %]
24 24

  
25 25
  </table>
26 26
 </td>

Auch abrufbar als: Unified diff