From: Thomas Heck Date: Wed, 26 Jun 2013 09:04:14 +0000 (+0200) Subject: Kein use von DB-Objekten in DB-Objekten X-Git-Tag: release-3.1.0beta1~161^2~29 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=cc6da32007ec4ba8f51719720fb90b3c275945ce;p=kivitendo-erp.git Kein use von DB-Objekten in DB-Objekten --- diff --git a/SL/DB/CustomVariable.pm b/SL/DB/CustomVariable.pm index c90e03800..edc595ce4 100644 --- a/SL/DB/CustomVariable.pm +++ b/SL/DB/CustomVariable.pm @@ -4,10 +4,7 @@ package SL::DB::CustomVariable; use strict; - use SL::DB::MetaSetup::CustomVariable; -use SL::DB::CustomVariableValidity; -use SL::DB::Customer; __PACKAGE__->meta->initialize; @@ -26,6 +23,8 @@ sub value { goto &number_value; } else { + require SL::DB::Customer; + my $id = int($self->number_value); return $id ? SL::DB::Customer->new(id => $id)->load() : 0; } @@ -36,6 +35,8 @@ sub value { sub is_valid { my ($self) = @_; + require SL::DB::CustomVariableValidity; + return SL::DB::Manager::CustomVariableValidity->get_all_count(config_id => $self->config_id, trans_id => $self->trans_id) == 0; }