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 265-270 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
265
('MARCOrgCode','OSt','','Define MARC Organization Code for MARC21 records - http://www.loc.gov/marc/organizations/orgshome.html','free'),
265
('MARCOrgCode','OSt','','Define MARC Organization Code for MARC21 records - http://www.loc.gov/marc/organizations/orgshome.html','free'),
266
('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'),
266
('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'),
267
('MaxItemsToDisplayForBatchDel','1000',NULL,'Display up to a given number of items in a single item deletionbatch.','Integer'),
267
('MaxItemsToDisplayForBatchDel','1000',NULL,'Display up to a given number of items in a single item deletionbatch.','Integer'),
268
('MaxItemsToDisplayForBatchMod','1000',NULL,'Display up to a given number of items in a single item modification batch.','Integer'),
268
('MaxItemsToProcessForBatchMod','1000',NULL,'Process up to a given number of items in a single item modification batch.','Integer'),
269
('MaxItemsToProcessForBatchMod','1000',NULL,'Process up to a given number of items in a single item modification batch.','Integer'),
269
('maxItemsInSearchResults','20',NULL,'Specify the maximum number of items to display for each result on a page of results','free'),
270
('maxItemsInSearchResults','20',NULL,'Specify the maximum number of items to display for each result on a page of results','free'),
270
('MaxOpenSuggestions','',NULL,'Limit the number of open suggestions a patron can have at once','Integer'),
271
('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 (-4 / +6 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 176-189 $(document).ready(function(){ Link Here
176
176
177
[% IF ( show ) %]
177
[% IF ( show ) %]
178
178
179
[% IF ( too_many_items ) %]
179
[% IF ( too_many_items_process ) %]
180
    <p>Too many items ([% too_many_items %]): You are not allowed to edit more than [% Koha.Preference('MaxItemsToProcessForBatchMod') %] items in a batch.</p>
180
    <p>Too many items ([% too_many_items_process %]): You are not allowed to edit more than [% Koha.Preference('MaxItemsToProcessForBatchMod') %] items in a batch.</p>
181
[% ELSIF ( too_many_items_display ) %]
182
    <p>Too many items ([% too_many_items_display %]): You are editing more than [% Koha.Preference('MaxItemsToDisplayForBatchMod') %] items in a batch, items will not be shown.</p>
181
    [% FOREACH itemnumber IN itemnumbers_array %]
183
    [% FOREACH itemnumber IN itemnumbers_array %]
182
  <input type="hidden" name="itemnumber" value="[% itemnumber %]" />
184
  <input type="hidden" name="itemnumber" value="[% itemnumber %]" />
183
    [% END %]
185
    [% END %]
184
[% END %]<!-- /too_many_items -->
186
[% END %]<!-- /too_many_items -->
185
187
186
[% IF ( item_loop ) %]
188
[% UNLESS (too_many_items_process) %]
187
<div id="cataloguing_additem_newitem">
189
<div id="cataloguing_additem_newitem">
188
        <h2>Edit Items</h2>
190
        <h2>Edit Items</h2>
189
        <div class="hint">Checking the box right next the subfield label will disable the entry and delete the subfield on all selected items. Leave fields blank to make no change.</div>
191
        <div class="hint">Checking the box right next 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 283-295 if ($op eq "show"){ Link Here
283
    # Flag to tell the template there are valid results, hidden or not
283
    # Flag to tell the template there are valid results, hidden or not
284
    if(scalar(@itemnumbers) > 0){ $template->param("itemresults" => 1); }
284
    if(scalar(@itemnumbers) > 0){ $template->param("itemresults" => 1); }
285
    # Only display the items if there are no more than pref MaxItemsToProcessForBatchMod or MaxItemsToDisplayForBatchDel
285
    # Only display the items if there are no more than pref MaxItemsToProcessForBatchMod or MaxItemsToDisplayForBatchDel
286
    my $max_items = $del
286
    my $max_display_items = $del
287
        ? C4::Context->preference("MaxItemsToDisplayForBatchDel")
287
        ? C4::Context->preference("MaxItemsToDisplayForBatchDel")
288
        : C4::Context->preference("MaxItemsToProcessForBatchMod");
288
        : C4::Context->preference("MaxItemsToDisplayForBatchMod");
289
    if (scalar(@itemnumbers) <= ( $max_items // 1000 ) ) {
289
    $template->param("too_many_items_process" => scalar(@itemnumbers)) if !$del && scalar(@itemnumbers) >= C4::Context->preference("MaxItemsToProcessForBatchMod");
290
    if (scalar(@itemnumbers) <= ( $max_display_items // 1000 ) ) {
290
        $items_display_hashref=BuildItemsData(@itemnumbers);
291
        $items_display_hashref=BuildItemsData(@itemnumbers);
291
    } else {
292
    } else {
292
        $template->param("too_many_items" => scalar(@itemnumbers));
293
        $template->param("too_many_items_display" => scalar(@itemnumbers));
293
        # Even if we do not display the items, we need the itemnumbers
294
        # Even if we do not display the items, we need the itemnumbers
294
        $template->param(itemnumbers_array => \@itemnumbers);
295
        $template->param(itemnumbers_array => \@itemnumbers);
295
    }
296
    }
296
- 

Return to bug 19722