From 9caaa245e1bc3309a7d8f198228dbfd9d4555bee Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Wed, 4 Apr 2007 08:25:23 +0000 Subject: [PATCH] =?utf8?q?Bei=20Einkaufs-=20und=20Verkaufsmasken=20erm?= =?utf8?q?=C3=B6glichen,=20dass=20kein=20Ansprechpartner=20ausgew=C3=A4hlt?= =?utf8?q?=20wird.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- bin/mozilla/io.pl | 8 ++++++++ bin/mozilla/ir.pl | 3 ++- bin/mozilla/is.pl | 3 ++- bin/mozilla/oe.pl | 3 ++- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/bin/mozilla/io.pl b/bin/mozilla/io.pl index 785c3d5d9..e91c47b29 100644 --- a/bin/mozilla/io.pl +++ b/bin/mozilla/io.pl @@ -1738,6 +1738,7 @@ sub print_form { $language_saved = $form->{language_id}; $payment_id_saved = $form->{payment_id}; $salesman_id_saved = $form->{salesman_id}; + $cp_id_saved = $form->{cp_id}; &{"$form->{vc}_details"}(); @@ -1748,6 +1749,13 @@ sub print_form { $form->{"cc"} = $saved_cc if ($saved_cc); $form->{"bcc"} = $saved_bcc if ($saved_bcc); + if (!$cp_id_saved) { + # No contact was selected. Delete all contact variables because + # IS->customer_details() and IR->vendor_details() get the default + # contact anyway. + map({ delete($form->{$_}); } grep(/^cp_/, keys(%{ $form }))); + } + my ($language_tc, $output_numberformat, $output_dateformat, $output_longdates); if ($form->{"language_id"}) { ($language_tc, $output_numberformat, $output_dateformat, $output_longdates) = diff --git a/bin/mozilla/ir.pl b/bin/mozilla/ir.pl index d72ca7ed8..e052258e6 100644 --- a/bin/mozilla/ir.pl +++ b/bin/mozilla/ir.pl @@ -277,7 +277,8 @@ sub form_header { "all" => 0, "old_id" => \@old_project_ids }); - my (%labels, @values); + my %labels; + my @values = (undef); foreach my $item (@{ $form->{"ALL_CONTACTS"} }) { push(@values, $item->{"cp_id"}); $labels{$item->{"cp_id"}} = $item->{"cp_name"} . diff --git a/bin/mozilla/is.pl b/bin/mozilla/is.pl index 8c1249334..fef4a3edf 100644 --- a/bin/mozilla/is.pl +++ b/bin/mozilla/is.pl @@ -371,7 +371,8 @@ sub form_header { "old_id" => \@old_project_ids }, "employees" => "ALL_SALESMEN"); - my (%labels, @values); + my %labels; + my @values = (undef); foreach my $item (@{ $form->{"ALL_CONTACTS"} }) { push(@values, $item->{"cp_id"}); $labels{$item->{"cp_id"}} = $item->{"cp_name"} . diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl index f55d5a7cc..3fbc753b1 100644 --- a/bin/mozilla/oe.pl +++ b/bin/mozilla/oe.pl @@ -427,7 +427,8 @@ sub form_header { "old_id" => \@old_project_ids }, "employees" => "ALL_SALESMEN"); - my (%labels, @values); + my %labels; + my @values = (undef); foreach my $item (@{ $form->{"ALL_CONTACTS"} }) { push(@values, $item->{"cp_id"}); $labels{$item->{"cp_id"}} = $item->{"cp_name"} . -- 2.20.1