From 2fda509c7dc417aad28ed072e91e8ffe2396314d Mon Sep 17 00:00:00 2001 From: Thomas Kasulke Date: Wed, 2 May 2007 11:17:45 +0000 Subject: [PATCH] Lieferanten-/Kundenauswahlmenu angepasst, so dass nicht immer die komplette Auswahlliste mitgeschleppt werden muss. --- bin/mozilla/oe.pl | 110 ++++++++++++++++++++-------------------------- 1 file changed, 47 insertions(+), 63 deletions(-) diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl index 3c55ee58f..f08daabfd 100644 --- a/bin/mozilla/oe.pl +++ b/bin/mozilla/oe.pl @@ -269,13 +269,6 @@ sub order_links { $form->{employee} = "$form->{employee}--$form->{employee_id}"; - # sales staff - if (@{ $form->{all_employees} }) { - $form->{selectemployee} = ""; - map { $form->{selectemployee} .= "\n" } - (@{ $form->{all_employees} }); - } - # forex $form->{forex} = $form->{exchangerate}; @@ -372,9 +365,9 @@ sub form_header { # without JavaScript Calendar $button1 = qq| - |; + |; $button2 = qq| - |; + |; } my @tmp; @@ -402,7 +395,7 @@ sub form_header { } # set option selected - foreach $item ($form->{vc}, currency, department, employee) { + foreach $item ($form->{vc}, currency, department, employee, ($form->{vc} eq "customer" ? customer : vendor)) { $form->{"select$item"} =~ s/ selected//; $form->{"select$item"} =~ s/option>\Q$form->{$item}\E/option selected>$form->{$item}/; @@ -426,7 +419,10 @@ sub form_header { "employees" => "ALL_SALESMEN", "taxzones" => "ALL_TAXZONES", "currencies" => "ALL_CURRENCIES"); - + ($form->{vc} eq "customer" + ? $form->get_lists("customers" => "ALL_CUSTOMERS") + : $form->get_lists("vendors" => "ALL_VENDORS")); + my %labels; my @values = (undef); foreach my $item (@{ $form->{"ALL_CONTACTS"} }) { @@ -438,6 +434,25 @@ sub form_header { NTI($cgi->popup_menu('-name' => 'cp_id', '-values' => \@values, '-labels' => \%labels, '-default' => $form->{"cp_id"})); + %labels = (); + @values = (); + + foreach my $item (@{ $form->{($form->{vc} eq "customer" ? "ALL_CUSTOMERS" : "ALL_VENDORS")}}) { + push(@values, $item->{name}.qq|--|.$item->{"id"}); + $labels{$item->{"id"}} = $item->{name}.qq|--|.$item->{"id"}; + } + + my $vc = qq| + | . $locale->text(ucfirst($form->{vc})) . qq| + | . + (($myconfig{vclimit} == 1 ) + ? qq|| + : (NTI($cgi->popup_menu('-name' => "$form->{vc}", '-default' => $form->{"old$form->{vc}"}, + '-onChange' => 'document.getElementById(\'update_button\').click();', + '-values' => \@values, '-labels' => \%labels)))) . qq| + {vc}"}) . qq|">|; + %labels = (); @values = (""); foreach my $item (@{ $form->{"ALL_SHIPTO"} }) { @@ -483,6 +498,21 @@ sub form_header { |; } + %labels = (); + @values = (); + foreach my $item (@{ $form->{"ALL_SALESMEN"} }) { + push(@values, $item->{"id"}); + $labels{$item->{"id"}} = $item->{"name"}; + } + + my $employees = qq| + + | . $locale->text('Employee') . qq| + | . + NTI($cgi->popup_menu('-name' => 'employee', '-default' => $form->{"employee"}, + '-values' => \@values, '-labels' => \%labels)) . qq| + + |; %labels = (); @values = (); @@ -553,11 +583,6 @@ sub form_header { } } - $vclabel = ucfirst $form->{vc}; - $vclabel = $locale->text($vclabel); - - - if ($form->{business}) { $business = qq| @@ -677,48 +702,25 @@ sub form_header { |; } - $vc = - ($form->{"select$form->{vc}"}) - ? qq|\n{vc}"}) . qq|">| - : qq|{vc} value="$form->{$form->{vc}}" size=35>|; - $department = qq| | . $locale->text('Department') . qq| - -| if $form->{selectdepartment}; - - $employee = qq| - -|; + | if $form->{selectdepartment}; if ($form->{type} eq 'sales_order') { if ($form->{selectemployee}) { $employee = qq| {customer_klass}> - - | . $locale->text('Employee') . qq| - - - - + $employees |; } } else { $employee = qq| {customer_klass}> - - | . $locale->text('Employee') . qq| - - - - + $employees |; } if ($form->{resubmit} && ($form->{format} eq "html")) { @@ -790,10 +792,7 @@ onchange="document.getElementById('update_button').click();">| . - - - {vc}_id value=$form->{"$form->{vc}_id"}> - {vc}"}"> + $vc @@ -1354,20 +1353,6 @@ sub search { $form->all_vc(\%myconfig, $form->{vc}, ($form->{vc} eq 'customer') ? "AR" : "AP"); - map { $vc .= "\n" } - @{ $form->{"all_$form->{vc}"} }; - - $vclabel = ucfirst $form->{vc}; - $vclabel = $locale->text($vclabel); - - # $locale->text('Vendor') - # $locale->text('Customer') - - $vc = - ($vc) - ? qq|| - : qq|{vc} size=35>|; - # departments if (@{ $form->{all_departments} }) { $form->{selectdepartment} = "
$vclabel$vc| . $locale->text('Contact Person') . qq| $contact - - + $vc $department @@ -1501,7 +1485,7 @@ sub search { . $locale->text('Required by') . qq| - + -- 2.20.1
$vclabel$vc
$vclabel ucfirst($form->{vc}) $employee | . $locale->text('Ship via') . qq|