X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FCommon.pm;h=126a30ed846d45cabca592b5b2306c762c09c9db;hb=04dccca70c47960cd6ea03a4f0ae05a9cbc42c41;hp=fb1b4b850dbdff872bcad5d54460c4563d641c2e;hpb=da1f7513fd3b86ead76b330c37209d6ed95bd853;p=kivitendo-erp.git diff --git a/SL/Common.pm b/SL/Common.pm index fb1b4b850..126a30ed8 100644 --- a/SL/Common.pm +++ b/SL/Common.pm @@ -25,6 +25,7 @@ use Encode qw(decode); use SL::DBUtils; use SL::DB; +use SL::HTML::Util; sub unique_id { my ($a, $b) = gettimeofday(); @@ -342,6 +343,11 @@ sub get_vc_details { $query = qq|SELECT * FROM shipto WHERE (trans_id = ?)|; $form->{SHIPTO} = selectall_hashref_query($form, $dbh, $query, $vc_id); + if ($vc eq 'customer') { + $query = qq|SELECT * FROM additional_billing_addresses WHERE (customer_id = ?)|; + $form->{ADDITIONAL_BILLING_ADDRESSES} = selectall_hashref_query($form, $dbh, $query, $vc_id); + } + $query = qq|SELECT * FROM contacts WHERE (cp_cv_id = ?)|; $form->{CONTACTS} = selectall_hashref_query($form, $dbh, $query, $vc_id); @@ -382,6 +388,8 @@ sub save_email_status { my ($self, $myconfig, $form) = @_; + return unless ($::instance_conf->get_email_journal); + my ($table, $query, $dbh); if ($form->{script} eq 'oe.pl') { @@ -418,7 +426,7 @@ sub save_email_status { . $main::locale->text('To (email)') . ": $form->{email}\n" . "${cc}${bcc}" . $main::locale->text('Subject') . ": $form->{subject}\n\n" - . $main::locale->text('Message') . ": $form->{message}"; + . $main::locale->text('Message') . ": " . SL::HTML::Util->strip($form->{message}); $intnotes =~ s|\r||g; @@ -588,8 +596,10 @@ sub copy_file_to_webdav_folder { return; } + $form->{attachment_filename} ||= $form->generate_attachment_filename; + my $timestamp = get_current_formatted_time(); - my $new_file = File::Spec->catfile($form->{cwd}, $webdav_folder, $form->generate_attachment_filename()); + my $new_file = File::Spec->catfile($form->{cwd}, $webdav_folder, $form->{attachment_filename}); $new_file =~ s{(.*)\.}{$1$timestamp\.}; if (!File::Copy::copy($current_file, $new_file)) { @@ -638,6 +648,11 @@ C (replace consecutive line feed/carriage return characters in the middle by a single space and remove tailing line feed/carriage return characters). +=item C + +Adds sending information to internal notes. +Does nothing if the client config email_journal is enabled. + =back =head1 BUGS