Bugzilla – Attachment 52001 Details for
Bug 11490
MaxItemsForBatch should be split into two new prefs
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11490: Split MaxItemsForBatch into 2 prefs to clarify things
Bug-11490-Split-MaxItemsForBatch-into-2-prefs-to-c.patch (text/plain), 4.24 KB, created by
Biblibre Sandboxes
on 2016-06-03 13:15:52 UTC
(
hide
)
Description:
Bug 11490: Split MaxItemsForBatch into 2 prefs to clarify things
Filename:
MIME Type:
Creator:
Biblibre Sandboxes
Created:
2016-06-03 13:15:52 UTC
Size:
4.24 KB
patch
obsolete
>From b362a9cafe4f21d9d0f1fea9636cbe5890f025f4 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 11 May 2016 14:10:49 +0100 >Subject: [PATCH] Bug 11490: Split MaxItemsForBatch into 2 prefs to clarify > things > >Prior to this patch, a single pref (MaxItemsForBatch) was used to >restrict the use of the batch item modification and deletion. > >On the batch modification tool, the pref is used to limit the number of >items a librarian is allowed to modify in a batch, but on the batch >deletion tool the pref is used to limit the number of items to display. > >To clarify things, this patch split the pref into 2 new prefs: >MaxItemsToDisplayForBatchDel and MaxItemsToProcessForBatchMod. > >Later we could add a MaxItemsToProcessForBatchDel if needed. >Note that this patch should not introduce any changes in the current behaviors. > >Test plan: >0/ Do not execute the update DB entry >1/ Set a value != 1000 for MaxItemsForBatch >2/ Execute the update DB entry and confirm that the 2 new prefs are >initially set with the value of MaxItemsForBatch and that >MaxItemsForBatch has been deleted >3/ Set different values for these 2 prefs (2 and 3 for instance to ease >the next steps) >4/ Try to delete less than MaxItemsToDisplayForBatchDel items >=> You must see the items details >5/ Try to delete more than MaxItemsToDisplayForBatchDel items >=> You must not see the items details but are allowed to delete them >6/ Try to modify less than MaxItemsToProcessForBatchMod items >=> You must see the items details >7/ Try to modify more than MaxItemsToProcessForBatchMod items >=> You must be restricted and not allowed to process > >Signed-off-by: Laurence Rault <laurence.rault@biblibre.com> >--- > .../intranet-tmpl/prog/en/modules/tools/batchMod-edit.tt | 3 ++- > tools/batchMod.pl | 9 ++++++--- > 2 files changed, 8 insertions(+), 4 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tt >index 8d46d53..1632513 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tt >@@ -1,3 +1,4 @@ >+[% USE Koha %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Tools › Batch item modification</title> > [% INCLUDE 'doc-head-close.inc' %] >@@ -163,7 +164,7 @@ $(document).ready(function(){ > [% IF ( show ) %] > > [% IF ( too_many_items ) %] >- <p>Too many items ([% too_many_items %]): not displaying each one individually.</p> >+ <p>Too many items ([% too_many_items %]): You are not allowed to edit more than [% Koha.Preference('MaxItemsToProcessForBatchMod') %] items in a batch.</p> > [% FOREACH itemnumber IN itemnumbers_array %] > <input type="hidden" name="itemnumber" value="[% itemnumber %]" /> > [% END %] >diff --git a/tools/batchMod.pl b/tools/batchMod.pl >index 320b4f1..0961ba5 100755 >--- a/tools/batchMod.pl >+++ b/tools/batchMod.pl >@@ -115,7 +115,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) <= ( C4::Context->preference("MaxItemsForBatch") // 1000 ) ) { >+ if (scalar(@itemnumbers) <= ( C4::Context->preference("MaxItemsToDisplayForBatchDel") // 1000 ) ) { > $items_display_hashref=BuildItemsData(@itemnumbers); > } else { > # Else, we only display the barcode >@@ -270,8 +270,11 @@ 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 MaxItemsForBatch >- if (scalar(@itemnumbers) <= ( C4::Context->preference("MaxItemsForBatch") // 1000 ) ) { >+ # Only display the items if there are no more than pref MaxItemsToProcessForBatchMod or MaxItemsToDisplayForBatchDel >+ my $max_items = $del >+ ? C4::Context->preference("MaxItemsToDisplayForBatchDel") >+ : C4::Context->preference("MaxItemsToProcessForBatchMod"); >+ if (scalar(@itemnumbers) <= ( $max_items // 1000 ) ) { > $items_display_hashref=BuildItemsData(@itemnumbers); > } else { > $template->param("too_many_items" => scalar(@itemnumbers)); >-- >1.7.10.4
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 11490
:
51424
|
51425
|
52000
|
52001
|
52496
|
52497