Angebote/Aufträge: Währungsauswahl via L.select_tag
authorMoritz Bunkus <m.bunkus@linet-services.de>
Mon, 23 Jan 2017 10:37:48 +0000 (11:37 +0100)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Mon, 23 Jan 2017 13:56:07 +0000 (14:56 +0100)
bin/mozilla/oe.pl
templates/webpages/oe/form_header.html

index ebbc997..856276c 100644 (file)
@@ -381,14 +381,8 @@ sub form_header {
   $TMPL_VAR{sales_employee_labels} = sub { $_[0]->{name} || $_[0]->{login} };
 
   # currencies and exchangerate
-  my @values = map { $_ } @{ $form->{ALL_CURRENCIES} };
-  my %labels = map { $_ => $_ } @{ $form->{ALL_CURRENCIES} };
   $form->{currency}            = $form->{defaultcurrency} unless $form->{currency};
   $TMPL_VAR{show_exchangerate} = $form->{currency} ne $form->{defaultcurrency};
-  $TMPL_VAR{currencies}        = NTI($cgi->popup_menu('-name' => 'currency', '-default' => $form->{"currency"},
-                                                      '-values' => \@values, '-labels' => \%labels,
-                                                      '-onchange' => "document.getElementById('update_button').click();"
-                                     )) if scalar @values;
   push @custom_hiddens, "forex";
   push @custom_hiddens, "exchangerate" if $form->{forex};
 
@@ -1497,8 +1491,6 @@ sub invoice {
 
   require "bin/mozilla/$form->{script}";
 
-  map { $form->{"select$_"} = "" } ($form->{vc}, "currency");
-
   my $currency = $form->{currency};
   &invoice_links;
 
index 83d1b65..953cb15 100644 (file)
                     </td>
                   </tr>
 [%- END %]
-[%- IF currencies %]
                   <tr>
                     <th align="right">[% 'Currency' | $T8 %]</th>
-                    <td>[% currencies %]</td>
+                    <td>[% L.select_tag("currency", ALL_CURRENCIES, value_key="name", default=currency, onchange="document.getElementById('update_button').click();") %]</td>
                   </tr>
-[%- END %]
 [%- IF show_exchangerate %]
                   <tr>
                     <th align="right">[% 'Exchangerate' | $T8 %]</th>