From 94d6b5f998a65c6d1932eb4439097b69801fbc4c Mon Sep 17 00:00:00 2001 From: "G. Richardson" Date: Tue, 21 Jun 2011 17:54:16 +0200 Subject: [PATCH] =?utf8?q?Bug=201275:=20Unbenutzte=20Lieferadressen=20lass?= =?utf8?q?en=20sich=20nicht=20l=C3=B6schen?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Code für Löschen von Lieferadresse und Kontaktperson hatte sich vermischt. --- SL/CT.pm | 19 ++++++++++++++++++- bin/mozilla/ct.pl | 2 +- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/SL/CT.pm b/SL/CT.pm index b36cfa3e8..6d801d488 100644 --- a/SL/CT.pm +++ b/SL/CT.pm @@ -1045,7 +1045,24 @@ sub delete_shipto { my %myconfig = %main::myconfig; my $dbh = $form->get_standard_dbh(\%myconfig); - do_query($form, $dbh, qq|UPDATE contacts SET cp_cv_id = NULL WHERE cp_id = ?|, $shipto_id); + do_query($form, $dbh, qq|UPDATE shipto SET trans_id = NULL WHERE shipto_id = ?|, $shipto_id); + + $dbh->commit(); + + $main::lxdebug->leave_sub(); +} + +sub delete_contact { + $main::lxdebug->enter_sub(); + + my $self = shift; + my $cp_id = shift; + + my $form = $main::form; + my %myconfig = %main::myconfig; + my $dbh = $form->get_standard_dbh(\%myconfig); + + do_query($form, $dbh, qq|UPDATE contacts SET cp_cv_id = NULL WHERE cp_id = ?|, $cp_id); $dbh->commit(); diff --git a/bin/mozilla/ct.pl b/bin/mozilla/ct.pl index 4121ac5e4..b25509ec6 100644 --- a/bin/mozilla/ct.pl +++ b/bin/mozilla/ct.pl @@ -717,7 +717,7 @@ sub delete_contact { CT->get_contact(\%myconfig, \%$form); unless ($form->{cp_used}) { - CT->delete_shipto($form->{cp_id}); + CT->delete_contact($form->{cp_id}); @$form{ grep /^cp_/, keys %$form } = undef; } -- 2.20.1