projects
/
kivitendo-erp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
faec06a
)
ShopPart::get_images um Parameter binary anstatt base64 erweitert
author
Jan Büren
<jan@kivitendo.de>
Wed, 17 Nov 2021 12:07:52 +0000
(13:07 +0100)
committer
Jan Büren
<jan@kivitendo.de>
Fri, 11 Feb 2022 14:19:56 +0000
(15:19 +0100)
SL/DB/ShopPart.pm
patch
|
blob
|
history
diff --git
a/SL/DB/ShopPart.pm
b/SL/DB/ShopPart.pm
index
190aa2b
..
7c67bb1
100644
(file)
--- a/
SL/DB/ShopPart.pm
+++ b/
SL/DB/ShopPart.pm
@@
-50,7
+50,7
@@
sub get_tax_and_price {
}
sub get_images {
}
sub get_images {
- my (
$self
) = @_;
+ my (
$self, %params
) = @_;
require SL::DB::ShopImage;
my $images = SL::DB::Manager::ShopImage->get_all( where => [ 'files.object_id' => $self->{part_id}, ], with_objects => 'file', sort_by => 'position' );
require SL::DB::ShopImage;
my $images = SL::DB::Manager::ShopImage->get_all( where => [ 'files.object_id' => $self->{part_id}, ], with_objects => 'file', sort_by => 'position' );
@@
-61,7
+61,9
@@
sub get_images {
# file->extension should be in SL::File, a valid extension may also be 'tar.gz'
my ($path, $extension) = split(/\.([^\.]+)$/, $file->file_name);
my $content = File::Slurp::read_file($file->get_file);
# file->extension should be in SL::File, a valid extension may also be 'tar.gz'
my ($path, $extension) = split(/\.([^\.]+)$/, $file->file_name);
my $content = File::Slurp::read_file($file->get_file);
- my $temp ={ ( link => 'data:' . $file->mime_type . ';base64,' . MIME::Base64::encode($content, ""), #$content, # MIME::Base64::encode($content),
+
+ my $temp ={ (
+ link => $params{want_binary} ? $content : 'data:' . $file->mime_type . ';base64,' . MIME::Base64::encode($content, ""),
description => $img->file->title,
position => $img->position,
extension => $extension,
description => $img->file->title,
position => $img->position,
extension => $extension,