-# open the dialog for entering multiple items at once
-sub action_show_multi_items_dialog {
- $_[0]->render('order/tabs/_multi_items_dialog', { layout => 0 },
- all_partsgroups => SL::DB::Manager::PartsGroup->get_all);
-}
-
-# update the filter results in the multi item dialog
-sub action_multi_items_update_result {
- my $max_count = 100;
-
- $::form->{multi_items}->{filter}->{obsolete} = 0;
-
- my $count = $_[0]->multi_items_models->count;
-
- if ($count == 0) {
- my $text = SL::Presenter::EscapedText->new(text => $::locale->text('No results.'));
- $_[0]->render($text, { layout => 0 });
- } elsif ($count > $max_count) {
- my $text = SL::Presenter::EscapedText->new(text => $::locale->text('Too many results (#1 from #2).', $count, $max_count));
- $_[0]->render($text, { layout => 0 });
- } else {
- my $multi_items = $_[0]->multi_items_models->get;
- $_[0]->render('order/tabs/_multi_items_result', { layout => 0 },
- multi_items => $multi_items);
- }
-}
-