Revision 72903759
Von Kivitendo Admin vor mehr als 8 Jahren hinzugefügt
SL/DB/Helper/ALL.pm | ||
---|---|---|
109 | 109 |
use SL::DB::SepaExportItem; |
110 | 110 |
use SL::DB::SepaExportMessageId; |
111 | 111 |
use SL::DB::Shipto; |
112 |
use SL::DB::ShopPart; |
|
112 | 113 |
use SL::DB::Status; |
113 | 114 |
use SL::DB::Tax; |
114 | 115 |
use SL::DB::TaxKey; |
SL/DB/Helper/Mappings.pm | ||
---|---|---|
189 | 189 |
sepa_export_message_ids => 'SepaExportMessageId', |
190 | 190 |
schema_info => 'schema_info', |
191 | 191 |
shipto => 'shipto', |
192 |
shop_parts => 'shop_part', |
|
192 | 193 |
status => 'status', |
193 | 194 |
tax => 'tax', |
194 | 195 |
taxkeys => 'tax_key', |
SL/DB/Manager/ShopPart.pm | ||
---|---|---|
1 |
# This file has been auto-generated only because it didn't exist. |
|
2 |
# Feel free to modify it at will; it will not be overwritten automatically. |
|
3 |
|
|
4 |
package SL::DB::Manager::ShopPart; |
|
5 |
|
|
6 |
use strict; |
|
7 |
|
|
8 |
use SL::DB::Helper::Manager; |
|
9 |
use base qw(SL::DB::Helper::Manager); |
|
10 |
|
|
11 |
sub object_class { 'SL::DB::ShopPart' } |
|
12 |
|
|
13 |
__PACKAGE__->make_manager_methods; |
|
14 |
|
|
15 |
1; |
SL/DB/MetaSetup/ShopPart.pm | ||
---|---|---|
1 |
# This file has been auto-generated. Do not modify it; it will be overwritten |
|
2 |
# by rose_auto_create_model.pl automatically. |
|
3 |
package SL::DB::ShopPart; |
|
4 |
|
|
5 |
use strict; |
|
6 |
|
|
7 |
use base qw(SL::DB::Object); |
|
8 |
|
|
9 |
__PACKAGE__->meta->table('shop_parts'); |
|
10 |
|
|
11 |
__PACKAGE__->meta->columns( |
|
12 |
active => { type => 'boolean', default => 'false', not_null => 1 }, |
|
13 |
front_page => { type => 'boolean', default => 'false', not_null => 1 }, |
|
14 |
id => { type => 'serial', not_null => 1 }, |
|
15 |
itime => { type => 'timestamp', default => 'now()' }, |
|
16 |
last_update => { type => 'timestamp' }, |
|
17 |
mtime => { type => 'timestamp' }, |
|
18 |
part_id => { type => 'integer' }, |
|
19 |
shop_category => { type => 'text' }, |
|
20 |
shop_description => { type => 'text' }, |
|
21 |
shop_id => { type => 'integer' }, |
|
22 |
show_date => { type => 'date' }, |
|
23 |
sortorder => { type => 'integer' }, |
|
24 |
); |
|
25 |
|
|
26 |
__PACKAGE__->meta->primary_key_columns([ 'id' ]); |
|
27 |
|
|
28 |
__PACKAGE__->meta->unique_keys([ 'shop_id', 'part_id' ]); |
|
29 |
|
|
30 |
__PACKAGE__->meta->allow_inline_column_values(1); |
|
31 |
|
|
32 |
__PACKAGE__->meta->foreign_keys( |
|
33 |
part => { |
|
34 |
class => 'SL::DB::Part', |
|
35 |
key_columns => { part_id => 'id' }, |
|
36 |
}, |
|
37 |
|
|
38 |
shop => { |
|
39 |
class => 'SL::DB::Shop', |
|
40 |
key_columns => { shop_id => 'id' }, |
|
41 |
}, |
|
42 |
); |
|
43 |
|
|
44 |
1; |
|
45 |
; |
SL/DB/ShopPart.pm | ||
---|---|---|
1 |
# This file has been auto-generated only because it didn't exist. |
|
2 |
# Feel free to modify it at will; it will not be overwritten automatically. |
|
3 |
|
|
4 |
package SL::DB::ShopPart; |
|
5 |
|
|
6 |
use strict; |
|
7 |
|
|
8 |
use SL::DB::MetaSetup::ShopPart; |
|
9 |
use SL::DB::Manager::ShopPart; |
|
10 |
|
|
11 |
__PACKAGE__->meta->initialize; |
|
12 |
|
|
13 |
1; |
SL/IC.pm | ||
---|---|---|
548 | 548 |
# commit |
549 | 549 |
my $rc = $dbh->commit; |
550 | 550 |
|
551 |
# if ( $form->{shop} ) { # && $previous_values->{"shop_part_id"} ) { |
|
552 |
# my $part = SL::DB::Manager::Part->find_by( id => $form->{"id"} ); |
|
553 |
# die "no part" unless $part; |
|
554 |
# my %shophash = map { ( $_ =~ m/^shop_(.*)/ ) => $form->{$_} } grep { $_ =~ /^shop_/ } keys %$::form; |
|
555 |
# delete $shophash{show_date} unless $shophash{show_date}; |
|
556 |
# delete $shophash{sortorder} unless $shophash{sortorder}; |
|
557 |
# |
|
558 |
# my $shop_part; |
|
559 |
# if ( $part->shop_part ) { |
|
560 |
# # update existing shop_port |
|
561 |
# $shop_part = $part->shop_part; |
|
562 |
# foreach ( keys %shophash ) { |
|
563 |
# $shop_part->$_( $shophash{$_} ); |
|
564 |
# }; |
|
565 |
# } else { |
|
566 |
# # shop_part didn't exist yet |
|
567 |
# $shop_part = SL::DB::ShopPart->new( %shophash )->save; |
|
568 |
# $part->shop_part_id( $shop_part->id ); |
|
569 |
# $part->save; |
|
570 |
# }; |
|
571 |
# # TODO: make part of request |
|
572 |
# $shop_part->save; |
|
573 |
# }; |
|
574 |
|
|
575 |
|
|
551 | 576 |
$main::lxdebug->leave_sub(); |
552 | 577 |
|
553 | 578 |
return $rc; |
sql/Pg-upgrade2/shop_parts.sql | ||
---|---|---|
1 |
-- @tag: shop_parts |
|
2 |
-- @description: Add tables for part information for shop |
|
3 |
-- @charset: UTF-8 |
|
4 |
-- @depends: release_3_3_0 shops |
|
5 |
-- @ignore: 0 |
|
6 |
|
|
7 |
CREATE TABLE shop_parts ( |
|
8 |
id SERIAL PRIMARY KEY, |
|
9 |
shop_id INTEGER REFERENCES shops(id), |
|
10 |
part_id INTEGER REFERENCES parts(id), |
|
11 |
shop_description TEXT, |
|
12 |
itime TIMESTAMP DEFAULT now(), |
|
13 |
mtime TIMESTAMP, |
|
14 |
last_update TIMESTAMP, |
|
15 |
show_date DATE, -- the starting date for displaying part in shop |
|
16 |
sortorder INTEGER, |
|
17 |
front_page BOOLEAN NOT NULL DEFAULT false, |
|
18 |
active BOOLEAN NOT NULL DEFAULT false, -- rather than obsolete |
|
19 |
shop_category TEXT, |
|
20 |
UNIQUE (part_id, shop_id) -- make sure a shop_part appears only once per shop and part |
|
21 |
); |
|
22 |
|
|
23 |
CREATE TRIGGER mtime_shop_parts BEFORE UPDATE ON shop_parts |
|
24 |
FOR EACH ROW EXECUTE PROCEDURE set_mtime(); |
|
25 |
|
|
26 |
-- CREATE TABLE shop_meta_tags ( |
|
27 |
-- id integer NOT NULL DEFAULT nextval('shop_parts_id'), |
|
28 |
-- description |
|
29 |
-- ); |
|
30 |
|
|
31 |
-- CREATE TABLE shop_categories ( |
|
32 |
-- ); |
templates/webpages/ic/form_footer.html | ||
---|---|---|
29 | 29 |
[%- IF LANGUAGES.size %] |
30 | 30 |
[% PROCESS 'ic/tabs/_edit_translations.html' %] |
31 | 31 |
[%- END %] |
32 |
[%- IF shop %] |
|
33 |
[% PROCESS 'ic/tabs/_shop.html' %] |
|
34 |
[%- END %] |
|
32 | 35 |
|
33 | 36 |
[%- IF id %] |
34 | 37 |
<div id="sales_price_information"> |
templates/webpages/ic/form_header.html | ||
---|---|---|
36 | 36 |
[%- IF id %] |
37 | 37 |
<li><a href="#price_rules">[% 'Price Rules' | $T8 %]</a></li> |
38 | 38 |
[% END %] |
39 |
[%- IF shop %] |
|
40 |
<li><a href="#shop_variables">[% 'Shop variables' | $T8 %]</a></li> |
|
41 |
[%- END %] |
|
39 | 42 |
</ul> |
40 | 43 |
|
41 | 44 |
<div id="master_data"> |
templates/webpages/ic/tabs/_shop.html | ||
---|---|---|
1 |
[%- USE HTML %][%- USE L -%][%- USE P -%][%- USE LxERP -%] |
|
2 |
|
|
3 |
<div id="shop_variables"> |
|
4 |
<table> |
|
5 |
<tr> |
|
6 |
<td>[% LxERP.t8("Description") %]</td> |
|
7 |
<td>[% L.textarea_tag("shop_shop_description", shop_part.shop_description) %]</td> |
|
8 |
</tr> |
|
9 |
<tr> |
|
10 |
<td>[% LxERP.t8("Sort order") %]</td> |
|
11 |
<td>[% L.input_tag("shop_sortorder", shop_part.sortorder, size=2) %]</td> |
|
12 |
</tr> |
|
13 |
<tr> |
|
14 |
<td>[% LxERP.t8("Date") %]</td> |
|
15 |
<td>[% L.date_tag("shop_show_date", shop_part.show_date) %]</td> |
|
16 |
</tr> |
|
17 |
<tr> |
|
18 |
<td>[% LxERP.t8("Front page") %]</td> |
|
19 |
<td>[% L.yes_no_tag('shop_front_page', shop_part.front_page) %]</td> |
|
20 |
</tr> |
|
21 |
</tr> |
|
22 |
|
|
23 |
</table> |
|
24 |
[% # L.dump(shop_part) %] |
|
25 |
</div> |
|
26 |
|
Auch abrufbar als: Unified diff
Shop - Einführung von ShopParts
Erster Test mit einem Shop Reiter in Artikelmaske