@@ -, +, @@ a - Note if over 1000 they show in a simple display --- .../prog/en/modules/tools/batchMod-edit.tt | 20 +++++++----- tools/batchMod.pl | 36 +++++++++++++--------- 2 files changed, 33 insertions(+), 23 deletions(-) --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tt @@ -211,15 +211,19 @@ $(document).ready(function(){ [% END %] -[% IF ( simple_items_display ) %] -

The following items were modified:

- [% END %] [% IF ( show ) %] --- a/tools/batchMod.pl +++ a/tools/batchMod.pl @@ -119,21 +119,27 @@ if ($op eq "action") { # Once the job is done if ($completedJobID) { # If we have a reasonable amount of items, we display them - if (scalar(@itemnumbers) <= ( C4::Context->preference("MaxItemsToDisplayForBatchDel") // 1000 ) ) { - $items_display_hashref=BuildItemsData(@itemnumbers); - } else { - # Else, we only display the barcode - my @simple_items_display = map { - my $itemnumber = $_; - my $item = Koha::Items->find($itemnumber); - { - itemnumber => $itemnumber, - barcode => $item ? ( $item->barcode // q{} ) : q{}, - biblionumber => $item ? $item->biblio->biblionumber : q{}, - }; - } @itemnumbers; - $template->param("simple_items_display" => \@simple_items_display); - } + my $max_items = $del ? C4::Context->preference("MaxItemsToDisplayForBatchDel") : C4::Context->preference("MaxItemsToDisplayForBatchMod"); + if (scalar(@itemnumbers) <= $max_items ){ + if (scalar(@itemnumbers) <= 1000 ) { + $items_display_hashref=BuildItemsData(@itemnumbers); + } else { + # Else, we only display the barcode + my @simple_items_display = map { + my $itemnumber = $_; + my $item = Koha::Items->find($itemnumber); + { + itemnumber => $itemnumber, + barcode => $item ? ( $item->barcode // q{} ) : q{}, + biblionumber => $item ? $item->biblio->biblionumber : q{}, + }; + } @itemnumbers; + $template->param("simple_items_display" => \@simple_items_display); + } + } else { + $template->param( "too_many_items_display" => scalar(@itemnumbers) ); + $template->param( "job_completed" => 1 ); + } # Setting the job as done my $job = C4::BackgroundJob->fetch($sessionID, $completedJobID); --