From: Moritz Bunkus Date: Wed, 2 Mar 2011 14:32:40 +0000 (+0100) Subject: Verknüpfungen Parts/Customers/Vendors -> Custom Variables X-Git-Tag: release-2.7.0beta1~396^2~27 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=39e13b0fb4b323c1d8c691b0e55c37d0ca1becc5;p=kivitendo-erp.git Verknüpfungen Parts/Customers/Vendors -> Custom Variables --- diff --git a/SL/DB/Customer.pm b/SL/DB/Customer.pm index f2893ae74..c2c436dfd 100644 --- a/SL/DB/Customer.pm +++ b/SL/DB/Customer.pm @@ -27,6 +27,12 @@ __PACKAGE__->meta->add_relationship( class => 'SL::DB::Business', column_map => { business_id => 'id' }, }, + custom_variables => { + type => 'one to many', + class => 'SL::DB::CustomVariable', + column_map => { id => 'trans_id' }, + query_args => [ config_id => [ \"(SELECT custom_variable_configs.id FROM custom_variable_configs WHERE custom_variable_configs.module = 'CT')" ] ], + }, ); __PACKAGE__->meta->make_manager_class; diff --git a/SL/DB/Part.pm b/SL/DB/Part.pm index 79ef2a482..fd53dd64e 100644 --- a/SL/DB/Part.pm +++ b/SL/DB/Part.pm @@ -37,6 +37,22 @@ __PACKAGE__->meta->add_relationships( class => 'SL::DB::Price', column_map => { id => 'parts_id' }, }, + makemodels => { + type => 'one to many', + class => 'SL::DB::MakeModel', + column_map => { id => 'parts_id' }, + }, + translations => { + type => 'one to many', + class => 'SL::DB::Translation', + column_map => { id => 'parts_id' }, + }, + custom_variables => { + type => 'one to many', + class => 'SL::DB::CustomVariable', + column_map => { id => 'trans_id' }, + query_args => [ config_id => [ \"(SELECT custom_variable_configs.id FROM custom_variable_configs WHERE custom_variable_configs.module = 'IC')" ] ], + }, ); __PACKAGE__->meta->initialize; diff --git a/SL/DB/Vendor.pm b/SL/DB/Vendor.pm index 13b70ebe2..53ac297b5 100644 --- a/SL/DB/Vendor.pm +++ b/SL/DB/Vendor.pm @@ -26,6 +26,12 @@ __PACKAGE__->meta->add_relationship( class => 'SL::DB::Business', column_map => { business_id => 'id' }, }, + custom_variables => { + type => 'one to many', + class => 'SL::DB::CustomVariable', + column_map => { id => 'trans_id' }, + query_args => [ config_id => [ \"(SELECT custom_variable_configs.id FROM custom_variable_configs WHERE custom_variable_configs.module = 'CT')" ] ], + }, ); __PACKAGE__->meta->make_manager_class;