Revision 38c29d92
Von Werner Hahn vor mehr als 6 Jahren hinzugefügt
SL/Controller/ShopPart.pm | ||
---|---|---|
8 | 8 |
use Data::Dumper; |
9 | 9 |
use SL::Locale::String qw(t8); |
10 | 10 |
use SL::DB::ShopPart; |
11 |
use SL::DB::Default; |
|
11 | 12 |
use SL::Helper::Flash; |
12 | 13 |
|
13 | 14 |
use Rose::Object::MakeMethods::Generic |
... | ... | |
53 | 54 |
|
54 | 55 |
}; |
55 | 56 |
|
57 |
sub action_show_files { |
|
58 |
my ($self) = @_; |
|
59 |
$main::lxdebug->dump(0, 'WH: Show_Files',\$::form); |
|
60 |
require SL::DB::File; |
|
61 |
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' ); |
|
62 |
$main::lxdebug->dump(0, 'WH: ',\$images); |
|
63 |
#my $html = $self->render('shop_part/_list_images', { output => 0 }, IMAGES => $images); |
|
64 |
$self->render('shop_part/_list_images', { header => 0 }, IMAGES => $images); |
|
65 |
#$main::lxdebug->dump(0, 'WH: ',\$html); |
|
66 |
|
|
67 |
#$self->js->html('#shop_images', $html); |
|
68 |
#$self->js->render; |
|
69 |
|
|
70 |
# $self->render('customer_vendor_turnover/count_open_items_by_year', { layout => 0 }); |
|
71 |
|
|
72 |
|
|
73 |
} |
|
74 |
|
|
75 |
sub action_get_categories { |
|
76 |
my ($self) = @_; |
|
77 |
|
|
78 |
my $shop_part = SL::DB::Manager::ShopPart->find_by(id => $::form->{shop_part_id}); |
|
79 |
die unless $shop_part; |
|
80 |
require SL::Shop; |
|
81 |
my $shop = SL::Shop->new( config => $shop_part->shop ); |
|
82 |
my $categories = $shop->connector->get_categories; |
|
83 |
$main::lxdebug->dump(0, 'WH: GET',\$categories); |
|
56 | 84 |
|
85 |
$self->js |
|
86 |
->run( |
|
87 |
'kivi.shop_part.shop_part_dialog', |
|
88 |
t8('Shopcategories'), |
|
89 |
$self->render('shop_part/categories', { output => 0 }, CATEGORIES => $categories ) #, shop_part => $self->shop_part) |
|
90 |
) |
|
91 |
->reinit_widgets; |
|
92 |
|
|
93 |
$self->js->render; |
|
94 |
} |
|
57 | 95 |
|
58 | 96 |
# old: |
59 | 97 |
# sub action_edit { |
... | ... | |
107 | 145 |
$self->js->render; |
108 | 146 |
} |
109 | 147 |
|
110 |
sub action_save_categories {
|
|
148 |
sub render_shop_categories_edit_dialog {
|
|
111 | 149 |
my ($self) = @_; |
112 | 150 |
|
151 |
# when self->shop_part is called in template, it will be an existing shop_part with id, |
|
152 |
# or a new shop_part with only part_id and shop_id set |
|
153 |
$self->js |
|
154 |
->run( |
|
155 |
'kivi.shop_part.shop_part_dialog', |
|
156 |
t8('Shopcategories'), |
|
157 |
$self->render('shop_part/categories', { output => 0 }) #, shop_part => $self->shop_part) |
|
158 |
) |
|
159 |
->reinit_widgets; |
|
160 |
|
|
161 |
$self->js->render; |
|
162 |
} |
|
163 |
sub action_reorder { |
|
164 |
my ($self) = @_; |
|
165 |
$main::lxdebug->message(0, "WH:REORDER "); |
|
166 |
require SL::DB::File; |
|
167 |
SL::DB::File->reorder_list(@{ $::form->{image_id} || [] }); |
|
168 |
$main::lxdebug->message(0, "WH:REORDER II "); |
|
169 |
|
|
170 |
$self->render(\'', { type => 'json' }); |
|
171 |
} |
|
172 |
|
|
113 | 173 |
# |
114 | 174 |
# internal stuff |
115 | 175 |
# |
Auch abrufbar als: Unified diff
Shopmodul: ShopPart Bilder und Kategorien
Bilder werden als Tabelle angezeigt
Conflicts:
templates/webpages/ic/tabs/_shop.html
Shopparts: Bilder werden angezeigt TODO Bilder löschen
Shopkategorien werden aus der Api/Shop geholt und angezeigt zum markieren
Conflicts:
SL/Controller/ShopPart.pm
SL/ShopConnector/Shopware.pm
js/kivi.shop_part.js