Revision d3ae6850
Von Werner Hahn vor mehr als 7 Jahren hinzugefügt
SL/DB/Helper/ALL.pm | ||
---|---|---|
116 | 116 |
use SL::DB::SepaExportMessageId; |
117 | 117 |
use SL::DB::Shipto; |
118 | 118 |
use SL::DB::Shop; |
119 |
use SL::DB::ShopImage; |
|
119 | 120 |
use SL::DB::ShopOrder; |
120 | 121 |
use SL::DB::ShopOrderItem; |
121 | 122 |
use SL::DB::ShopPart; |
SL/DB/Helper/Mappings.pm | ||
---|---|---|
196 | 196 |
schema_info => 'schema_info', |
197 | 197 |
shipto => 'shipto', |
198 | 198 |
shops => 'shop', |
199 |
shop_images => 'shop_image', |
|
199 | 200 |
shop_orders => 'shop_order', |
200 | 201 |
shop_order_items => 'shop_order_item', |
201 | 202 |
shop_parts => 'shop_part', |
SL/DB/Manager/ShopImage.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::ShopImage; |
|
5 |
|
|
6 |
use strict; |
|
7 |
|
|
8 |
use parent qw(SL::DB::Helper::Manager); |
|
9 |
use SL::DB::Helper::Sorted; |
|
10 |
|
|
11 |
sub object_class { 'SL::DB::ShopImage' } |
|
12 |
|
|
13 |
__PACKAGE__->make_manager_methods; |
|
14 |
|
|
15 |
1; |
SL/DB/MetaSetup/Default.pm | ||
---|---|---|
55 | 55 |
doc_storage_for_attachments => { type => 'text', default => 'Filesystem' }, |
56 | 56 |
doc_storage_for_documents => { type => 'text', default => 'Filesystem' }, |
57 | 57 |
doc_storage_for_images => { type => 'text', default => 'Filesystem' }, |
58 |
doc_storage_for_shopimages => { type => 'text', default => 'Filesystem' }, |
|
58 | 59 |
doc_webdav => { type => 'boolean', default => 'false' }, |
59 | 60 |
dunning_ar => { type => 'integer' }, |
60 | 61 |
dunning_ar_amount_fee => { type => 'integer' }, |
SL/DB/MetaSetup/ShopImage.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::ShopImage; |
|
4 |
|
|
5 |
use strict; |
|
6 |
|
|
7 |
use parent qw(SL::DB::Object); |
|
8 |
|
|
9 |
__PACKAGE__->meta->table('shop_images'); |
|
10 |
|
|
11 |
__PACKAGE__->meta->columns( |
|
12 |
file_id => { type => 'integer' }, |
|
13 |
id => { type => 'serial', not_null => 1 }, |
|
14 |
itime => { type => 'timestamp', default => 'now()' }, |
|
15 |
mtime => { type => 'timestamp' }, |
|
16 |
object_id => { type => 'text', not_null => 1 }, |
|
17 |
org_file_height => { type => 'integer' }, |
|
18 |
org_file_width => { type => 'integer' }, |
|
19 |
position => { type => 'integer' }, |
|
20 |
thumbnail_content => { type => 'bytea' }, |
|
21 |
thumbnail_content_type => { type => 'text' }, |
|
22 |
); |
|
23 |
|
|
24 |
__PACKAGE__->meta->primary_key_columns([ 'id' ]); |
|
25 |
|
|
26 |
__PACKAGE__->meta->allow_inline_column_values(1); |
|
27 |
|
|
28 |
__PACKAGE__->meta->foreign_keys( |
|
29 |
file => { |
|
30 |
class => 'SL::DB::File', |
|
31 |
key_columns => { file_id => 'id' }, |
|
32 |
}, |
|
33 |
); |
|
34 |
|
|
35 |
1; |
|
36 |
; |
SL/DB/ShopImage.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::ShopImage; |
|
5 |
|
|
6 |
use strict; |
|
7 |
|
|
8 |
use SL::DB::MetaSetup::ShopImage; |
|
9 |
use SL::DB::Manager::ShopImage; |
|
10 |
use SL::DB::Helper::ActsAsList; |
|
11 |
|
|
12 |
__PACKAGE__->meta->initialize; |
|
13 |
|
|
14 |
__PACKAGE__->configure_acts_as_list(group_by => [qw(object_id)]); |
|
15 |
|
|
16 |
1; |
sql/Pg-upgrade2/shopimages.sql | ||
---|---|---|
1 |
-- @tag:shopimages |
|
2 |
-- @description: Tabelle für Shopbilder und zusätzliche Konfiguration und valid_type für Filemanagement |
|
3 |
-- @charset: UTF-8 |
|
4 |
-- @depends: release_3_5_0 files shop_parts |
|
5 |
-- @ignore: 0 |
|
6 |
|
|
7 |
CREATE TABLE shop_images( |
|
8 |
id SERIAL PRIMARY KEY, |
|
9 |
file_id INTEGER REFERENCES files(id) ON DELETE CASCADE, |
|
10 |
position INTEGER, |
|
11 |
thumbnail_content BYTEA, |
|
12 |
thumbnail_width INTEGER, |
|
13 |
thumbnail_height INTEGER, |
|
14 |
thumbnail_content_type TEXT, |
|
15 |
itime TIMESTAMP DEFAULT now(), |
|
16 |
mtime TIMESTAMP |
|
17 |
); |
|
18 |
|
|
19 |
CREATE TRIGGER mtime_shop_images BEFORE UPDATE ON shop_images FOR EACH ROW EXECUTE PROCEDURE set_mtime(); |
|
20 |
|
|
21 |
ALTER TABLE defaults ADD COLUMN doc_storage_for_shopimages text default 'Filesystem'; |
|
22 |
|
|
23 |
ALTER TABLE files |
|
24 |
DROP CONSTRAINT valid_type; |
|
25 |
ALTER TABLE files |
|
26 |
ADD CONSTRAINT valid_type CHECK ( |
|
27 |
(object_type = 'credit_note' ) OR (object_type = 'invoice' ) OR (object_type = 'sales_order' ) |
|
28 |
OR (object_type = 'sales_quotation' ) OR (object_type = 'sales_delivery_order' ) OR (object_type = 'request_quotation' ) |
|
29 |
OR (object_type = 'purchase_order' ) OR (object_type = 'purchase_delivery_order' ) OR (object_type = 'purchase_invoice' ) |
|
30 |
OR (object_type = 'vendor' ) OR (object_type = 'customer' ) OR (object_type = 'part' ) |
|
31 |
OR (object_type = 'gl_transaction' ) OR (object_type = 'dunning' ) OR (object_type = 'dunning1' ) |
|
32 |
OR (object_type = 'dunning2' ) OR (object_type = 'dunning3' ) OR (object_type = 'draft' ) |
|
33 |
OR (object_type = 'statement' ) OR (object_type = 'shop_image' ) |
|
34 |
); |
sql/Pg-upgrade2/shopimages_2.sql | ||
---|---|---|
1 |
-- @tag:shopimages_2 |
|
2 |
-- @description: Umbennung der Spalten für Weite und Breite in die Weite und Breite des orginal Bildes |
|
3 |
-- @charset: UTF-8 |
|
4 |
-- @depends: release-3.5.0 files shop_parts shopimages |
|
5 |
-- @ignore: 0 |
|
6 |
|
|
7 |
ALTER TABLE shop_images RENAME thumbnail_width TO org_file_width; |
|
8 |
ALTER TABLE shop_images RENAME thumbnail_height TO org_file_height; |
sql/Pg-upgrade2/shopimages_3.sql | ||
---|---|---|
1 |
-- @tag:shopimages_3 |
|
2 |
-- @description: Neue Spalte object_id um eine group_by Klausel zu haben für act_as_list |
|
3 |
-- @charset: UTF-8 |
|
4 |
-- @depends: release_3_5_0 files shop_parts shopimages |
|
5 |
-- @ignore: 0 |
|
6 |
|
|
7 |
ALTER TABLE shop_images ADD COLUMN object_id text NOT NULL; |
templates/webpages/client_config/_features.html | ||
---|---|---|
58 | 58 |
onchange="return checkavailable_filebackend(this);") %]</td> |
59 | 59 |
<td>[% LxERP.t8('Use this storage backend for uploaded images') %]</td> |
60 | 60 |
</tr> |
61 |
<tr> |
|
62 |
<td align="right">[% LxERP.t8('Storage Type for shopimages') %]</td> |
|
63 |
<td>[% L.select_tag('defaults.doc_storage_for_shopimages', |
|
64 |
[ [ 'None', LxERP.t8('None') ], [ 'Filesystem', LxERP.t8('Files') ],[ 'Webdav', LxERP.t8('WebDAV') ],[ 'ExtDMS', LxERP.t8('ext.DMS') ],[ 'DB', LxERP.t8('Database') ] ], |
|
65 |
default = SELF.defaults.doc_storage_for_shopimages, |
|
66 |
onchange="return checkavailable_filebackend(this);") %]</td> |
|
67 |
<td>[% LxERP.t8('Use this storage backend for uploaded images') %]</td> |
|
68 |
</tr> |
|
61 | 69 |
<tr> |
62 | 70 |
<td align="right">[% LxERP.t8('Delete printfiles') %]</td> |
63 | 71 |
<td>[% L.yes_no_tag('defaults.doc_delete_printfiles', SELF.defaults.doc_delete_printfiles) %]</td> |
Auch abrufbar als: Unified diff
WebshopApi: ShopImage