Anpassungen an neues SL::File::Object Interface
authorMartin Helmling martin.helmling@octosoft.eu <martin.helmling@octosoft.eu>
Thu, 2 Feb 2017 16:13:22 +0000 (17:13 +0100)
committerMartin Helmling martin.helmling@octosoft.eu <martin.helmling@octosoft.eu>
Thu, 2 Feb 2017 16:13:22 +0000 (17:13 +0100)
SL/Controller/DownloadZip.pm
SL/Controller/EmailJournal.pm
SL/Form.pm

index 5bac4ba..06f6221 100644 (file)
@@ -64,9 +64,7 @@ sub action_download_orderitems_files {
       # }
       if ( scalar (@wanted_files) > 0 ) {
         $zip->addDirectory($item->part->partnumber);
-        $zip->addFile(SL::File->get_file_path(dbfile => $_ ),
-                      Encode::encode($name_encoding,$item->part->partnumber.'/'.$_->{file_name})
-                      ) for @wanted_files;
+        $zip->addFile($_->get_file ), Encode::encode($name_encoding,$item->part->partnumber.'/'.$_->file_name)) for @wanted_files;
       }
     }
   }
@@ -118,7 +116,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();
index a4ffc62..c818cc3 100644 (file)
@@ -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 = SL::File->get_content(dbfile => $file) if $file;
+    $ref = $file->get_content if $file;
   }
   $self->send_file($ref, name => $attachment->name, type => $attachment->mime_type);
 }
index 644b9db..5424a7c 100644 (file)
@@ -1212,9 +1212,9 @@ sub send_email {
       }
     }
     foreach my $attfile ( @attfiles ) {
-      push @{ $mail->{attachments} }, { path => SL::File->get_file_path(dbfile => $attfile),
+      push @{ $mail->{attachments} }, { path => $attfile->get_file,
                                         id   => $attfile->id,
-                                        type => $attfile->file_mime_type,
+                                        type => $attfile->mime_type,
                                         name => $attfile->file_name };
     }
   }