X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/1066d8c03c3700f5e977b98219572ef9a513d027..2737667aa9394428f885187928509e7c5d0ec4d4:/SL/DB/CustomVariableConfig.pm diff --git a/SL/DB/CustomVariableConfig.pm b/SL/DB/CustomVariableConfig.pm index 5823e9b7c..6c836f04f 100644 --- a/SL/DB/CustomVariableConfig.pm +++ b/SL/DB/CustomVariableConfig.pm @@ -6,9 +6,21 @@ package SL::DB::CustomVariableConfig; use strict; use SL::DB::MetaSetup::CustomVariableConfig; +use SL::DB::Manager::CustomVariableConfig; use SL::DB::Helper::ActsAsList; -# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all. -__PACKAGE__->meta->make_manager_class; +__PACKAGE__->configure_acts_as_list(group_by => [qw(module)]); + +sub validate { + my ($self) = @_; + + my @errors; + push @errors, $::locale->text('The name is missing.') if !$self->name; + push @errors, $::locale->text('The description is missing.') if !$self->description; + push @errors, $::locale->text('The type is missing.') if !$self->type; + push @errors, $::locale->text('The option field is empty.') if (($self->type || '') eq 'select') && !$self->options; + + return @errors; +} 1;