Umstellung einiger Vorlagen von HTML::Template auf Template.
authorMoritz Bunkus <m.bunkus@linet-services.de>
Wed, 31 Oct 2007 13:17:31 +0000 (13:17 +0000)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Wed, 31 Oct 2007 13:17:31 +0000 (13:17 +0000)
bin/mozilla/oe.pl
templates/webpages/oe/check_for_direct_delivery_de.html
templates/webpages/oe/check_for_direct_delivery_master.html
templates/webpages/oe/orders_bottom_de.html
templates/webpages/oe/orders_bottom_master.html

index 3a31a2e..eab834b 100644 (file)
@@ -1087,8 +1087,8 @@ sub orders {
   }
 
   $report->set_options('top_info_text'        => join("\n", @options),
-                       'raw_top_info_text'    => $form->parse_html_template('oe/orders_top'),
-                       'raw_bottom_info_text' => $form->parse_html_template('oe/orders_bottom', { 'SHOW_CONTINUE_BUTTON' => $allow_multiple_orders }),
+                       'raw_top_info_text'    => $form->parse_html_template2('oe/orders_top'),
+                       'raw_bottom_info_text' => $form->parse_html_template2('oe/orders_bottom', { 'SHOW_CONTINUE_BUTTON' => $allow_multiple_orders }),
                        'output_format'        => 'HTML',
                        'title'                => $form->{title},
                        'attachment_basename'  => $attachment_basename . strftime('_%Y%m%d', localtime time),
@@ -1840,7 +1840,7 @@ sub check_for_direct_delivery {
   $form->{VARIABLES} = [ map { { "key" => $_, "value" => $form->{$_} } } grep { ref $_ eq "" } keys %{ $form } ];
 
   $form->header();
-  print $form->parse_html_template("oe/check_for_direct_delivery");
+  print $form->parse_html_template2("oe/check_for_direct_delivery");
 
   $lxdebug->leave_sub();
 
index 6a307a8..7ab223b 100644 (file)
@@ -1,4 +1,4 @@
-<body>
+[% USE HTML %]<body>
 
  <div class="listtop" width="100%">Lieferadresse &uuml;bernehmen</div>
 
@@ -8,57 +8,57 @@
   <table>
    <tr>
     <th align="right" valign="top">Name:</th>
-    <td valign="top"><TMPL_VAR CFDD_shiptoname ESCAPE=HTML></td>
+    <td valign="top">[% HTML.escape(CFDD_shiptoname) %]</td>
    </tr>
 
    <tr>
     <th align="right" valign="top">Abteilung:</th>
-    <td valign="top"><TMPL_VAR CFDD_shiptodepartment_1 ESCAPE=HTML></td>
+    <td valign="top">[% HTML.escape(CFDD_shiptodepartment_1) %]</td>
    </tr>
 
    <tr>
     <th align="right" valign="top">&nbsp;</th>
-    <td valign="top"><TMPL_VAR CFDD_shiptodepartment_2 ESCAPE=HTML></td>
+    <td valign="top">[% HTML.escape(CFDD_shiptodepartment_2) %]</td>
    </tr>
 
    <tr>
     <th align="right" valign="top">Straße:</th>
-    <td valign="top"><TMPL_VAR CFDD_shiptostreet ESCAPE=HTML></td>
+    <td valign="top">[% HTML.escape(CFDD_shiptostreet) %]</td>
    </tr>
 
    <tr>
     <th align="right" valign="top">PLZ:</th>
-    <td valign="top"><TMPL_VAR CFDD_shiptozipcode ESCAPE=HTML></td>
+    <td valign="top">[% HTML.escape(CFDD_shiptozipcode) %]</td>
    </tr>
 
    <tr>
     <th align="right" valign="top">Stadt:</th>
-    <td valign="top"><TMPL_VAR CFDD_shiptocity ESCAPE=HTML></td>
+    <td valign="top">[% HTML.escape(CFDD_shiptocity) %]</td>
    </tr>
 
    <tr>
     <th align="right" valign="top">Land:</th>
-    <td valign="top"><TMPL_VAR CFDD_shiptocountry ESCAPE=HTML></td>
+    <td valign="top">[% HTML.escape(CFDD_shiptocountry) %]</td>
    </tr>
 
    <tr>
     <th align="right" valign="top">Kontakt:</th>
-    <td valign="top"><TMPL_VAR CFDD_shiptocontact ESCAPE=HTML></td>
+    <td valign="top">[% HTML.escape(CFDD_shiptocontact) %]</td>
    </tr>
 
    <tr>
     <th align="right" valign="top">Telefon:</th>
-    <td valign="top"><TMPL_VAR CFDD_shiptophone ESCAPE=HTML></td>
+    <td valign="top">[% HTML.escape(CFDD_shiptophone) %]</td>
    </tr>
 
    <tr>
     <th align="right" valign="top">Fax:</th>
-    <td valign="top"><TMPL_VAR CFDD_shiptofax ESCAPE=HTML></td>
+    <td valign="top">[% HTML.escape(CFDD_shiptofax) %]</td>
    </tr>
 
    <tr>
     <th align="right" valign="top">eMail:</th>
-    <td valign="top"><TMPL_VAR CFDD_shiptoemail ESCAPE=HTML></td>
+    <td valign="top">[% HTML.escape(CFDD_shiptoemail) %]</td>
    </tr>
   </table>
  </p>
@@ -76,8 +76,9 @@
   <input type="hidden" name="yes_nextsub" value="check_for_direct_delivery_yes">
   <input type="hidden" name="no_nextsub" value="check_for_direct_delivery_no">
 
-  <TMPL_LOOP VARIABLES>
-   <input type="hidden" name="<TMPL_VAR key ESCAPE=HTML>" value="<TMPL_VAR value ESCAPE=HTML>"></TMPL_LOOP>
+  [%- FOREACH row = VARIABLES %]
+  <input type="hidden" name="[% HTML.escape(row.key) %]" value="[% HTML.escape(row.value) %]">
+  [%- END %]
 
  </form>
 
index e9e3d8e..d434fc2 100644 (file)
@@ -1,4 +1,4 @@
-<body>
+[% USE HTML %]<body>
 
  <div class="listtop" width="100%"><translate>Carry over shipping address</translate></div>
 
@@ -8,57 +8,57 @@
   <table>
    <tr>
     <th align="right" valign="top"><translate>Name</translate>:</th>
-    <td valign="top"><TMPL_VAR CFDD_shiptoname ESCAPE=HTML></td>
+    <td valign="top">[% HTML.escape(CFDD_shiptoname) %]</td>
    </tr>
 
    <tr>
     <th align="right" valign="top"><translate>Department</translate>:</th>
-    <td valign="top"><TMPL_VAR CFDD_shiptodepartment_1 ESCAPE=HTML></td>
+    <td valign="top">[% HTML.escape(CFDD_shiptodepartment_1) %]</td>
    </tr>
 
    <tr>
     <th align="right" valign="top">&nbsp;</th>
-    <td valign="top"><TMPL_VAR CFDD_shiptodepartment_2 ESCAPE=HTML></td>
+    <td valign="top">[% HTML.escape(CFDD_shiptodepartment_2) %]</td>
    </tr>
 
    <tr>
     <th align="right" valign="top"><translate>Street</translate>:</th>
-    <td valign="top"><TMPL_VAR CFDD_shiptostreet ESCAPE=HTML></td>
+    <td valign="top">[% HTML.escape(CFDD_shiptostreet) %]</td>
    </tr>
 
    <tr>
     <th align="right" valign="top"><translate>Zipcode</translate>:</th>
-    <td valign="top"><TMPL_VAR CFDD_shiptozipcode ESCAPE=HTML></td>
+    <td valign="top">[% HTML.escape(CFDD_shiptozipcode) %]</td>
    </tr>
 
    <tr>
     <th align="right" valign="top"><translate>City</translate>:</th>
-    <td valign="top"><TMPL_VAR CFDD_shiptocity ESCAPE=HTML></td>
+    <td valign="top">[% HTML.escape(CFDD_shiptocity) %]</td>
    </tr>
 
    <tr>
     <th align="right" valign="top"><translate>Country</translate>:</th>
-    <td valign="top"><TMPL_VAR CFDD_shiptocountry ESCAPE=HTML></td>
+    <td valign="top">[% HTML.escape(CFDD_shiptocountry) %]</td>
    </tr>
 
    <tr>
     <th align="right" valign="top"><translate>Contact</translate>:</th>
-    <td valign="top"><TMPL_VAR CFDD_shiptocontact ESCAPE=HTML></td>
+    <td valign="top">[% HTML.escape(CFDD_shiptocontact) %]</td>
    </tr>
 
    <tr>
     <th align="right" valign="top"><translate>Phone</translate>:</th>
-    <td valign="top"><TMPL_VAR CFDD_shiptophone ESCAPE=HTML></td>
+    <td valign="top">[% HTML.escape(CFDD_shiptophone) %]</td>
    </tr>
 
    <tr>
     <th align="right" valign="top"><translate>Fax</translate>:</th>
-    <td valign="top"><TMPL_VAR CFDD_shiptofax ESCAPE=HTML></td>
+    <td valign="top">[% HTML.escape(CFDD_shiptofax) %]</td>
    </tr>
 
    <tr>
     <th align="right" valign="top"><translate>E-mail</translate>:</th>
-    <td valign="top"><TMPL_VAR CFDD_shiptoemail ESCAPE=HTML></td>
+    <td valign="top">[% HTML.escape(CFDD_shiptoemail) %]</td>
    </tr>
   </table>
  </p>
@@ -76,8 +76,9 @@
   <input type="hidden" name="yes_nextsub" value="check_for_direct_delivery_yes">
   <input type="hidden" name="no_nextsub" value="check_for_direct_delivery_no">
 
-  <TMPL_LOOP VARIABLES>
-   <input type="hidden" name="<TMPL_VAR key ESCAPE=HTML>" value="<TMPL_VAR value ESCAPE=HTML>"></TMPL_LOOP>
+  [%- FOREACH row = VARIABLES %]
+  <input type="hidden" name="[% HTML.escape(row.key) %]" value="[% HTML.escape(row.value) %]">
+  [%- END %]
 
  </form>
 
index 17ec002..12f1983 100644 (file)
@@ -1,12 +1,13 @@
-<TMPL_IF SHOW_CONTINUE_BUTTON>
+[% USE HTML %]
+ [%- IF SHOW_CONTINUE_BUTTON %]
  Neuer Auftrag<br>
  <input class="submit" type="submit" name="action" value="Weiter">
-</TMPL_IF>
+ [%- END %]
  <input type="hidden" name="nextsub" value="edit">
- <input type="hidden" name="type" value="<TMPL_VAR type ESCAPE=HTML>">
- <input type="hidden" name="vc" value="<TMPL_VAR vc ESCAPE=HTML>">
- <input type="hidden" name="login" value="<TMPL_VAR login ESCAPE=HTML>">
- <input type="hidden" name="password" value="<TMPL_VAR password ESCAPE=HTML>">
- <input type="hidden" name="callback" value="<TMPL_VAR callback ESCAPE=HTML>">
- <input type="hidden" name="rowcount" value="<TMPL_VAR rowcount ESCAPE=HTML>">
+ <input type="hidden" name="type" value="[% HTML.escape(type) %]">
+ <input type="hidden" name="vc" value="[% HTML.escape(vc) %]">
+ <input type="hidden" name="login" value="[% HTML.escape(login) %]">
+ <input type="hidden" name="password" value="[% HTML.escape(password) %]">
+ <input type="hidden" name="callback" value="[% HTML.escape(callback) %]">
+ <input type="hidden" name="rowcount" value="[% HTML.escape(rowcount) %]">
 </form>
index d2eb9f8..0ddcaaa 100644 (file)
@@ -1,12 +1,13 @@
-<TMPL_IF SHOW_CONTINUE_BUTTON>
+[% USE HTML %]
+ [%- IF SHOW_CONTINUE_BUTTON %]
  <translate>New sales order</translate><br>
  <input class="submit" type="submit" name="action" value="<translate>Continue</translate>">
-</TMPL_IF>
+ [%- END %]
  <input type="hidden" name="nextsub" value="edit">
- <input type="hidden" name="type" value="<TMPL_VAR type ESCAPE=HTML>">
- <input type="hidden" name="vc" value="<TMPL_VAR vc ESCAPE=HTML>">
- <input type="hidden" name="login" value="<TMPL_VAR login ESCAPE=HTML>">
- <input type="hidden" name="password" value="<TMPL_VAR password ESCAPE=HTML>">
- <input type="hidden" name="callback" value="<TMPL_VAR callback ESCAPE=HTML>">
- <input type="hidden" name="rowcount" value="<TMPL_VAR rowcount ESCAPE=HTML>">
+ <input type="hidden" name="type" value="[% HTML.escape(type) %]">
+ <input type="hidden" name="vc" value="[% HTML.escape(vc) %]">
+ <input type="hidden" name="login" value="[% HTML.escape(login) %]">
+ <input type="hidden" name="password" value="[% HTML.escape(password) %]">
+ <input type="hidden" name="callback" value="[% HTML.escape(callback) %]">
+ <input type="hidden" name="rowcount" value="[% HTML.escape(rowcount) %]">
 </form>