X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FDB%2FPrinter.pm;h=046027bc5a9e0ba228b0463e0c27168acd9ae3fb;hb=deb4d2dbb676d7d6f69dfe7815d6e0cb09bd4a44;hp=2c3eaccf898be5026b98022ad8084cd1fc0d9226;hpb=6cf3f7762efd40bee49a2b8f11bb4ab6915d9071;p=kivitendo-erp.git diff --git a/SL/DB/Printer.pm b/SL/DB/Printer.pm index 2c3eaccf8..046027bc5 100644 --- a/SL/DB/Printer.pm +++ b/SL/DB/Printer.pm @@ -3,7 +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;