%myconfig ist ein Hash.
[kivitendo-erp.git] / bin / mozilla / io.pl
index 5f2324f..6a57794 100644 (file)
@@ -624,7 +624,7 @@ sub select_item {
     $column_data{partnumber} =
       qq|<td><input name="new_partnumber_$i" type="hidden" value="$ref->{partnumber}">$ref->{partnumber}</td>|;
     $column_data{description} =
-      qq|<td><input name="new_description_$i" type="hidden" value=$ref->{description}>$ref->{description}</td>|;
+      qq|<td><input name="new_description_$i" type="hidden" value="$ref->{description}">$ref->{description}</td>|;
     $column_data{sellprice} =
       qq|<td align="right"><input name="new_sellprice_$i" type="hidden" value="$ref->{sellprice}">|
       . $form->format_amount(\%myconfig, $ref->{sellprice}, 2, "&nbsp;")
@@ -822,17 +822,10 @@ sub new_item {
     . $locale->text('Service');
 print $cgi->hidden("-name" => "previousform", "-value" => $previousform);
 map({ print($cgi->hidden("-name" => $_, "-value" => $form->{$_})); } 
-     ("partnumber_$i", "description_$i", "rowcount", "taxaccounts", "vc", "path", "login", "password"));
-
-#<input type="hidden" name="partnumber" value="$form->{"partnumber_$i"}">
-#<input type="hidden" name="description" value="$form->{"description_$i"}">
-#<input type="hidden" name="rowcount" value="$form->{rowcount}">
-#<input type="hidden" name="taxaccount2" value="$form->{taxaccounts}">
-#<input type="hidden" name="vc" value="$form->{vc}">
-#
-#<input type="hidden" name="path" value="$form->{path}">
-#<input type="hidden" name="login" value="$form->{login}">
-#<input type="hidden" name="password" value="$form->{password}">
+     ("rowcount", "vc", "path", "login", "password"));
+     map({ print($cgi->hidden("-name" => $_, "-value" => $form->{"$__$i"})); }
+     ("partnumber", "description"));
+print $cgi->hidden("-name" => "taxaccount2", "-value" => $form->{taxaccounts});
 
 print qq|
 <input type="hidden" name="nextsub" value="add">
@@ -1394,7 +1387,7 @@ sub edit_e_mail {
     <td>
 |;
 
-  &print_options;
+  print_options();
 
   map { delete $form->{$_} }
     qw(action email cc bcc subject message formname sendmode format header override);
@@ -1505,7 +1498,7 @@ sub print_options {
 
   push @MEDIA, grep $_,
       opthash("screen", $form->{OP}{screen}, $locale->text('Screen')),
-    (scalar keys %{ $form->{printers} } && $latex_templates) ?
+    (scalar @{ $form->{printers} } && $latex_templates) ?
       opthash("printer", $form->{OP}{printer}, $locale->text('Printer')) : undef,
     ($latex_templates) ? 
       opthash("queue", $form->{OP}{queue}, $locale->text('Queue')) : undef
@@ -1528,12 +1521,12 @@ sub print_options {
 
   push @PRINTER_ID, 
     map { opthash($_->{id}, ($_->{id} eq $form->{printer_id} ? 'selected' : ''), $_->{printer_description}) } +{}, @{ $form->{printers} }
-      if (ref $form->{printers} eq 'ARRAY');
+      if ((ref $form->{printers} eq 'ARRAY') && scalar @{ $form->{printers } });
 
   @SELECTS = map { sname => lc $_, DATA => \@$_, show => scalar @$_ }, qw(FORMNAME LANGUAGE_ID FORMAT SENDMODE MEDIA PRINTER_ID);
 
   %template_vars = (
-    display_copies       => scalar keys %{ $form->{printers} } && $latex_templates && $form->{media} ne 'email',
+    display_copies       => scalar @{ $form->{printers} } && $latex_templates && $form->{media} ne 'email',
     display_remove_draft => (!$form->{id} && $form->{draft_id}),
     groupitems_checked   => $form->{groupitems} ? "checked" : '',
     remove_draft_checked => $form->{remove_draft} ? "checked" : ''
@@ -2113,7 +2106,7 @@ sub ship_to {
        <tr>
          <th align="right" nowrap>| . $locale->text('Contact') . qq|</th>
          <td>$form->{contact}</td>
-         <td><input name="shiptocontac"t size="35" value="$form->{shiptocontact}"></td>
+         <td><input name="shiptocontact" size="35" value="$form->{shiptocontact}"></td>
        </tr>
        <tr>
          <th align="right" nowrap>| . $locale->text('Phone') . qq|</th>
@@ -2134,7 +2127,7 @@ sub ship_to {
     </td>
   </tr>
 </table>
-| . $cgi->hidden("-name" => "nexsub", "-value" => $nextsub);
+| . $cgi->hidden("-name" => "nextsub", "-value" => $nextsub);
 ;