X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fio.pl;h=150f13a09ea883af2e9c9bbd487fc22f55ab6860;hb=2dacd2790bb5e0990ec5fe89a9d59370b018c25c;hp=51326c4b1843cd87d55143a7ffb0a7c9be9afe6c;hpb=bb55aa5910a0faa71d6cfc0a215a352dcc115f76;p=kivitendo-erp.git diff --git a/bin/mozilla/io.pl b/bin/mozilla/io.pl index 51326c4b1..150f13a09 100644 --- a/bin/mozilla/io.pl +++ b/bin/mozilla/io.pl @@ -52,8 +52,8 @@ require "bin/mozilla/common.pl"; if (-f "bin/mozilla/custom_io.pl") { eval { require "bin/mozilla/custom_io.pl"; }; } -if (-f "bin/mozilla/$form->{login}_io.pl") { - eval { require "bin/mozilla/$form->{login}_io.pl"; }; +if (-f "bin/mozilla/$::form->{login}_io.pl") { + eval { require "bin/mozilla/$::form->{login}_io.pl"; }; } 1; @@ -93,7 +93,7 @@ use SL::AM; use Data::Dumper; sub _check_io_auth { - $auth->assert('part_service_assembly_edit | vendor_invoice_edit | sales_order_edit | invoice_edit |' . + $main::auth->assert('part_service_assembly_edit | vendor_invoice_edit | sales_order_edit | invoice_edit |' . 'request_quotation_edit | sales_quotation_edit | purchase_order_edit | ' . 'purchase_delivery_order_edit | sales_delivery_order_edit'); } @@ -372,7 +372,7 @@ sub display_row { $form->{invsubtotal} += $linetotal; # Benutzerdefinierte Variablen für Waren/Dienstleistungen/Erzeugnisse - _render_custom_variables_inputs(ROW2 => \@ROW2, row => $i); + _render_custom_variables_inputs(ROW2 => \@ROW2, row => $i, part_id => $form->{"id_$i"}); push @ROWS, { ROW1 => \@ROW1, ROW2 => \@ROW2, HIDDENS => \@HIDDENS, colspan => $colspan, error => $form->{"row_error_$i"}, }; } @@ -895,7 +895,7 @@ sub order { $script =~ s|.pl$||; $locale = new Locale($language, $script); - map { $form->{"select$_"} = "" } ($form->{vc}, currency); + map { $form->{"select$_"} = "" } ($form->{vc}, "currency"); $currency = $form->{currency}; @@ -950,7 +950,7 @@ sub quotation { require "bin/mozilla/$form->{script}"; - map { $form->{"select$_"} = "" } ($form->{vc}, currency); + map { $form->{"select$_"} = "" } ($form->{vc}, "currency"); $currency = $form->{currency}; @@ -1449,10 +1449,9 @@ sub print_form { } if ($form->{language} ne "") { - map({ $form->{"unit"}->[$_] = - AM->translate_units($form, $form->{"language"}, - $form->{"unit"}->[$_], $form->{"qty"}->[$_]); } - (0..scalar(@{$form->{"unit"}}) - 1)); + my $template_arrays = $form->{TEMPLATE_ARRAYS} || $form; + map { $template_arrays->{unit}->[$_] = AM->translate_units($form, $form->{language}, $template_arrays->{unit}->[$_], $template_arrays->{qty}->[$_]); } (0..scalar(@{ $template_arrays->{unit} }) - 1); + $form->{language} = "_" . $form->{language}; } @@ -1980,6 +1979,10 @@ sub _render_custom_variables_inputs { } foreach my $cvar (@{ $form->{CVAR_CONFIGS}->{IC} }) { + $cvar->{valid} = $params{part_id} + ? CVar->get_custom_variables_validity(config_id => $cvar->{id}, trans_id => $params{part_id}) + : 0; + $cvar->{value} = $form->{"ic_cvar_" . $cvar->{name} . "_$params{row}"}; } @@ -1991,7 +1994,7 @@ sub _render_custom_variables_inputs { my $num_visible_cvars = 0; foreach my $cvar (@{ $form->{CVAR_CONFIGS}->{IC} }) { my $description = ''; - if ($cvar->{flag_editable}) { + if ($cvar->{flag_editable} && $cvar->{valid}) { $num_visible_cvars++; $description = $cvar->{description} . ' '; }