Revision 63720c4e
Von Werner Hahn vor fast 8 Jahren hinzugefügt
SL/Controller/ShopPart.pm | ||
---|---|---|
7 | 7 |
use Data::Dumper; |
8 | 8 |
use SL::Locale::String qw(t8); |
9 | 9 |
use SL::DB::ShopPart; |
10 |
use SL::DB::File; |
|
10 | 11 |
use SL::DB::Default; |
11 | 12 |
use SL::Helper::Flash; |
12 | 13 |
|
... | ... | |
32 | 33 |
|
33 | 34 |
my $shop_part = SL::DB::Manager::ShopPart->find_by(id => $::form->{shop_part_id}); |
34 | 35 |
die unless $shop_part; |
36 |
$main::lxdebug->dump(0, 'WH: ShopPart',\$shop_part); |
|
37 |
|
|
38 |
#my $part = SL::DB::Manager::Part->find_by(id => $shop_part->{part_id}); |
|
39 |
#$main::lxdebug->dump(0, 'WH: Part',\$part); |
|
40 |
|
|
41 |
#my $cvars = { map { ($_->config->name => { value => $_->value_as_text, is_valid => $_->is_valid }) } @{ $part->cvars_by_config } }; |
|
42 |
#$main::lxdebug->dump(0, 'WH: CVARS',\$cvars); |
|
43 |
|
|
44 |
#my $images = SL::DB::Manager::File->get_all_sorted( where => [ trans_id => $shop_part->{part_id}, modul => 'shop_part', file_content_type => { like => 'image/%' } ], sort_by => 'position' ); |
|
45 |
#$main::lxdebug->dump(0, 'WH: Images',\$images); |
|
46 |
|
|
47 |
#$part->{shop_part} = $shop_part; |
|
48 |
#$part->{cvars} = $cvars; |
|
49 |
#$part->{images} = $images; |
|
50 |
|
|
51 |
#$main::lxdebug->dump(0, 'WH: Part II',\$part); |
|
35 | 52 |
require SL::Shop; |
36 | 53 |
my $shop = SL::Shop->new( config => $shop_part->shop ); |
37 | 54 |
|
38 |
# TODO: generate data to upload to shop |
|
55 |
# TODO: generate data to upload to shop. Goes to SL::Connector::XXXConnector. Here the object holds all data from parts, shop_parts, files, custom_variables for one article
|
|
39 | 56 |
my $part_hash = $shop_part->part->as_tree; |
40 | 57 |
my $json = SL::JSON::to_json($part_hash); |
41 | 58 |
my $return = $shop->connector->update_part($self->shop_part, $json); |
... | ... | |
56 | 73 |
sub action_show_files { |
57 | 74 |
my ($self) = @_; |
58 | 75 |
|
59 |
require SL::DB::File; |
|
60 | 76 |
my $images = SL::DB::Manager::File->get_all_sorted( where => [ trans_id => $::form->{id}, modul => $::form->{modul}, file_content_type => { like => 'image/%' } ], sort_by => 'position' ); |
61 | 77 |
|
62 | 78 |
$self->render('shop_part/_list_images', { header => 0 }, IMAGES => $images); |
... | ... | |
214 | 230 |
=head1 AUTHORS |
215 | 231 |
|
216 | 232 |
G. Richardson E<lt>information@kivitendo-premium.deE<gt> |
217 |
|
|
233 |
W. Hahn E<lt>wh@futureworldsearch.netE<gt> |
|
218 | 234 |
=cut |
Auch abrufbar als: Unified diff
ShopPart: Test Artikel wird mit json im LWP::UserAgent in den Shop hochgeladen