From: Sven Schöling Date: Mon, 9 May 2016 12:23:40 +0000 (+0200) Subject: Rechnungen löschen mit confirm nachfragen, und nicht mit Extrarequest X-Git-Tag: release-3.4.1~148 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=642d2475100c11355670cac075d8f4b2433f6013;p=kivitendo-erp.git Rechnungen löschen mit confirm nachfragen, und nicht mit Extrarequest --- diff --git a/bin/mozilla/is.pl b/bin/mozilla/is.pl index 07ec02986..478060cc0 100644 --- a/bin/mozilla/is.pl +++ b/bin/mozilla/is.pl @@ -993,49 +993,6 @@ sub preview { } -sub delete { - $main::lxdebug->enter_sub(); - - my $form = $main::form; - my $locale = $main::locale; - - $main::auth->assert('invoice_edit'); - - if ($form->{second_run}) { - $form->{print_and_post} = 0; - } - $form->header; - - print qq| -
-|; - - # delete action variable - map { delete $form->{$_} } qw(action header); - - foreach my $key (keys %$form) { - next if (($key eq 'login') || ($key eq 'password') || ('' ne ref $form->{$key})); - $form->{$key} =~ s/\"/"/g; - print qq|\n|; - } - - print qq| -

| . $locale->text('Confirm!') . qq|

- -

| - . $locale->text('Are you sure you want to delete Invoice Number') - . qq| $form->{invnumber} -

- -

- -

-|; - - $main::lxdebug->leave_sub(); -} - sub credit_note { $main::lxdebug->enter_sub(); @@ -1124,29 +1081,21 @@ sub display_form { $::lxdebug->leave_sub; } -sub yes { - $main::lxdebug->enter_sub(); - - my $form = $main::form; - my %myconfig = %main::myconfig; - my $locale = $main::locale; - - $main::auth->assert('invoice_edit'); +sub delete { + $::auth->assert('invoice_edit'); - if (IS->delete_invoice(\%myconfig, \%$form)) { + if (IS->delete_invoice(\%::myconfig, $::form)) { # saving the history - if(!exists $form->{addition}) { - $form->{snumbers} = 'invnumber' .'_'. $form->{invnumber}; # ($form->{type} eq 'credit_note' ? 'cnnumber' : 'invnumber') .'_'. $form->{invnumber}; - $form->{what_done} = 'invoice'; - $form->{addition} = "DELETED"; - $form->save_history; + if(!exists $::form->{addition}) { + $::form->{snumbers} = 'invnumber' .'_'. $::form->{invnumber}; + $::form->{what_done} = 'invoice'; + $::form->{addition} = "DELETED"; + $::form->save_history; } # /saving the history - $form->redirect($locale->text('Invoice deleted!')); + $::form->redirect($::locale->text('Invoice deleted!')); } - $form->error($locale->text('Cannot delete invoice!')); - - $main::lxdebug->leave_sub(); + $::form->error($::locale->text('Cannot delete invoice!')); } sub post_and_e_mail { diff --git a/locale/de/all b/locale/de/all index b8c2d6f23..be7edb740 100755 --- a/locale/de/all +++ b/locale/de/all @@ -944,6 +944,7 @@ $self->{texts} = { 'Do you really want to delete AR transaction #1?' => 'Wollen Sie wirklich die Debitorenbuchung #1 löschen?', 'Do you really want to delete GL transaction #1?' => 'Wollen Sie wirklich die Dialogbuchung #1 löschen?', 'Do you really want to delete the selected links?' => 'Wollen Sie wirklich die ausgewählten Verknüpfungen löschen?', + 'Do you really want to delete this invoice?' => 'Wollen Sie diese Rechnung wirklich löschen?', 'Do you really want to delete this object?' => 'Wollen Sie dieses Objekt wirklich löschen?', 'Do you really want to delete this warehouse?' => 'Wollen Sie dieses Lager wirklich löschen?', 'Do you really want to revert to this version?' => 'Wollen Sie wirklich auf diese Version zurücksetzen?', diff --git a/templates/webpages/is/form_footer.html b/templates/webpages/is/form_footer.html index 3212a4f42..7262aa407 100644 --- a/templates/webpages/is/form_footer.html +++ b/templates/webpages/is/form_footer.html @@ -155,8 +155,8 @@

[% print_options %]

- [% IF id %] + [% IF id %] @@ -171,7 +171,7 @@ [% END %] [% IF show_delete && (!storno || storno_id) %] - + [% L.submit_tag("action_delete", LxERP.t8("Delete"), confirm=LxERP.t8('Do you really want to delete this invoice?')) %] [% END %] [% IF show_delete && !storno %]