X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Foe.pl;h=c9cb92e0a559d1f4aa85386c2f99f97a37f3d26b;hb=e6ef45f2d8a980a68bd54df8c2afce4e0203c289;hp=899d263f08d59b827425f8d00b769e43bee10479;hpb=e06a7e08648363ef8c8ef14678ab853ae7bdd670;p=kivitendo-erp.git
diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl
index 899d263f0..c9cb92e0a 100644
--- a/bin/mozilla/oe.pl
+++ b/bin/mozilla/oe.pl
@@ -374,7 +374,7 @@ sub form_header {
}
# set option selected
- foreach $item ($form->{vc}, currency, department, employee, ($form->{vc} eq "customer" ? customer : vendor)) {
+ foreach $item ($form->{vc}, currency, department, ($form->{vc} eq "customer" ? customer : vendor)) {
$form->{"select$item"} =~ s/ selected//;
$form->{"select$item"} =~
s/option>\Q$form->{$item}\E/option selected>$form->{$item}/;
@@ -396,7 +396,8 @@ sub form_header {
"projects" => { "key" => "ALL_PROJECTS",
"all" => 0,
"old_id" => \@old_project_ids },
- "employees" => "ALL_SALESMEN",
+ "employees" => "ALL_EMPLOYEES",
+ "salesmen" => "ALL_SALESMEN",
"taxzones" => "ALL_TAXZONES",
"payments" => "ALL_PAYMENTS",
"currencies" => "ALL_CURRENCIES",
@@ -427,8 +428,8 @@ sub form_header {
@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"};
+ push(@values, $item->{"name"}.qq|--|.$item->{"id"});
+ $labels{$item->{"name"}.qq|--|.$item->{"id"}} = $item->{name};
}
$vc = qq|
@@ -437,7 +438,7 @@ sub form_header {
| . $locale->text(ucfirst($form->{vc})) . qq| |
| .
(($myconfig{vclimit} <= scalar(@values))
- ? qq|{vc}"}) . qq|" name="$form->{vc}">|
+ ? qq|{vc}"} =~ /^(.*)\-\-.*$/)) . qq|" name="$form->{vc}">|
: (NTI($cgi->popup_menu('-name' => "$form->{vc}", '-default' => $form->{"old$form->{vc}"},
'-onChange' => 'document.getElementById(\'update_button\').click();',
'-values' => \@values, '-labels' => \%labels, '-style' => 'width: 250px')))) . qq|
@@ -487,21 +488,20 @@ sub form_header {
NTI($cgi->popup_menu('-name' => 'globalproject_id', '-values' => \@values,
'-labels' => \%labels,
'-default' => $form->{"globalproject_id"}));
-
- $salesman = "";
+
+ my $salesmen = "";
+ %labels = ();
+ @values = ();
if ($form->{type} =~ /^sales_/) {
- %labels = ();
- @values = ("");
- foreach my $item (@{ $form->{ALL_SALESMEN} }) {
- push(@values, $item->{id});
- $labels{$item->{id}} = $item->{name} ne "" ? $item->{name} : $item->{login};
+ foreach my $item (@{ $form->{"ALL_SALESMEN"} }) {
+ push(@values, $item->{"id"});
+ $labels{$item->{"id"}} = ($item->{"name"} ne "" ? $item->{"name"} : $item->{"login"});
}
-
- $salesman =
+ $salesmen =
qq| |
| . $locale->text('Salesman') . qq| |
| .
- NTI($cgi->popup_menu('-name' => 'salesman_id', '-default' => $form->{salesman_id},
+ NTI($cgi->popup_menu('-name' => 'salesman_id', '-default' => $form->{"salesman_id"} ? $form->{"salesman_id"} : $form->{"employee_id"},
'-values' => \@values, '-labels' => \%labels))
. qq| |
|;
@@ -509,16 +509,16 @@ sub form_header {
%labels = ();
@values = ();
- foreach my $item (@{ $form->{"ALL_SALESMEN"} }) {
+ foreach my $item (@{ $form->{"ALL_EMPLOYEES"} }) {
push(@values, $item->{"id"});
- $labels{$item->{"id"}} = $item->{"name"};
+ $labels{$item->{"id"}} = $item->{"name"} ne "" ? $item->{"name"} : $item->{"login"};
}
- my $employees = qq|
+ my $employee = qq|
| . $locale->text('Employee') . qq| |
| .
- NTI($cgi->popup_menu('-name' => 'employee', '-default' => $form->{"employee"},
+ NTI($cgi->popup_menu('-name' => 'employee_id', '-default' => $form->{"employee_id"},
'-values' => \@values, '-labels' => \%labels)) . qq|
|
|;
@@ -707,16 +707,12 @@ sub form_header {
if ($form->{type} eq 'sales_order') {
if ($form->{selectemployee}) {
- $employee = qq|
- {customer_klass}>
- $employees
-|;
+ $employee .= qq|
+ |;
}
} else {
- $employee = qq|
- {customer_klass}>
- $employees
-|;
+ $employee .= qq|
+ |;
}
if ($form->{resubmit} && ($form->{format} eq "html")) {
$onload =
@@ -821,7 +817,7 @@ print qq|
$openclosed
$employee
- $salesman
+ $salesmen
$ordnumber
| . $locale->text('Project Number') . qq| |
@@ -1390,6 +1386,7 @@ sub search {
$form->get_lists("projects" => { "key" => "ALL_PROJECTS",
"all" => 1 },
+ "employees" => "ALL_EMPLOYEES",
$vc => "ALL_" . uc($vc));
my %labels = ();
@@ -1402,24 +1399,41 @@ sub search {
NTI($cgi->popup_menu('-name' => 'project_id', '-values' => \@values,
'-labels' => \%labels));
+ #employees
+ %labels = ();
+ @values = ("");
+ foreach my $item (@{ $form->{"ALL_EMPLOYEES"} }) {
+ push(@values, $item->{"id"});
+ $labels{$item->{"id"}} = $item->{"name"} ne "" ? $item->{"name"} : $item->{"login"};
+ }
+
+ my $employee_block = qq|
+
+ | . $locale->text('Employee') . qq| |
+ | .
+ NTI($cgi->popup_menu('-name' => 'employee_id',
+ '-values' => \@values,
+ '-labels' => \%labels)) . qq|
+ |
+
|;
+
%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"};
+ $labels{$item->{name}.qq|--|.$item->{"id"}} = $item->{"name"};
}
my $vc_label = $form->{vc} eq "customer" ? $locale->text('Customer') : $locale->text('Vendor');
$vc =
$myconfig{vclimit} <= scalar(@values)
- ? qq|{vc}"}) . qq|" name="$form->{vc}">|
+ ? qq|{vc}"} =~ /^(.*)\-\-.*$/)) . qq|" name="$form->{vc}">|
: NTI($cgi->popup_menu('-name' => "$form->{vc}",
'-default' => $form->{"old$form->{vc}"},
'-onChange' => 'document.getElementById(\'update_button\').click();',
'-values' => \@values,
'-labels' => \%labels));
-
$form->header;
print qq|
@@ -1444,6 +1458,7 @@ sub search {
$ordlabel |
|
+ $employee_block
| . $locale->text('Transaction description') . qq| |
|
@@ -1480,7 +1495,7 @@ sub search {
. $locale->text('Required by') . qq|
- ucfirst($form->{vc}) |
+ $vc_label |
$employee |
|
. $locale->text('Ship via') . qq| |
@@ -2122,8 +2137,11 @@ sub delete {
$msg $form->{$ordnumber}
+
+