X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FDB%2FPrinter.pm;h=83f91480619994f404b36c1d9f126f3a5fab8a3f;hb=7c60c2423f6fd27a78cf89ca62821ea1e41e85f5;hp=fd58eb55c8ce1dd84b7ae3fa1bca7927cb45c1d3;hpb=f6a762c9fcbf6b3971b8764ccb87cd919370fc11;p=kivitendo-erp.git diff --git a/SL/DB/Printer.pm b/SL/DB/Printer.pm index fd58eb55c..83f914806 100644 --- a/SL/DB/Printer.pm +++ b/SL/DB/Printer.pm @@ -3,11 +3,22 @@ package SL::DB::Printer; use strict; use SL::DB::MetaSetup::Printer; - -__PACKAGE__->meta->make_manager_class; +use SL::DB::Manager::Printer; +use SL::DB::Helper::Util; 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;