From 38fcf5b43ddbcde995d1fe1c486c0fd49290627c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Thu, 2 Feb 2017 23:02:26 +0100 Subject: [PATCH] Revert "Anpassungen an neues SL::File::Object Interface" MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This reverts commit 05e0e8ca1544e1ca706a99e51f9caf9a2f56f6af. Diese Änderung fügt einen Syntax-Fehler ein: syntax error at /home/bernd/kivi/SL/Controller/DownloadZip.pm line 67, near ")) " /home/bernd/kivi/SL/Controller/DownloadZip.pm had compilation errors. --- SL/Controller/DownloadZip.pm | 6 ++++-- SL/Controller/EmailJournal.pm | 2 +- SL/Form.pm | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/SL/Controller/DownloadZip.pm b/SL/Controller/DownloadZip.pm index 06f62213c..5bac4ba2e 100644 --- a/SL/Controller/DownloadZip.pm +++ b/SL/Controller/DownloadZip.pm @@ -64,7 +64,9 @@ sub action_download_orderitems_files { # } if ( scalar (@wanted_files) > 0 ) { $zip->addDirectory($item->part->partnumber); - $zip->addFile($_->get_file ), Encode::encode($name_encoding,$item->part->partnumber.'/'.$_->file_name)) for @wanted_files; + $zip->addFile(SL::File->get_file_path(dbfile => $_ ), + Encode::encode($name_encoding,$item->part->partnumber.'/'.$_->{file_name}) + ) for @wanted_files; } } } @@ -116,7 +118,7 @@ THis method must be inserted into the customer branch: }; if ( rowcount == 0 ) { kivi.display_flash('error', kivi.t8('No articles have been added yet.')); - return false; + return false; } for (var i = 1; i <= rowcount; i++) { data['parts_id_'+i] = $('#id_' + i).val(); diff --git a/SL/Controller/EmailJournal.pm b/SL/Controller/EmailJournal.pm index c818cc393..a4ffc62b5 100644 --- a/SL/Controller/EmailJournal.pm +++ b/SL/Controller/EmailJournal.pm @@ -69,7 +69,7 @@ sub action_download_attachment { my $ref = \$attachment->content; if ( $attachment->file_id > 0 ) { my $file = SL::File->get(id => $attachment->file_id ); - $ref = $file->get_content if $file; + $ref = SL::File->get_content(dbfile => $file) if $file; } $self->send_file($ref, name => $attachment->name, type => $attachment->mime_type); } diff --git a/SL/Form.pm b/SL/Form.pm index 5424a7c92..644b9dbea 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -1212,9 +1212,9 @@ sub send_email { } } foreach my $attfile ( @attfiles ) { - push @{ $mail->{attachments} }, { path => $attfile->get_file, + push @{ $mail->{attachments} }, { path => SL::File->get_file_path(dbfile => $attfile), id => $attfile->id, - type => $attfile->mime_type, + type => $attfile->file_mime_type, name => $attfile->file_name }; } } -- 2.20.1