X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/kivitendo-erp.git/blobdiff_plain/499a130a2dff9761167722b9f3b68a52343860a7..e73f7350574cb4e46db4a4d6ad5cdaa075806489:/SL/DB/RecordTemplate.pm diff --git a/SL/DB/RecordTemplate.pm b/SL/DB/RecordTemplate.pm index f7cad09ef..1360c9576 100644 --- a/SL/DB/RecordTemplate.pm +++ b/SL/DB/RecordTemplate.pm @@ -3,6 +3,7 @@ package SL::DB::RecordTemplate; use strict; use DateTime::Format::Strptime; +use List::Util qw(first); use SL::DB::MetaSetup::RecordTemplate; use SL::DB::Manager::RecordTemplate; @@ -112,6 +113,12 @@ sub substitute_variables { } } +sub template_name_to_use { + my ($self, @names) = @_; + + return first { ($_ // '') ne '' } (@names, $self->template_name, $::locale->text('unnamed record template')); +} + 1; __END__