Revision 2e66dde5
Von Moritz Bunkus vor mehr als 11 Jahren hinzugefügt
bin/mozilla/amtemplates.pl | ||
---|---|---|
33 | 33 |
|
34 | 34 |
use File::Find; |
35 | 35 |
|
36 |
use SL::DB::Default; |
|
36 | 37 |
use SL::AM; |
37 | 38 |
use SL::Form; |
38 | 39 |
|
... | ... | |
115 | 116 |
|
116 | 117 |
$main::auth->assert('admin'); |
117 | 118 |
|
119 |
my $defaults = SL::DB::Default->get; |
|
120 |
$form->error($::locale->text('No print templates have been created for this client yet. Please do so in the client configuration.')) if !$defaults->templates; |
|
121 |
|
|
118 | 122 |
if ($form->{"formname"} =~ m|\.\.| || $form->{"formname"} =~ m|^/|) { |
119 | 123 |
$form->{"formname"} =~ s|.*/||; |
120 | 124 |
} |
... | ... | |
205 | 209 |
|
206 | 210 |
my $fname = $File::Find::name; |
207 | 211 |
# remove template dir from name |
208 |
$fname =~ s|^$myconfig{templates}/||;
|
|
212 |
$fname =~ s|^templates/[^/+]/||;
|
|
209 | 213 |
# remove .tex from name |
210 | 214 |
$fname =~ s|.tex$||; |
211 | 215 |
|
212 | 216 |
push(@all_files, $fname); |
213 | 217 |
|
214 |
}, $myconfig{templates});
|
|
218 |
}, $defaults->templates);
|
|
215 | 219 |
|
216 | 220 |
# filter all files already set up (i.e. not already in @values) |
217 | 221 |
my @other_files = grep { my $a=$_; not grep {$a eq $_->{value}} @values } @all_files; |
Auch abrufbar als: Unified diff
'templates' nicht aus %::myconfig, sondern aus Defaults-Tabelle holen