Datenbank-IDs in Formularen nicht durch "format_amount" jagen, sondern 1:1 speichern.
authorMoritz Bunkus <m.bunkus@linet-services.de>
Tue, 26 May 2009 11:05:03 +0000 (11:05 +0000)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Tue, 26 May 2009 11:05:03 +0000 (11:05 +0000)
SL/IC.pm
templates/webpages/ic/price_row_de.html
templates/webpages/ic/price_row_master.html

index 75e3191..430f565 100644 (file)
--- a/SL/IC.pm
+++ b/SL/IC.pm
@@ -482,11 +482,9 @@ sub save {
       ) {
       #$klass = $form->parse_amount($myconfig, $form->{"klass_$i"});
       $price = $form->parse_amount($myconfig, $form->{"price_$i"});
-      $pricegroup_id =
-        $form->parse_amount($myconfig, $form->{"pricegroup_id_$i"});
       $query = qq|INSERT INTO prices (parts_id, pricegroup_id, price) | .
                qq|VALUES(?, ?, ?)|;
-      @values = (conv_i($form->{id}), conv_i($pricegroup_id), $price);
+      @values = (conv_i($form->{id}), conv_i($form->{"pricegroup_id_$i"}), $price);
       do_query($form, $dbh, $query, @values);
     }
   }
index d479308..421256f 100644 (file)
@@ -12,7 +12,7 @@
         <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="[% LxERP.format_amount(row.price, -2) %]"></td>
-          <input type=hidden name="pricegroup_id_[% loop.count %]" value="[% LxERP.format_amount(row.pricegroup_id, -2) %]">
+          <input type="hidden" name="pricegroup_id_[% loop.count %]" value="[% HTML.escape(row.pricegroup_id) %]">
         </tr>
 [%- END %]
       </table>
index 2aa61ee..56bae69 100644 (file)
@@ -12,7 +12,7 @@
         <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="[% LxERP.format_amount(row.price, -2) %]"></td>
-          <input type=hidden name="pricegroup_id_[% loop.count %]" value="[% LxERP.format_amount(row.pricegroup_id, -2) %]">
+          <input type="hidden" name="pricegroup_id_[% loop.count %]" value="[% HTML.escape(row.pricegroup_id) %]">
         </tr>
 [%- END %]
       </table>