Revision 80f54416
Von Bernd Bleßmann vor fast 9 Jahren hinzugefügt
SL/Controller/Letter.pm | ||
---|---|---|
200 | 200 |
$::form->get_employee_data('prefix' => 'employee', 'id' => $letter->{employee_id}); |
201 | 201 |
$::form->get_employee_data('prefix' => 'salesman', 'id' => $letter->{salesman_id}); |
202 | 202 |
|
203 |
my ($template_file, @template_files) = SL::Helper::CreatePDF->find_template( |
|
204 |
name => 'letter', |
|
205 |
printer_id => $::form->{printer_id}, |
|
206 |
language_id => $::form->{language_id}, |
|
207 |
formname => 'letter', |
|
208 |
format => 'pdf', |
|
209 |
); |
|
210 |
|
|
211 |
if (!defined $template_file) { |
|
212 |
$::form->error($::locale->text('Cannot find matching template for this print request. Please contact your template maintainer. I tried these: #1.', join ', ', map { "'$_'"} @template_files)); |
|
213 |
} |
|
214 |
|
|
203 | 215 |
my %create_params = ( |
204 |
template => scalar(SL::Helper::CreatePDF->find_template( |
|
205 |
name => 'letter', |
|
206 |
printer_id => $::form->{printer_id}, |
|
207 |
language_id => $::form->{language_id}, |
|
208 |
formname => 'letter', |
|
209 |
format => 'pdf', |
|
210 |
)), |
|
216 |
template => $template_file, |
|
211 | 217 |
variables => $::form, |
212 | 218 |
return => 'file_name', |
213 | 219 |
); |
220 |
|
|
214 | 221 |
my $pdf_file_name; |
215 | 222 |
eval { |
216 | 223 |
$pdf_file_name = SL::Helper::CreatePDF->create_pdf(%create_params); |
Auch abrufbar als: Unified diff
Letter: Aussagekräftigere Fehlermeldung, wenn Vorlage nicht gefunden wird.