Verwaltung von benutzerdefinierten Variablen auf Controller umgestellt
[kivitendo-erp.git] / SL / DB / CustomVariableConfig.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::CustomVariableConfig;
5
6 use strict;
7
8 use SL::DB::MetaSetup::CustomVariableConfig;
9 use SL::DB::Manager::CustomVariableConfig;
10 use SL::DB::Helper::ActsAsList;
11
12 __PACKAGE__->configure_acts_as_list(group_by => [qw(module)]);
13
14 sub validate {
15   my ($self) = @_;
16
17   my @errors;
18   push @errors, $::locale->text('The name is missing.')        if !$self->name;
19   push @errors, $::locale->text('The description is missing.') if !$self->description;
20   push @errors, $::locale->text('The type is missing.')        if !$self->type;
21   push @errors, $::locale->text('The option field is empty.')  if (($self->type || '') eq 'select') && !$self->options;
22
23   return @errors;
24 }
25
26 1;