Währungs-popup auf cgi umgestellt
authorThomas Kasulke <t.kasulke@linet-services.de>
Fri, 27 Apr 2007 10:46:17 +0000 (10:46 +0000)
committerThomas Kasulke <t.kasulke@linet-services.de>
Fri, 27 Apr 2007 10:46:17 +0000 (10:46 +0000)
bin/mozilla/ir.pl
bin/mozilla/is.pl
bin/mozilla/oe.pl

index f3d0260..faaa3cc 100644 (file)
@@ -120,11 +120,6 @@ sub invoice_links {
     $form->{taxzone_id} = $taxzone_id;
   }
 
-  # currencies
-  @curr = split(/:/, $form->{currencies});
-  chomp $curr[0];
-  $form->{defaultcurrency} = $curr[0];
-
   map { $form->{selectcurrency} .= "<option>$_\n" } @curr;
 
   $form->{oldvendor} = "$form->{vendor}--$form->{vendor_id}";
@@ -279,7 +274,8 @@ sub form_header {
                    "projects" => { "key" => "ALL_PROJECTS",
                                    "all" => 0,
                                    "old_id" => \@old_project_ids },
-                   "taxzones" => "ALL_TAXZONES");
+                   "taxzones" => "ALL_TAXZONES",
+                   "currencies" => "ALL_CURRENCIES");
 
   my %labels;
   my @values = (undef);
@@ -302,7 +298,24 @@ sub form_header {
     NTI($cgi->popup_menu('-name' => 'globalproject_id', '-values' => \@values,
                          '-labels' => \%labels,
                          '-default' => $form->{"globalproject_id"}));
-
+  %labels = ();
+  @values = ();
+  foreach my $item (@{ $form->{"ALL_CURRENCIES"} }) {
+    push(@values, $item->{"currency"});
+    $labels{$item->{"currency"}} = $item->{"currency"};
+  }
+  
+  $form->{currency}        = $form->{defaultcurrency} unless $form->{currency};
+  my $currencies = qq|
+    <tr>
+      <th align="right">| . $locale->text('Currency') . qq|</th>
+      <td>| .
+        NTI($cgi->popup_menu('-name' => 'currency', '-default' => $form->{"currency"},
+                             '-values' => \@values, '-labels' => \%labels)) . qq|
+      </td>
+    </tr>|;
+  
   %labels = ();
   @values = ();
   foreach my $item (@{ $form->{"ALL_TAXZONES"} }) {
@@ -459,8 +472,7 @@ onchange="document.getElementById('update_button').click();">| .
               $taxzone
               $department
              <tr>
-               <th align=right nowrap>| . $locale->text('Currency') . qq|</th>
-               <td><select name=currency>$form->{selectcurrency}</select></td>
+    $currencies
                $exchangerate
              </tr>
            </table>
@@ -507,8 +519,6 @@ onchange="document.getElementById('update_button').click();">| .
 
 $jsscript
 
-<input type=hidden name=selectcurrency value="$form->{selectcurrency}">
-<input type=hidden name=defaultcurrency value=$form->{defaultcurrency}>
 <input type=hidden name=fxgain_accno value=$form->{fxgain_accno}>
 <input type=hidden name=fxloss_accno value=$form->{fxloss_accno}>
 <input type=hidden name=webdav value=$webdav>
index 10dc43e..59d4b47 100644 (file)
@@ -167,13 +167,6 @@ sub invoice_links {
     $form->{shipto_id} = $shipto_id;
   }
 
-  # currencies
-  @curr = split(/:/, $form->{currencies});
-  chomp $curr[0];
-  $form->{defaultcurrency} = $curr[0];
-
-  map { $form->{selectcurrency} .= "<option>$_</option>\n" } @curr;
-
   $form->{oldcustomer} = "$form->{customer}--$form->{customer_id}";
 
   if (@{ $form->{all_customer} }) {
@@ -344,7 +337,8 @@ sub form_header {
                                    "all" => 0,
                                    "old_id" => \@old_project_ids },
                    "employees" => "ALL_SALESMEN",
-                   "taxzones" => "ALL_TAXZONES");
+                   "taxzones" => "ALL_TAXZONES",
+                   "currencies" => "ALL_CURRENCIES");
 
   my %labels;
   my @values = (undef);
@@ -372,6 +366,23 @@ sub form_header {
                          '-labels' => \%labels, '-default' => $form->{"shipto_id"}))
     . qq|</td>|;
 
+  %labels = ();
+  @values = ();
+  foreach my $item (@{ $form->{"ALL_CURRENCIES"} }) {
+    push(@values, $item->{"currency"});
+    $labels{$item->{"currency"}} = $item->{"currency"};
+  }
+  
+  $form->{currency}        = $form->{defaultcurrency} unless $form->{currency};
+  my $currencies = qq|
+    <tr>
+      <th align="right">| . $locale->text('Currency') . qq|</th>
+      <td>| .
+        NTI($cgi->popup_menu('-name' => 'currency', '-default' => $form->{"currency"},
+                             '-values' => \@values, '-labels' => \%labels)) . qq|
+      </td>
+    </tr>|;
+
   %labels = ();
   @values = ("");
   foreach my $item (@{ $form->{"ALL_PROJECTS"} }) {
@@ -676,10 +687,7 @@ print qq|
               $taxzone
              $department
              <tr>
-               <th align="right" nowrap>| . $locale->text('Currency') . qq|</th>
-               <td><select name="currency">$form->{selectcurrency}</select></td>
-               <input type="hidden" name="selectcurrency" value="$form->{selectcurrency}">
-               <input type="hidden" name="defaultcurrency" value="$form->{defaultcurrency}">
+    $currencies
                <input type="hidden" name="fxgain_accno" value="$form->{fxgain_accno}">
                <input type="hidden" name="fxloss_accno" value="$form->{fxloss_accno}">
                $exchangerate
index e076691..bdb6946 100644 (file)
@@ -254,14 +254,6 @@ sub order_links {
       (@{ $form->{"all_$form->{vc}"} });
   }
 
-  # currencies
-  @curr = split(/:/, $form->{currencies});
-  chomp $curr[0];
-  $form->{defaultcurrency} = $curr[0];
-  $form->{currency}        = $form->{defaultcurrency} unless $form->{currency};
-
-  map { $form->{selectcurrency} .= "<option>$_</option>\n" } @curr;
-
   $form->{taxincluded} = $taxincluded if ($form->{id});
 
   # departments
@@ -361,12 +353,12 @@ sub form_header {
 
     # with JavaScript Calendar
     $button1 = qq|
-       <td><input name=transdate id=transdate size=11 title="$myconfig{dateformat}" value=$form->{transdate} onBlur=\"check_right_date_format(this)\"></td>
+       <td><input name=transdate id=transdate size=11 title="$myconfig{dateformat}" value="$form->{transdate}" onBlur=\"check_right_date_format(this)\"></td>
        <td><input type=button name=transdate id="trigger1" value=|
       . $locale->text('button') . qq|></td>
       |;
     $button2 = qq|
-       <td width="13"><input name=reqdate id=reqdate size=11 title="$myconfig{dateformat}" value=$form->{reqdate} onBlur=\"check_right_date_format(this)\"></td>
+       <td width="13"><input name=reqdate id=reqdate size=11 title="$myconfig{dateformat}" value="$form->{reqdate}" onBlur=\"check_right_date_format(this)\"></td>
        <td width="4"><input type=button name=reqdate name=reqdate id="trigger2" value=|
       . $locale->text('button') . qq|></td>
      |;
@@ -380,9 +372,9 @@ sub form_header {
 
     # without JavaScript Calendar
     $button1 = qq|
-                              <td><input name=transdate id=transdate size=11 title="$myconfig{dateformat}" value=$form->{transdate} onBlur=\"check_right_date_format(this)\"></td>|;
+                              <td><input name=transdate id=transdate size=11 title="$myconfig{dateformat}" value="$form->{transdate}" onBlur=\"check_right_date_format(this)\"></td>|;
     $button2 = qq|
-                              <td width="13"><input name=reqdate id=reqdate size=11 title="$myconfig{dateformat}" value=$form->{reqdate} onBlur=\"check_right_date_format(this)\"></td>|;
+                              <td width="13"><input name=reqdate id=reqdate size=11 title="$myconfig{dateformat}" value="$form->{reqdate}" onBlur=\"check_right_date_format(this)\"></td>|;
   }
 
   my @tmp;
@@ -432,7 +424,8 @@ sub form_header {
                                    "all" => 0,
                                    "old_id" => \@old_project_ids },
                    "employees" => "ALL_SALESMEN",
-                   "taxzones" => "ALL_TAXZONES");
+                   "taxzones" => "ALL_TAXZONES",
+                   "currencies" => "ALL_CURRENCIES");
 
   my %labels;
   my @values = (undef);
@@ -507,6 +500,24 @@ sub form_header {
       </td>
     </tr>|;
 
+  %labels = ();
+  @values = ();
+  foreach my $item (@{ $form->{"ALL_CURRENCIES"} }) {
+    push(@values, $item->{"currency"});
+    $labels{$item->{"currency"}} = $item->{"currency"};
+  }
+  
+  $form->{currency}        = $form->{defaultcurrency} unless $form->{currency};
+  my $currencies = qq|
+    <tr>
+      <th align="right">| . $locale->text('Currency') . qq|</th>
+      <td>| .
+        NTI($cgi->popup_menu('-name' => 'currency', '-default' => $form->{"currency"},
+                             '-values' => \@values, '-labels' => \%labels)) . qq|
+      </td>
+    </tr>|;
+
+
   $form->{exchangerate} =
     $form->format_amount(\%myconfig, $form->{exchangerate});
 
@@ -792,10 +803,7 @@ onchange="document.getElementById('update_button').click();">| .
               $taxzone
              $department
              <tr>
-               <th align=right>| . $locale->text('Currency') . qq|</th>
-               <td><select name=currency>$form->{selectcurrency}</select></td>
-               <input type=hidden name=selectcurrency value="$form->{selectcurrency}">
-               <input type=hidden name=defaultcurrency value=$form->{defaultcurrency}>
+               $currencies
                $exchangerate
              </tr>
              <tr>