Warendialog -> Preisgruppen in Template ausgelagert.
authorSven Schöling <s.schoeling@linet-services.de>
Thu, 7 Feb 2008 12:38:02 +0000 (12:38 +0000)
committerSven Schöling <s.schoeling@linet-services.de>
Thu, 7 Feb 2008 12:38:02 +0000 (12:38 +0000)
Template blendet die komplette Tabelle aus, wenn keine Preisgruppen gefunden werden.

bin/mozilla/ic.pl
templates/webpages/ic/price_row_de.html [new file with mode: 0644]
templates/webpages/ic/price_row_master.html [new file with mode: 0644]

index 928a0ab..f2ca8a9 100644 (file)
@@ -2069,30 +2069,13 @@ sub price_row {
 
   my ($numrows) = @_;
 
-  print qq|
-  <tr>
-    <td>
-      <table width=100%>
-        <tr>
-          <th class="listheading">| . $locale->text('Preisklasse') . qq|</th>
-          <th class="listheading">| . $locale->text('Preis') . qq|</th>
-        </tr>
-|;
-  for my $i (1 .. $numrows) {
-    print qq|
-        <tr>
-          <td width=50%><input type=hidden name="pricegroup_$i" size=30  value="$form->{"pricegroup_$i"}">$form->{"pricegroup_$i"}</td>
-          <td width=50%><input name="price_$i" size=11 value="$form->{"price_$i"}"></td>
-          <input type=hidden name="pricegroup_id_$i" value="$form->{"pricegroup_id_$i"}">
-        </tr>
-|;
-  }
+  my @PRICES = map +{
+    pricegroup    => $form->{"pricegroup_$_"},
+    pricegroup_id => $form->{"pricegroup_id_$_"},
+    price         => $form->{"price_$_"},
+  }, 1 .. $numrows;
 
-  print qq|
-      </table>
-    </td>
-  </tr>
-|;
+  print $form->parse_html_template('ic/price_row', { PRICES => \@PRICES });
 
   $lxdebug->leave_sub();
 }
diff --git a/templates/webpages/ic/price_row_de.html b/templates/webpages/ic/price_row_de.html
new file mode 100644 (file)
index 0000000..0115380
--- /dev/null
@@ -0,0 +1,20 @@
+[%- USE HTML %]
+[%- IF PRICES.count %]
+  <tr>
+    <td>
+      <table width=100%>
+        <tr>
+          <th class="listheading">Preisgruppe</th>
+          <th class="listheading">Preis</th>
+        </tr>
+[%- FOREACH row = PRICES %]
+        <tr>
+          <td width=50%><input type=hidden name="pricegroup_[% loop.count %]" size=30  value="[% HTML.escape(row.pricegroup) %]">[% HTML.escape(row.pricegroup) %]</td>
+          <td width=50%><input name="price_[% loop.count %]" size=11 value="[% HTML.escape(row.price) %]"></td>
+          <input type=hidden name="pricegroup_id_[% loop.count %]" value="[% HTML.escape(row.pricegroup_id) %]">
+        </tr>
+[%- END %]
+      </table>
+    </td>
+  </tr>
+[%- END %]
diff --git a/templates/webpages/ic/price_row_master.html b/templates/webpages/ic/price_row_master.html
new file mode 100644 (file)
index 0000000..da548fe
--- /dev/null
@@ -0,0 +1,20 @@
+[%- USE HTML %]
+[%- IF PRICES.count %]
+  <tr>
+    <td>
+      <table width=100%>
+        <tr>
+          <th class="listheading"><translate>Preisklasse</translate></th>
+          <th class="listheading"><translate>Preis</translate></th>
+        </tr>
+[%- FOREACH row = PRICES %]
+        <tr>
+          <td width=50%><input type=hidden name="pricegroup_[% loop.count %]" size=30  value="[% HTML.escape(row.pricegroup) %]">[% HTML.escape(row.pricegroup) %]</td>
+          <td width=50%><input name="price_[% loop.count %]" size=11 value="[% HTML.escape(row.price) %]"></td>
+          <input type=hidden name="pricegroup_id_[% loop.count %]" value="[% HTML.escape(row.pricegroup_id) %]">
+        </tr>
+[%- END %]
+      </table>
+    </td>
+  </tr>
+[%- END %]