Bugzilla – Attachment 24133 Details for
Bug 11343
The max number of items to process in a batch is hardcoded
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11343: The max number of items to process in a batch is hardcoded
Bug-11343-The-max-number-of-items-to-process-in-a-.patch (text/plain), 5.76 KB, created by
Kyle M Hall (khall)
on 2014-01-10 14:42:31 UTC
(
hide
)
Description:
Bug 11343: The max number of items to process in a batch is hardcoded
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2014-01-10 14:42:31 UTC
Size:
5.76 KB
patch
obsolete
>From a67719f56efbe8c1e05cb5941166c1a18de71df0 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Thu, 5 Dec 2013 15:30:42 +0100 >Subject: [PATCH] Bug 11343: The max number of items to process in a batch is hardcoded > >Until now, the maximum number of item records to process in a batch was >hardcoded to 1000. >This patch adds a syspref MaxItemsForBatch in order to allow to adapt >this value. > >Test plan: >- set the pref to 2 >- try to delete a batch of 3 items: they are not displayed >- try to modify a batch of 3 items: you are not allowed to do that >- set the pref to 1000 and try again. Now items are displayed and you > are allow to modify them. > >Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org> >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > installer/data/mysql/sysprefs.sql | 1 + > installer/data/mysql/updatedatabase.pl | 9 +++++++++ > .../intranet-tmpl/prog/en/includes/prefs-menu.inc | 1 + > .../prog/en/modules/admin/preferences/tools.pref | 5 +++++ > tools/batchMod.pl | 6 +++--- > 5 files changed, 19 insertions(+), 3 deletions(-) > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/tools.pref > >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index 0de3ac7..8782fdf 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -177,6 +177,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('MARCAuthorityControlField008','|| aca||aabn | a|a d',NULL,NULL,'Textarea'), > ('MARCOrgCode','OSt','','Define MARC Organization Code - 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'), >+('MaxItemsForBatch','1000',NULL,'Max number of items record to process in a batch (modification or deletion)','Integer'), > ('maxItemsInSearchResults','20',NULL,'Specify the maximum number of items to display for each result on a page of results','free'), > ('maxoutstanding','5','','maximum amount withstanding to be able make holds','Integer'), > ('maxRecordsForFacets','20',NULL,NULL,'Integer'), >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 80ab210..1888feb 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -7912,6 +7912,15 @@ if ( CheckVersion($DBversion) ) { > SetVersion($DBversion); > } > >+$DBversion = "3.15.00.XXX"; >+if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { >+ $dbh->do(q| >+ INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES('MaxItemsForBatch','1000',NULL,'Max number of items record to process in a batch (modification or deletion)','Integer') >+ |); >+ print "Upgrade to $DBversion done (Bug 11343: Add system preference MaxItemsForBatch )\n"; >+ SetVersion($DBversion); >+} >+ > =head1 FUNCTIONS > > =head2 TableExists($table) >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/prefs-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/prefs-menu.inc >index 3ecaefc..af23ab7 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/prefs-menu.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/prefs-menu.inc >@@ -15,6 +15,7 @@ > [% IF ( searching ) %]<li class="active">[% ELSE %]<li>[% END %]<a title="Searching" href="/cgi-bin/koha/admin/preferences.pl?tab=searching">Searching</a></li> > [% IF ( serials ) %]<li class="active">[% ELSE %]<li>[% END %]<a title="Serials" href="/cgi-bin/koha/admin/preferences.pl?tab=serials">Serials</a></li> > [% IF ( staff_client ) %]<li class="active">[% ELSE %]<li>[% END %]<a title="Staff client" href="/cgi-bin/koha/admin/preferences.pl?tab=staff_client">Staff client</a></li> >+[% IF ( tools ) %]<li class="active">[% ELSE %]<li>[% END %]<a title="Tools" href="/cgi-bin/koha/admin/preferences.pl?tab=tools">Tools</a></li> > [% IF ( web_services ) %]<li class="active">[% ELSE %]<li>[% END %]<a title="Web services" href="/cgi-bin/koha/admin/preferences.pl?tab=web_services">Web services</a></li> > </ul> > </div> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/tools.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/tools.pref >new file mode 100644 >index 0000000..047235f >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/tools.pref >@@ -0,0 +1,5 @@ >+Tools: >+ - >+ - Maximum number of items record to process in a batch (modification or deletion) >+ - pref: MaxItemsForBatch >+ class: Integer >diff --git a/tools/batchMod.pl b/tools/batchMod.pl >index 97cdab6..a88cc30 100755 >--- a/tools/batchMod.pl >+++ b/tools/batchMod.pl >@@ -111,7 +111,7 @@ 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) <= 1000) { >+ if (scalar(@itemnumbers) <= ( C4::Context->preference("MaxItemsForBatch") // 1000 ) ) { > $items_display_hashref=BuildItemsData(@itemnumbers); > } else { > # Else, we only display the barcode >@@ -267,8 +267,8 @@ 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 1000 >- if (scalar(@itemnumbers) <= 1000) { >+ # Only display the items if there are no more than pref MaxItemsForBatch >+ if (scalar(@itemnumbers) <= ( C4::Context->preference("MaxItemsForBatch") // 1000 ) ) { > $items_display_hashref=BuildItemsData(@itemnumbers); > } else { > $template->param("too_many_items" => scalar(@itemnumbers)); >-- >1.7.2.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 11343
:
23319
|
23456
|
23999
| 24133