View | Details | Raw Unified | Return to bug 19722
Collapse All | Expand All

(-)a/installer/data/mysql/atomicupdate/bug_19722_add_MaxItemsToDisplayForBatchMod_pref.perl (+8 lines)
Line 0 Link Here
1
$DBversion = 'XXX';  # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
3
    $dbh->do( "INSERT IGNORE INTO systempreferences (variable, value, options, explanation, type)
4
               VALUES ('MaxItemsToDisplayForBatchMod','1000',NULL,'Display up to a given number of items in a single item modification batch.','Integer')"
5
            );
6
    SetVersion( $DBversion );
7
    print "Upgrade to $DBversion done (Bug 19722 - Add a MaxItemsToDisplayForBatchMod preference)\n";
8
}
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 293-298 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
293
('MARCOrgCode','OSt','','Define MARC Organization Code for MARC21 records - http://www.loc.gov/marc/organizations/orgshome.html','free'),
293
('MARCOrgCode','OSt','','Define MARC Organization Code for MARC21 records - http://www.loc.gov/marc/organizations/orgshome.html','free'),
294
('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'),
294
('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'),
295
('MaxItemsToDisplayForBatchDel','1000',NULL,'Display up to a given number of items in a single item deletionbatch.','Integer'),
295
('MaxItemsToDisplayForBatchDel','1000',NULL,'Display up to a given number of items in a single item deletionbatch.','Integer'),
296
('MaxItemsToDisplayForBatchMod','1000',NULL,'Display up to a given number of items in a single item modification batch.','Integer'),
296
('MaxItemsToProcessForBatchMod','1000',NULL,'Process up to a given number of items in a single item modification batch.','Integer'),
297
('MaxItemsToProcessForBatchMod','1000',NULL,'Process up to a given number of items in a single item modification batch.','Integer'),
297
('maxItemsInSearchResults','20',NULL,'Specify the maximum number of items to display for each result on a page of results','free'),
298
('maxItemsInSearchResults','20',NULL,'Specify the maximum number of items to display for each result on a page of results','free'),
298
('MaxOpenSuggestions','',NULL,'Limit the number of open suggestions a patron can have at once','Integer'),
299
('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 (+5 lines)
Lines 10-15 Tools: Link Here
10
            - pref: MaxItemsToDisplayForBatchDel
10
            - pref: MaxItemsToDisplayForBatchDel
11
              class: integer
11
              class: integer
12
            - items in a single item deletion batch.
12
            - items in a single item deletion batch.
13
        -
14
            - Display up to
15
            - pref: MaxItemsToDisplayForBatchMod
16
              class: integer
17
            - items in a single item modification batch.
13
    Patron cards:
18
    Patron cards:
14
        -
19
        -
15
            - Limit the number of creator images stored in the database to
20
            - Limit the number of creator images stored in the database to
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tt (-6 / +7 lines)
Lines 103-109 $(document).ready(function(){ Link Here
103
            </tbody>
103
            </tbody>
104
        </table>
104
        </table>
105
        [% IF ( item_loop ) %]
105
        [% IF ( item_loop ) %]
106
            [% UNLESS ( too_many_items ) %]
106
            [% UNLESS ( too_many_items_display ) %]
107
                <h4>The following barcodes were found: </h4>
107
                <h4>The following barcodes were found: </h4>
108
            [% END %]
108
            [% END %]
109
        [% END %]
109
        [% END %]
Lines 121-134 $(document).ready(function(){ Link Here
121
            </tbody>
121
            </tbody>
122
        </table>
122
        </table>
123
        [% IF ( item_loop ) %]
123
        [% IF ( item_loop ) %]
124
            [% UNLESS ( too_many_items ) %]
124
            [% UNLESS ( too_many_items_display ) %]
125
                <h4>The following itemnumbers were found: </h4>
125
                <h4>The following itemnumbers were found: </h4>
126
            [% END %]
126
            [% END %]
127
        [% END %]
127
        [% END %]
128
    [% END %] <!-- /notfounditemnumbers -->
128
    [% END %] <!-- /notfounditemnumbers -->
129
129
130
130
131
132
<form name="f" action="batchMod.pl" method="post">
131
<form name="f" action="batchMod.pl" method="post">
133
     <input type="hidden" name="op" value="[% op | html %]" />
132
     <input type="hidden" name="op" value="[% op | html %]" />
134
     <input type="hidden" name="uploadedfileid" id="uploadedfileid" value="" />
133
     <input type="hidden" name="uploadedfileid" id="uploadedfileid" value="" />
Lines 225-238 $(document).ready(function(){ Link Here
225
224
226
[% IF ( show ) %]
225
[% IF ( show ) %]
227
226
228
[% IF ( too_many_items ) %]
227
[% IF ( too_many_items_process ) %]
229
    <p>Too many items ([% too_many_items | html %]): You are not allowed to edit more than [% Koha.Preference('MaxItemsToProcessForBatchMod') | html %] items in a batch.</p>
228
    <p>Too many items ([% too_many_items_process | html %]): You are not allowed to edit more than [% Koha.Preference('MaxItemsToProcessForBatchMod') | html %] items in a batch.</p>
229
[% ELSIF ( too_many_items_display ) %]
230
    <p>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.</p>
230
    [% FOREACH itemnumber IN itemnumbers_array %]
231
    [% FOREACH itemnumber IN itemnumbers_array %]
231
  <input type="hidden" name="itemnumber" value="[% itemnumber | html %]" />
232
  <input type="hidden" name="itemnumber" value="[% itemnumber | html %]" />
232
    [% END %]
233
    [% END %]
233
[% END %]<!-- /too_many_items -->
234
[% END %]<!-- /too_many_items -->
234
235
235
[% IF ( item_loop ) %]
236
[% UNLESS (too_many_items_process) %]
236
<div id="cataloguing_additem_newitem">
237
<div id="cataloguing_additem_newitem">
237
        <h2>Edit Items</h2>
238
        <h2>Edit Items</h2>
238
        <div class="hint">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.</div>
239
        <div class="hint">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.</div>
(-)a/tools/batchMod.pl (-5 / +5 lines)
Lines 279-291 if ($op eq "show"){ Link Here
279
    # Flag to tell the template there are valid results, hidden or not
279
    # Flag to tell the template there are valid results, hidden or not
280
    if(scalar(@itemnumbers) > 0){ $template->param("itemresults" => 1); }
280
    if(scalar(@itemnumbers) > 0){ $template->param("itemresults" => 1); }
281
    # Only display the items if there are no more than pref MaxItemsToProcessForBatchMod or MaxItemsToDisplayForBatchDel
281
    # Only display the items if there are no more than pref MaxItemsToProcessForBatchMod or MaxItemsToDisplayForBatchDel
282
    my $max_items = $del
282
    my $max_display_items = $del
283
        ? C4::Context->preference("MaxItemsToDisplayForBatchDel")
283
        ? C4::Context->preference("MaxItemsToDisplayForBatchDel")
284
        : C4::Context->preference("MaxItemsToProcessForBatchMod");
284
        : C4::Context->preference("MaxItemsToDisplayForBatchMod");
285
    if (scalar(@itemnumbers) <= ( $max_items // 1000 ) ) {
285
    $template->param("too_many_items_process" => scalar(@itemnumbers)) if !$del && scalar(@itemnumbers) >= C4::Context->preference("MaxItemsToProcessForBatchMod");
286
    if (scalar(@itemnumbers) <= ( $max_display_items // 1000 ) ) {
286
        $items_display_hashref=BuildItemsData(@itemnumbers);
287
        $items_display_hashref=BuildItemsData(@itemnumbers);
287
    } else {
288
    } else {
288
        $template->param("too_many_items" => scalar(@itemnumbers));
289
        $template->param("too_many_items_display" => scalar(@itemnumbers));
289
        # Even if we do not display the items, we need the itemnumbers
290
        # Even if we do not display the items, we need the itemnumbers
290
        $template->param(itemnumbers_array => \@itemnumbers);
291
        $template->param(itemnumbers_array => \@itemnumbers);
291
    }
292
    }
292
- 

Return to bug 19722