X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Famtemplates.pl;h=0045635572347460510e88339e6b1af80077a969;hb=b6213d3539ccd179cd1f21b9afc54b8de8970774;hp=f8c6972e66bdcc30371214fa7c598b04a718c6e6;hpb=891f62176912eb5c1e8864a1140635e4ad533d08;p=kivitendo-erp.git diff --git a/bin/mozilla/amtemplates.pl b/bin/mozilla/amtemplates.pl index f8c6972e6..004563557 100644 --- a/bin/mozilla/amtemplates.pl +++ b/bin/mozilla/amtemplates.pl @@ -201,6 +201,7 @@ sub display_template_form { # if ($format eq "tex") { # search all .tex-files in template dir (recursively) + my $template_dir = $defaults->templates; my @all_files; find( sub { @@ -209,13 +210,13 @@ sub display_template_form { my $fname = $File::Find::name; # remove template dir from name - $fname =~ s|^templates/[^/+]/||; + $fname =~ s|^\Q$template_dir\E/||; # remove .tex from name $fname =~ s|.tex$||; push(@all_files, $fname); - }, $defaults->templates); + }, $template_dir); # filter all files already set up (i.e. not already in @values) my @other_files = grep { my $a=$_; not grep {$a eq $_->{value}} @values } @all_files;