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

(-)a/C4/HoldsQueue.pm (-1 / +4 lines)
Lines 401-413 sub MapItemsToHoldRequests { Link Here
401
401
402
        foreach my $request (@$hold_requests) {
402
        foreach my $request (@$hold_requests) {
403
            last if $num_items_remaining == 0;
403
            last if $num_items_remaining == 0;
404
            my $patron = Koha::Patrons->find($request->{borrowernumber});
405
            next if $patron->category->exclude_from_local_holds_priority;
404
406
405
            my $local_hold_match;
407
            my $local_hold_match;
406
            foreach my $item (@$available_items) {
408
            foreach my $item (@$available_items) {
407
                next
409
                next
408
                  if ( !$item->{holdallowed} )
410
                  if ( !$item->{holdallowed} )
409
                  || ( $item->{holdallowed} == 1
411
                  || ( $item->{holdallowed} == 1
410
                    && $item->{homebranch} ne $request->{borrowerbranch} );
412
                    && $item->{homebranch} ne $request->{borrowerbranch}
413
                  || $item->{_object}->exclude_from_local_holds_priority );
411
414
412
                next if $request->{itemnumber} && $request->{itemnumber} != $item->{itemnumber};
415
                next if $request->{itemnumber} && $request->{itemnumber} != $item->{itemnumber};
413
416
(-)a/C4/Reserves.pm (-11 / +13 lines)
Lines 841-857 sub CheckReserves { Link Here
841
                    $patron = Koha::Patrons->find( $res->{borrowernumber} );
841
                    $patron = Koha::Patrons->find( $res->{borrowernumber} );
842
                    $item = Koha::Items->find($itemnumber);
842
                    $item = Koha::Items->find($itemnumber);
843
843
844
                    my $local_holds_priority_item_branchcode =
844
                    unless ($item->exclude_from_local_holds_priority || $patron->category->exclude_from_local_holds_priority) {
845
                      $item->$LocalHoldsPriorityItemControl;
845
                        my $local_holds_priority_item_branchcode =
846
                    my $local_holds_priority_patron_branchcode =
846
                            $item->$LocalHoldsPriorityItemControl;
847
                      ( $LocalHoldsPriorityPatronControl eq 'PickupLibrary' )
847
                        my $local_holds_priority_patron_branchcode =
848
                      ? $res->{branchcode}
848
                            ( $LocalHoldsPriorityPatronControl eq 'PickupLibrary' )
849
                      : ( $LocalHoldsPriorityPatronControl eq 'HomeLibrary' )
849
                            ? $res->{branchcode}
850
                      ? $patron->branchcode
850
                            : ( $LocalHoldsPriorityPatronControl eq 'HomeLibrary' )
851
                      : undef;
851
                            ? $patron->branchcode
852
                    $local_hold_match =
852
                            : undef;
853
                      $local_holds_priority_item_branchcode eq
853
                        $local_hold_match =
854
                      $local_holds_priority_patron_branchcode;
854
                            $local_holds_priority_item_branchcode eq
855
                            $local_holds_priority_patron_branchcode;
856
                    }
855
                }
857
                }
856
858
857
                # See if this item is more important than what we've got so far
859
                # See if this item is more important than what we've got so far
(-)a/admin/categories.pl (+3 lines)
Lines 94-99 elsif ( $op eq 'add_validate' ) { Link Here
94
    my $default_privacy = $input->param('default_privacy');
94
    my $default_privacy = $input->param('default_privacy');
95
    my $reset_password = $input->param('reset_password');
95
    my $reset_password = $input->param('reset_password');
96
    my $change_password = $input->param('change_password');
96
    my $change_password = $input->param('change_password');
97
    my $exclude_from_local_holds_priority = $input->param('exclude_from_local_holds_priority');
97
    my @branches = grep { $_ ne q{} } $input->multi_param('branches');
98
    my @branches = grep { $_ ne q{} } $input->multi_param('branches');
98
99
99
    $reset_password = undef if $reset_password eq -1;
100
    $reset_password = undef if $reset_password eq -1;
Lines 129-134 elsif ( $op eq 'add_validate' ) { Link Here
129
        $category->default_privacy($default_privacy);
130
        $category->default_privacy($default_privacy);
130
        $category->reset_password($reset_password);
131
        $category->reset_password($reset_password);
131
        $category->change_password($change_password);
132
        $category->change_password($change_password);
133
        $category->exclude_from_local_holds_priority($exclude_from_local_holds_priority);
132
        eval {
134
        eval {
133
            $category->store;
135
            $category->store;
134
            $category->replace_branch_limitations( \@branches );
136
            $category->replace_branch_limitations( \@branches );
Lines 157-162 elsif ( $op eq 'add_validate' ) { Link Here
157
            default_privacy => $default_privacy,
159
            default_privacy => $default_privacy,
158
            reset_password => $reset_password,
160
            reset_password => $reset_password,
159
            change_password => $change_password,
161
            change_password => $change_password,
162
            exclude_from_local_holds_priority => $exclude_from_local_holds_priority,
160
        });
163
        });
161
        eval {
164
        eval {
162
            $category->store;
165
            $category->store;
(-)a/catalogue/updateitem.pl (+3 lines)
Lines 40-45 my $itemnotes=$cgi->param('itemnotes'); Link Here
40
my $itemnotes_nonpublic=$cgi->param('itemnotes_nonpublic');
40
my $itemnotes_nonpublic=$cgi->param('itemnotes_nonpublic');
41
my $withdrawn=$cgi->param('withdrawn');
41
my $withdrawn=$cgi->param('withdrawn');
42
my $damaged=$cgi->param('damaged');
42
my $damaged=$cgi->param('damaged');
43
my $exclude_from_local_holds_priority = $cgi->param('exclude_from_local_holds_priority');
43
44
44
my $confirm=$cgi->param('confirm');
45
my $confirm=$cgi->param('confirm');
45
my $dbh = C4::Context->dbh;
46
my $dbh = C4::Context->dbh;
Lines 71-76 elsif ( $op eq "set_public_note" ) { # i.e., itemnotes parameter passed from for Link Here
71
    $item->itemlost($itemlost);
72
    $item->itemlost($itemlost);
72
} elsif ( $op eq "set_withdrawn" && $withdrawn ne $item_data_hashref->{'withdrawn'}) {
73
} elsif ( $op eq "set_withdrawn" && $withdrawn ne $item_data_hashref->{'withdrawn'}) {
73
    $item->withdrawn($withdrawn);
74
    $item->withdrawn($withdrawn);
75
} elsif ( $op eq "set_exclude_priority" && $exclude_from_local_holds_priority ne $item_data_hashref->{'exclude_from_local_holds_priority'}) {
76
    $item->exclude_from_local_holds_priority($exclude_from_local_holds_priority);
74
} elsif ( $op eq "set_damaged" && $damaged ne $item_data_hashref->{'damaged'}) {
77
} elsif ( $op eq "set_damaged" && $damaged ne $item_data_hashref->{'damaged'}) {
75
    $item->damaged($damaged);
78
    $item->damaged($damaged);
76
} else {
79
} else {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categories.tt (+13 lines)
Lines 297-302 Link Here
297
                    </select>
297
                    </select>
298
                    <span>Controls how long a patrons checkout history is kept for new patrons of this category. "Never" anonymizes checkouts on return, and "Forever" keeps a patron's checkout history indefinitely. When set to "Default", the amount of history kept is controlled by the cronjob <i>batch_anonymise.pl</i> which should be set up by your system administrator.</span>
298
                    <span>Controls how long a patrons checkout history is kept for new patrons of this category. "Never" anonymizes checkouts on return, and "Forever" keeps a patron's checkout history indefinitely. When set to "Default", the amount of history kept is controlled by the cronjob <i>batch_anonymise.pl</i> which should be set up by your system administrator.</span>
299
                </li>
299
                </li>
300
                <li>
301
                    <label for="exclude_from_local_holds_priority">Exclude from local holds priority:</label>
302
                    <select id="exclude_from_local_holds_priority" name="exclude_from_local_holds_priority">
303
                    [% IF category.exclude_from_local_holds_priority %]
304
                        <option value="1" selected>Yes</option>
305
                        <option value="0">No</option>
306
                    [% ELSE %]
307
                        <option value="1">Yes</option>
308
                        <option value="0" selected>No</option>
309
                    [% END %]
310
                    </select>
311
                    <span>If <i>Yes</i>, holds placed by patrons of this category will not be given priority</span>
312
                </li>
300
            </ol>
313
            </ol>
301
        </fieldset>
314
        </fieldset>
302
315
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt (-2 / +28 lines)
Lines 8-14 Link Here
8
[% INCLUDE 'doc-head-open.inc' %]
8
[% INCLUDE 'doc-head-open.inc' %]
9
<title>Koha &rsaquo; Catalog &rsaquo; Item details for [% INCLUDE 'biblio-title-head.inc' %]</title>
9
<title>Koha &rsaquo; Catalog &rsaquo; Item details for [% INCLUDE 'biblio-title-head.inc' %]</title>
10
[% INCLUDE 'doc-head-close.inc' %]
10
[% INCLUDE 'doc-head-close.inc' %]
11
<style>h3{padding-top: 1em; border-top: 2px solid #CCCCCC;}#exportLabelexportModal_{border-top: 0px;}</style>
11
<style>h3{padding-top: 1em; border-top: 2px solid #CCCCCC; clear: both}#exportLabelexportModal_{border-top: 0px;}</style>
12
</head>
12
</head>
13
<body id="catalog_moredetail" class="catalog">
13
<body id="catalog_moredetail" class="catalog">
14
[% USE KohaDates %]
14
[% USE KohaDates %]
Lines 44-50 Link Here
44
        [% IF ( volumeddesc ) %]<li><span class="label">Volume:</span> [% volumeddesc | html %]</li>[% END %]
44
        [% IF ( volumeddesc ) %]<li><span class="label">Volume:</span> [% volumeddesc | html %]</li>[% END %]
45
        <li><span class="label">Physical details:</span> [% pages | html %] [% illus | html %] [% size | html %]&nbsp;</li>
45
        <li><span class="label">Physical details:</span> [% pages | html %] [% illus | html %] [% size | html %]&nbsp;</li>
46
        [% IF ( bnotes ) %]<li><span class="label">Notes:</span> [% bnotes | html %]</li>[% END %]
46
        [% IF ( bnotes ) %]<li><span class="label">Notes:</span> [% bnotes | html %]</li>[% END %]
47
        <li><span class="label">No. of items:</span> [% count | html %]&nbsp;[% IF ( hiddencount ) %]total ([% showncount | html %] shown / [% hiddencount | html %] hidden) 
47
        <li><span class="label">No. of items:</span> [% count | html %]&nbsp;[% IF ( hiddencount ) %]total ([% showncount | html %] shown / [% hiddencount | html %] hidden)
48
<a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% biblionumber | uri %]&amp;showallitems=1">Show all items</a>[% END %]</li>
48
<a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% biblionumber | uri %]&amp;showallitems=1">Show all items</a>[% END %]</li>
49
    </ol>
49
    </ol>
50
    </div>
50
    </div>
Lines 216-221 Link Here
216
            [% END %]
216
            [% END %]
217
217
218
            </ol></div></div>
218
            </ol></div></div>
219
220
            <div class="listgroup"><h4>Priority</h4>
221
                <div class="rows">
222
                    <ol class="bibliodetails">
223
                        <li>
224
                            <span class="label">Exclude from local holds priority:</span>
225
                            <form action="updateitem.pl" method="post">
226
                            <input type="hidden" name="biblionumber" value="[% ITEM_DAT.biblionumber | html %]" />
227
                            <input type="hidden" name="biblioitemnumber" value="[% ITEM_DAT.biblioitemnumber | html %]" />
228
                            <input type="hidden" name="itemnumber" value="[% ITEM_DAT.itemnumber | html %]" />
229
                            <select id="exclude_from_local_holds_priority" name="exclude_from_local_holds_priority">
230
                            [% IF ITEM_DAT.exclude_from_local_holds_priority %]
231
                                <option value="1" selected>Yes</option>
232
                                <option value="0">No</option>
233
                            [% ELSE %]
234
                                <option value="1">Yes</option>
235
                                <option value="0" selected>No</option>
236
                            [% END %]
237
                            </select>
238
                            <input type="hidden" name="op" value="set_exclude_priority" />
239
                            <input type="submit" name="submit" class="submit" value="Update" /></form>
240
                        </li>
241
                    </ol>
242
                </div>
243
            </div>
244
219
            <div class="listgroup"><h4>History</h4>
245
            <div class="listgroup"><h4>History</h4>
220
            <div class="rows">
246
            <div class="rows">
221
            <ol class="bibliodetails">
247
            <ol class="bibliodetails">
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tt (+15 lines)
Lines 340-345 $(document).ready(function(){ Link Here
340
        [% END %]
340
        [% END %]
341
    </ol>
341
    </ol>
342
    </fieldset>
342
    </fieldset>
343
    <fieldset class="rows">
344
      <legend>Priority</legend>
345
      <ol>
346
        <li>
347
          <div class="subfield_line">
348
          <label for="exclude_from_local_holds_priority">Exclude from local holds priority:</label>
349
            <select id="exclude_from_local_holds_priority" name="exclude_from_local_holds_priority" class="input_marceditor" style="width: 50px">
350
                <option selected></option>
351
                <option value="1">Yes</option>
352
                <option value="0">No</option>
353
            </select>
354
          </div>
355
        </li>
356
      </ol>
357
    </fieldset>
343
    <fieldset class="action">    
358
    <fieldset class="action">    
344
   <div id="jobpanel">
359
   <div id="jobpanel">
345
       <div id="jobstatus" class="progress_panel">Job progress: <div id="jobprogress"></div> <span id="jobprogresspercent">0</span>%</div>
360
       <div id="jobstatus" class="progress_panel">Job progress: <div id="jobprogress"></div> <span id="jobprogresspercent">0</span>%</div>
(-)a/tools/batchMod.pl (-1 / +2 lines)
Lines 57-62 my $completedJobID = $input->param('completedJobID'); Link Here
57
my $runinbackground = $input->param('runinbackground');
57
my $runinbackground = $input->param('runinbackground');
58
my $src          = $input->param('src');
58
my $src          = $input->param('src');
59
my $use_default_values = $input->param('use_default_values');
59
my $use_default_values = $input->param('use_default_values');
60
my $exclude_from_local_holds_priority = $input->param('exclude_from_local_holds_priority');
60
61
61
my $template_name;
62
my $template_name;
62
my $template_flag;
63
my $template_flag;
Lines 231-236 if ($op eq "action") { Link Here
231
                            }
232
                            }
232
                        }
233
                        }
233
                        else {
234
                        else {
235
                            $item->exclude_from_local_holds_priority($exclude_from_local_holds_priority)->store if defined $exclude_from_local_holds_priority;
234
                            if ( $values_to_modify || $values_to_blank ) {
236
                            if ( $values_to_modify || $values_to_blank ) {
235
                                my $localmarcitem = Item2Marc($itemdata);
237
                                my $localmarcitem = Item2Marc($itemdata);
236
                                my $modified = 0;
238
                                my $modified = 0;
237
- 

Return to bug 19889