From: Moritz Bunkus Date: Tue, 12 Aug 2008 12:42:52 +0000 (+0000) Subject: Auslagern von Hersteller/Modell-Zeilen in eigene Templates. Hersteller/Modell auch... X-Git-Tag: release-2.6.0beta2~276 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=602a4d98939e03b3533f5b6de426ee7f719cf2e1;p=kivitendo-erp.git Auslagern von Hersteller/Modell-Zeilen in eigene Templates. Hersteller/Modell auch wieder für Waren aktiviert, nicht nur für Erzeugnisse. Fix für Bug 843. --- diff --git a/bin/mozilla/ic.pl b/bin/mozilla/ic.pl index eb31718b9..93758ec8f 100644 --- a/bin/mozilla/ic.pl +++ b/bin/mozilla/ic.pl @@ -1523,11 +1523,12 @@ sub form_footer { . $locale->text('Update') . qq|"> |; - unless ($form->{item} eq "service") { - print qq| - {makemodel_rows}> - |; - } +####### moved into makemodel_row ############# +# unless ($form->{item} eq "service") { +# print qq| +# {makemodel_rows}> +# |; +# } print qq| {price_rows}>|; @@ -1594,32 +1595,8 @@ sub makemodel_row { $lxdebug->enter_sub(); my ($numrows) = @_; - print qq| - - - - - - - -|; - - for my $i (1 .. $numrows) { - $form->{"make_$i"} =~ s/\"/"/g; - $form->{"model_$i"} =~ s/\"/"/g; - print qq| - - - - -|; - } - - print qq| -
| . $locale->text('Make') . qq|| . $locale->text('Model') . qq|
- - -|; + my @mm_data = grep { $_->{make} ne '' || $_->{model} ne '' } map +{ make => $form->{"make_$_"}, model => $form->{"model_$_"} }, 1 .. $numrows; + print $form->parse_html_template('ic/makemodel', { MM_DATA => [ @mm_data, {} ], mm_rows => scalar @mm_data + 1 }); $lxdebug->leave_sub(); } diff --git a/bin/mozilla/invoice_io.pl b/bin/mozilla/invoice_io.pl index 2f0f8be50..011c872c8 100644 --- a/bin/mozilla/invoice_io.pl +++ b/bin/mozilla/invoice_io.pl @@ -661,7 +661,8 @@ sub display_form { &{$subroutine}($numrows); - $numrows = 0; + $numrows = ++$form->{makemodel_rows}; + $subroutine = "makemodel_row"; } if ($form->{item} eq 'assembly') { $numrows = $form->{price_rows}; diff --git a/templates/webpages/ic/makemodel_de.html b/templates/webpages/ic/makemodel_de.html new file mode 100644 index 000000000..f90fba5ce --- /dev/null +++ b/templates/webpages/ic/makemodel_de.html @@ -0,0 +1,19 @@ +[%- USE HTML %] +[%- USE LxERP %] + + + + + + + + [%- FOREACH row = MM_DATA %] + + + + + [%- END %] +
HerstellerModell
+ + + diff --git a/templates/webpages/ic/makemodel_master.html b/templates/webpages/ic/makemodel_master.html new file mode 100644 index 000000000..356143d8d --- /dev/null +++ b/templates/webpages/ic/makemodel_master.html @@ -0,0 +1,19 @@ +[%- USE HTML %] +[%- USE LxERP %] + + + + + + + + [%- FOREACH row = MM_DATA %] + + + + + [%- END %] +
MakeModel
+ + +