From e7367fb51e706abc8c54495e1623a5e1d2aca7fa Mon Sep 17 00:00:00 2001 From: Thomas Kasulke Date: Fri, 25 May 2007 12:11:39 +0000 Subject: [PATCH] =?utf8?q?Bindestriche=20und=20ID=20aus=20den=20PopupMenus?= =?utf8?q?=20entfernt=20und=20in=20der=20FOrm.pm=20die=20Speicherung=20der?= =?utf8?q?=20Historie=20angepasst,=20damit=20nur=20der=20aktuell=20eingelo?= =?utf8?q?ggte=20Bearbeiter=20gespeichert=20wird=20und=20somit=20Manipulat?= =?utf8?q?ionen=20vermieden=20werden=20k=C3=B6nnen.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/Form.pm | 12 ++++++------ bin/mozilla/ir.pl | 2 +- bin/mozilla/is.pl | 2 +- bin/mozilla/oe.pl | 30 ++++++++++++++++++++++++------ 4 files changed, 32 insertions(+), 14 deletions(-) diff --git a/SL/Form.pm b/SL/Form.pm index 4472dfcc6..921832edd 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -2496,12 +2496,12 @@ sub save_history { &get_employee($self, $dbh); } - my $query = - qq|INSERT INTO history_erp (trans_id, employee_id, addition, what_done, snumbers) | . - qq|VALUES (?, ?, ?, ?, ?)|; - my @values = (conv_i($self->{id}), conv_i($self->{employee_id}), - $self->{addition}, $self->{what_done}, "$self->{snumbers}"); - do_query($self, $dbh, $query, @values); +my $query = + qq|INSERT INTO history_erp (trans_id, employee_id, addition, what_done, snumbers) | . + qq|VALUES (?, (SELECT id FROM employee WHERE login = ?), ?, ?, ?)|; + my @values = (conv_i($self->{id}), $self->{login}, + $self->{addition}, $self->{what_done}, "$self->{snumbers}"); + do_query($self, $dbh, $query, @values); $main::lxdebug->leave_sub(); } diff --git a/bin/mozilla/ir.pl b/bin/mozilla/ir.pl index c9624ccb3..9102b4377 100644 --- a/bin/mozilla/ir.pl +++ b/bin/mozilla/ir.pl @@ -351,7 +351,7 @@ sub form_header { my $i = 0; foreach my $item (@{ $form->{"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 $vendors = qq| | . $locale->text('Vendor') . qq| diff --git a/bin/mozilla/is.pl b/bin/mozilla/is.pl index 7c0055582..2cbf9cd3f 100644 --- a/bin/mozilla/is.pl +++ b/bin/mozilla/is.pl @@ -374,7 +374,7 @@ sub form_header { @values = (); foreach my $item (@{ $form->{"ALL_CUSTOMERS"} }) { push(@values, $item->{name}.qq|--|.$item->{"id"}); - $labels{$item->{"id"}} = $item->{name}.qq|--|.$item->{"id"}; + $labels{$item->{name}.qq|--|.$item->{"id"}} = $item->{"name"}; } my $customers = qq| diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl index ccc9ef173..10152d736 100644 --- a/bin/mozilla/oe.pl +++ b/bin/mozilla/oe.pl @@ -428,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| @@ -438,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| @@ -1386,6 +1386,7 @@ sub search { $form->get_lists("projects" => { "key" => "ALL_PROJECTS", "all" => 1 }, + "employees" => "ALL_EMPLOYEES", $vc => "ALL_" . uc($vc)); my %labels = (); @@ -1398,24 +1399,40 @@ 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 = qq| + + | . $locale->text('Employee') . qq| + | . + NTI($cgi->popup_menu('-name' => 'employee_id', '-default' => $form->{"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| @@ -1440,6 +1457,7 @@ sub search { $ordlabel + $employee | . $locale->text('Transaction description') . qq| -- 2.20.1