From ebd37c0ea7536ff0b41bda6e259d6348063edea9 Mon Sep 17 00:00:00 2001 From: Thomas Heck Date: Fri, 14 Dec 2012 16:20:09 +0100 Subject: [PATCH] =?utf8?q?Bankkonten=20l=C3=B6schbar=20machen?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Da Bankkonten nur von SEPA(und dort nur die Kontodaten kopiert werden) verwendet werden, muss nicht geprüft werden, ob das Konto noch verwendet wird. fixt #2085 --- SL/BankAccount.pm | 22 +++++++++++++++++++ bin/mozilla/bankaccounts.pl | 10 +++++++++ .../bank_account_display_form.html | 2 +- 3 files changed, 33 insertions(+), 1 deletion(-) diff --git a/SL/BankAccount.pm b/SL/BankAccount.pm index 4194d5c5c..f17ec1ede 100644 --- a/SL/BankAccount.pm +++ b/SL/BankAccount.pm @@ -57,6 +57,28 @@ sub retrieve { return $account; } +sub delete { + $::lxdebug->enter_sub(); + + my $self = shift; + my %params = @_; + + Common::check_params(\%params, qw(id)); + + my $dbh = $params{dbh} || $::form->get_standard_dbh(%::myconfig); + + my $query = ' + DELETE + FROM bank_accounts + WHERE id = ?'; + + do_query($::form, $dbh, $query, conv_i($params{id})); + + $dbh->commit(); + + $::lxdebug->leave_sub(); +} + sub list { $main::lxdebug->enter_sub(); diff --git a/bin/mozilla/bankaccounts.pl b/bin/mozilla/bankaccounts.pl index 3155e2558..a11fb6bb6 100644 --- a/bin/mozilla/bankaccounts.pl +++ b/bin/mozilla/bankaccounts.pl @@ -32,6 +32,16 @@ sub bank_account_edit { $main::lxdebug->leave_sub(); } +sub bank_account_delete { + $::lxdebug->enter_sub(); + + SL::BankAccount->delete(id => $::form->{account}{id}); + + print $::form->redirect_header('bankaccounts.pl?action=bank_account_list'); + + $::lxdebug->leave_sub(); +} + sub bank_account_display_form { $main::lxdebug->enter_sub(); diff --git a/templates/webpages/bankaccounts/bank_account_display_form.html b/templates/webpages/bankaccounts/bank_account_display_form.html index 7642d4f93..ef4febeb9 100644 --- a/templates/webpages/bankaccounts/bank_account_display_form.html +++ b/templates/webpages/bankaccounts/bank_account_display_form.html @@ -59,7 +59,7 @@ [%- IF account.id %] - + [%- ELSE %] [%- END %] -- 2.20.1