From 21dfcef15ddfa648b0a7cadb519e1e6f89941e90 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Fri, 13 Nov 2015 14:52:10 +0100 Subject: [PATCH] Auftrags-Controller: Mehrfach-Artikelauswahl: Suchergebis auf 100 begrenzen. Experimentell. Sollte einstellbar sein. --- SL/Controller/Order.pm | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/SL/Controller/Order.pm b/SL/Controller/Order.pm index 478806614..5c8607d6c 100644 --- a/SL/Controller/Order.pm +++ b/SL/Controller/Order.pm @@ -353,12 +353,19 @@ sub action_show_multi_items_dialog { } sub action_multi_items_update_result { - my $multi_items = $_[0]->multi_items_models->get; - if (scalar @{$multi_items}) { + my $max_count = 100; + 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 much 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); - } else { - $_[0]->render(\'', { layout => 0 }); # ') make emacs happy } } -- 2.20.1