X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/kivitendo-erp.git/blobdiff_plain/f6a762c9fcbf6b3971b8764ccb87cd919370fc11..7317b8d9828cad7fd033d73589d7e9665fb397c7:/SL/DB/Printer.pm diff --git a/SL/DB/Printer.pm b/SL/DB/Printer.pm index fd58eb55c..046027bc5 100644 --- a/SL/DB/Printer.pm +++ b/SL/DB/Printer.pm @@ -3,11 +3,24 @@ package SL::DB::Printer; use strict; use SL::DB::MetaSetup::Printer; +use SL::DB::Manager::Printer; +use SL::DB::Helper::Util; -__PACKAGE__->meta->make_manager_class; +__PACKAGE__->meta->initialize; sub description { goto &printer_description; } +sub validate { + my ($self) = @_; + + my @errors; + push @errors, $::locale->text('The description is missing.') if !$self->printer_description; + push @errors, $::locale->text('The command is missing.') if !$self->printer_command; + push @errors, $::locale->text('The description is not unique.') if !SL::DB::Helper::Util::is_unique($self, 'printer_description'); + + return @errors; +} + 1;