X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/47b12ba6205a7b90ac82157a27542e294709b882..39ef020d434d058dd24fbd0785cd50467be89594:/SL/Controller/Order.pm diff --git a/SL/Controller/Order.pm b/SL/Controller/Order.pm index 4f2abe523..b9d940a7c 100644 --- a/SL/Controller/Order.pm +++ b/SL/Controller/Order.pm @@ -350,7 +350,7 @@ sub action_print { } # open the email dialog -sub action_show_email_dialog { +sub action_save_and_show_email_dialog { my ($self) = @_; my $errors = $self->save(); @@ -452,6 +452,7 @@ sub action_send_email { $::form->{tmpdir} = $sfile->get_path; # for Form::cleanup which may be called in Form::send_email } + $::form->{id} = $self->order->id; # this is used in SL::Mailer to create a linked record to the mail $::form->send_email(\%::myconfig, 'pdf'); # internal notes @@ -1884,7 +1885,8 @@ sub setup_edit_action_bar { ], action => [ t8('Save and E-mail'), - call => [ 'kivi.Order.email', $::instance_conf->get_order_warn_duplicate_parts ], + call => [ 'kivi.Order.save', 'save_and_show_email_dialog', $::instance_conf->get_order_warn_duplicate_parts ], + disabled => !$self->order->id ? t8('This object has not been saved yet.') : undef, ], action => [ t8('Download attachments of all parts'),