@@ -, +, @@ should exist in your system) --- .../bug_19722_add_MaxItemsToDisplayForBatchMod_pref.perl | 8 ++++++++ installer/data/mysql/sysprefs.sql | 1 + .../prog/en/modules/admin/preferences/tools.pref | 5 +++++ .../intranet-tmpl/prog/en/modules/tools/batchMod-edit.tt | 13 +++++++------ tools/batchMod.pl | 9 +++++---- 5 files changed, 26 insertions(+), 10 deletions(-) create mode 100644 installer/data/mysql/atomicupdate/bug_19722_add_MaxItemsToDisplayForBatchMod_pref.perl --- a/installer/data/mysql/atomicupdate/bug_19722_add_MaxItemsToDisplayForBatchMod_pref.perl +++ a/installer/data/mysql/atomicupdate/bug_19722_add_MaxItemsToDisplayForBatchMod_pref.perl @@ -0,0 +1,8 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if( CheckVersion( $DBversion ) ) { + $dbh->do( "INSERT IGNORE INTO systempreferences (variable, value, options, explanation, type) + VALUES ('MaxItemsToDisplayForBatchMod','1000',NULL,'Display up to a given number of items in a single item modification batch.','Integer')" + ); + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 19722 - Add a MaxItemsToDisplayForBatchMod preference)\n"; +} --- a/installer/data/mysql/sysprefs.sql +++ a/installer/data/mysql/sysprefs.sql @@ -293,6 +293,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('MARCOrgCode','OSt','','Define MARC Organization Code for MARC21 records - http://www.loc.gov/marc/organizations/orgshome.html','free'), ('MaxFine',NULL,'','Maximum fine a patron can have for all late returns at one moment. Single item caps are specified in the circulation rules matrix.','Integer'), ('MaxItemsToDisplayForBatchDel','1000',NULL,'Display up to a given number of items in a single item deletionbatch.','Integer'), +('MaxItemsToDisplayForBatchMod','1000',NULL,'Display up to a given number of items in a single item modification batch.','Integer'), ('MaxItemsToProcessForBatchMod','1000',NULL,'Process up to a given number of items in a single item modification batch.','Integer'), ('maxItemsInSearchResults','20',NULL,'Specify the maximum number of items to display for each result on a page of results','free'), ('MaxOpenSuggestions','',NULL,'Limit the number of open suggestions a patron can have at once','Integer'), --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/tools.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/tools.pref @@ -10,6 +10,11 @@ Tools: - pref: MaxItemsToDisplayForBatchDel class: integer - items in a single item deletion batch. + - + - Display up to + - pref: MaxItemsToDisplayForBatchMod + class: integer + - items in a single item modification batch. Patron cards: - - Limit the number of creator images stored in the database to --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tt @@ -103,7 +103,7 @@ $(document).ready(function(){ [% IF ( item_loop ) %] - [% UNLESS ( too_many_items ) %] + [% UNLESS ( too_many_items_display ) %]

The following barcodes were found:

[% END %] [% END %] @@ -121,14 +121,13 @@ $(document).ready(function(){ [% IF ( item_loop ) %] - [% UNLESS ( too_many_items ) %] + [% UNLESS ( too_many_items_display ) %]

The following itemnumbers were found:

[% END %] [% END %] [% END %] -
@@ -225,14 +224,16 @@ $(document).ready(function(){ [% IF ( show ) %] -[% IF ( too_many_items ) %] -

Too many items ([% too_many_items | html %]): You are not allowed to edit more than [% Koha.Preference('MaxItemsToProcessForBatchMod') | html %] items in a batch.

+[% IF ( too_many_items_process ) %] +

Too many items ([% too_many_items_process | html %]): You are not allowed to edit more than [% Koha.Preference('MaxItemsToProcessForBatchMod') | html %] items in a batch.

+[% ELSIF ( too_many_items_display ) %] +

Too many items ([% too_many_items_display | html %]): You are editing more than [% Koha.Preference('MaxItemsToDisplayForBatchMod') | html %] items in a batch, items will not be shown.

[% FOREACH itemnumber IN itemnumbers_array %] [% END %] [% END %] -[% IF ( item_loop ) %] +[% UNLESS (too_many_items_process) %]

Edit Items

Checking the box right next to the subfield label will disable the entry and delete the subfield on all selected items. Leave fields blank to make no change.
--- a/tools/batchMod.pl +++ a/tools/batchMod.pl @@ -279,13 +279,14 @@ if ($op eq "show"){ # Flag to tell the template there are valid results, hidden or not if(scalar(@itemnumbers) > 0){ $template->param("itemresults" => 1); } # Only display the items if there are no more than pref MaxItemsToProcessForBatchMod or MaxItemsToDisplayForBatchDel - my $max_items = $del + my $max_display_items = $del ? C4::Context->preference("MaxItemsToDisplayForBatchDel") - : C4::Context->preference("MaxItemsToProcessForBatchMod"); - if (scalar(@itemnumbers) <= ( $max_items // 1000 ) ) { + : C4::Context->preference("MaxItemsToDisplayForBatchMod"); + $template->param("too_many_items_process" => scalar(@itemnumbers)) if !$del && scalar(@itemnumbers) >= C4::Context->preference("MaxItemsToProcessForBatchMod"); + if (scalar(@itemnumbers) <= ( $max_display_items // 1000 ) ) { $items_display_hashref=BuildItemsData(@itemnumbers); } else { - $template->param("too_many_items" => scalar(@itemnumbers)); + $template->param("too_many_items_display" => scalar(@itemnumbers)); # Even if we do not display the items, we need the itemnumbers $template->param(itemnumbers_array => \@itemnumbers); } --