X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=inline;f=SL%2FController%2FPart.pm;h=0b476ea815ecb990c830e3a2f039288135af0c0a;hb=27fe7b11f5817702c3b47d0187bc9f0ba5328e2f;hp=a0ff1e7002b6820d342c8f2ecd082a0e1ed156a1;hpb=d7ca155122347833221c0f2ee084adc751a88f8b;p=kivitendo-erp.git diff --git a/SL/Controller/Part.pm b/SL/Controller/Part.pm index a0ff1e700..0b476ea81 100644 --- a/SL/Controller/Part.pm +++ b/SL/Controller/Part.pm @@ -12,6 +12,7 @@ use SL::Controller::Helper::GetModels; use SL::Locale::String qw(t8); use SL::JSON; use List::Util qw(sum); +use List::UtilsBy qw(extract_by); use SL::Helper::Flash; use Data::Dumper; use DateTime; @@ -230,8 +231,11 @@ sub render_form { $params{CUSTOM_VARIABLES} = CVar->get_custom_variables(module => 'IC', trans_id => $self->part->id); - CVar->render_inputs('variables' => $params{CUSTOM_VARIABLES}, show_disabled_message => 1, partsgroup_id => $self->part->partsgroup_id) - if (scalar @{ $params{CUSTOM_VARIABLES} }); + if (scalar @{ $params{CUSTOM_VARIABLES} }) { + CVar->render_inputs('variables' => $params{CUSTOM_VARIABLES}, show_disabled_message => 1, partsgroup_id => $self->part->partsgroup_id); + $params{CUSTOM_VARIABLES_FIRST_TAB} = []; + @{ $params{CUSTOM_VARIABLES_FIRST_TAB} } = extract_by { $_->{first_tab} == 1 } @{ $params{CUSTOM_VARIABLES} }; + } my %title_hash = ( part => t8('Edit Part'), assembly => t8('Edit Assembly'), @@ -423,14 +427,14 @@ sub action_show_multi_items_dialog { } sub action_multi_items_update_result { - my $max_count = 100; + my $max_count = $::form->{limit}; my $count = $_[0]->multi_items_models->count; if ($count == 0) { my $text = escape($::locale->text('No results.')); $_[0]->render($text, { layout => 0 }); - } elsif ($count > $max_count) { + } elsif ($max_count && $count > $max_count) { my $text = escape($::locale->text('Too many results (#1 from #2).', $count, $max_count)); $_[0]->render($text, { layout => 0 }); } else {