sub action_create_pdf {
my ($self, %params) = @_;
- my %result = SL::Template::LaTeX->parse_and_create_pdf('requirement_spec.tex', SELF => $self, rspec => $self->requirement_spec);
+ my $base_name = $self->requirement_spec->type->template_file_name || 'requirement_spec';
+ my %result = SL::Template::LaTeX->parse_and_create_pdf("${base_name}.tex", SELF => $self, rspec => $self->requirement_spec);
$::form->error(t8('Conversion to PDF failed: #1', $result{error})) if $result{error};
sub action_new {
my ($self) = @_;
- $self->{requirement_spec_type} = SL::DB::RequirementSpecType->new;
+ $self->{requirement_spec_type} = SL::DB::RequirementSpecType->new(template_file_name => 'requirement_spec');
$self->render('requirement_spec_type/form', title => t8('Create a new requirement spec type'));
}
__PACKAGE__->meta->table('requirement_spec_types');
__PACKAGE__->meta->columns(
- description => { type => 'text', not_null => 1 },
- id => { type => 'serial', not_null => 1 },
- itime => { type => 'timestamp', default => 'now()' },
- mtime => { type => 'timestamp' },
- position => { type => 'integer', not_null => 1 },
+ description => { type => 'text', not_null => 1 },
+ id => { type => 'serial', not_null => 1 },
+ itime => { type => 'timestamp', default => 'now()' },
+ mtime => { type => 'timestamp' },
+ position => { type => 'integer', not_null => 1 },
+ template_file_name => { type => 'text' },
);
__PACKAGE__->meta->primary_key_columns([ 'id' ]);
'Print dunnings' => 'Mahnungen drucken',
'Print list' => 'Liste ausdrucken',
'Print options' => 'Druckoptionen',
+ 'Print template base file name' => 'Druckvorlagen-Basisdateiname',
'Print templates' => 'Druckvorlagen',
'Print templates to use' => 'Zu verwendende Druckvorlagen',
'Printer' => 'Drucker',
'The background job has been saved.' => 'Der Hintergrund-Job wurde gespeichert.',
'The background job was executed successfully.' => 'Der Hintergrund-Job wurde erfolgreich ausgeführt.',
'The bank information must not be empty.' => 'Die Bankinformationen müssen vollständig ausgefüllt werden.',
+ 'The base file name without a path or an extension to be used for printing for this type of requirement spec.' => 'Der Basisdateiname ohne Pfadanteil oder Erweiterung, der bei Drucken dieses Pflichtenhefttyps verwendet wird.',
'The base unit does not exist or it is about to be deleted in row %d.' => 'Die Basiseinheit in Zeile %d existiert nicht oder soll gelöscht werden.',
'The base unit does not exist.' => 'Die Basiseinheit existiert nicht.',
'The base unit relations must not contain loops (e.g. by saying that unit A\'s base unit is B, B\'s base unit is C and C\'s base unit is A) in row %d.' => 'Die Beziehungen der Einheiten dürfen keine Schleifen beinhalten (z.B. wenn gesagt wird, dass Einheit As Basiseinheit B, Bs Basiseinheit C und Cs Basiseinheit A ist) in Zeile %d.',
--- /dev/null
+-- @tag: requirement_spec_types_template_file_name
+-- @description: Pflichtenhefttypen: Spalte für Druckvorlagendateinamen
+-- @depends: requirement_specs
+ALTER TABLE requirement_spec_types ADD COLUMN template_file_name TEXT;
+UPDATE requirement_spec_types SET template_file_name = 'requirement_spec';
<td>[% LxERP.t8('Description') %]</td>
<td>[% L.input_tag("requirement_spec_type.description", SELF.requirement_spec_type.description) %]</td>
</tr>
+
+ <tr>
+ <td>[% LxERP.t8('Print template base file name') %]<sup>(1)</sup></td>
+ <td>[% L.input_tag("requirement_spec_type.template_file_name", SELF.requirement_spec_type.template_file_name) %]</td>
+ </tr>
</table>
<p>
[%- END %]
<a href="[% SELF.url_for(action => 'list') %]">[%- LxERP.t8('Abort') %]</a>
</p>
+
+ <p>
+ <sup>(1)</sup>: [% LxERP.t8("The base file name without a path or an extension to be used for printing for this type of requirement spec.") %]
+ </p>
</form>