From: Moritz Bunkus Date: Mon, 5 Aug 2013 12:57:01 +0000 (+0200) Subject: Pflichtenhefte: Druckvorlagendateinamen bei Pflicthenhefttypen festlegen können X-Git-Tag: release-3.2.0beta~467^2~85 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=4ee26bcc22fa980555706ca24323ee9c552c1303;p=kivitendo-erp.git Pflichtenhefte: Druckvorlagendateinamen bei Pflicthenhefttypen festlegen können --- diff --git a/SL/Controller/RequirementSpec.pm b/SL/Controller/RequirementSpec.pm index 3acb6b963..6afe99730 100644 --- a/SL/Controller/RequirementSpec.pm +++ b/SL/Controller/RequirementSpec.pm @@ -204,7 +204,8 @@ sub action_revert_to { 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}; diff --git a/SL/Controller/RequirementSpecType.pm b/SL/Controller/RequirementSpecType.pm index 060cdc80d..e9bdb7b82 100644 --- a/SL/Controller/RequirementSpecType.pm +++ b/SL/Controller/RequirementSpecType.pm @@ -31,7 +31,7 @@ sub action_list { 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')); } diff --git a/SL/DB/MetaSetup/RequirementSpecType.pm b/SL/DB/MetaSetup/RequirementSpecType.pm index 5bffd8a25..102b8178f 100644 --- a/SL/DB/MetaSetup/RequirementSpecType.pm +++ b/SL/DB/MetaSetup/RequirementSpecType.pm @@ -9,11 +9,12 @@ use base qw(SL::DB::Object); __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' ]); diff --git a/locale/de/all b/locale/de/all index db1d7cf0b..0f838eb6f 100755 --- a/locale/de/all +++ b/locale/de/all @@ -1764,6 +1764,7 @@ $self->{texts} = { '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', @@ -2275,6 +2276,7 @@ $self->{texts} = { '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.', diff --git a/sql/Pg-upgrade2/requirement_spec_types_template_file_name.sql b/sql/Pg-upgrade2/requirement_spec_types_template_file_name.sql new file mode 100644 index 000000000..410e27d87 --- /dev/null +++ b/sql/Pg-upgrade2/requirement_spec_types_template_file_name.sql @@ -0,0 +1,5 @@ +-- @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'; diff --git a/templates/webpages/requirement_spec_type/form.html b/templates/webpages/requirement_spec_type/form.html index 36f2923df..814e49d5f 100755 --- a/templates/webpages/requirement_spec_type/form.html +++ b/templates/webpages/requirement_spec_type/form.html @@ -10,6 +10,11 @@ [% LxERP.t8('Description') %] [% L.input_tag("requirement_spec_type.description", SELF.requirement_spec_type.description) %] + + + [% LxERP.t8('Print template base file name') %](1) + [% L.input_tag("requirement_spec_type.template_file_name", SELF.requirement_spec_type.template_file_name) %] +

@@ -21,4 +26,8 @@ [%- END %] [%- LxERP.t8('Abort') %]

+ +

+ (1): [% LxERP.t8("The base file name without a path or an extension to be used for printing for this type of requirement spec.") %] +