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 831-847 sub CheckReserves { Link Here
831
                    $patron = Koha::Patrons->find( $res->{borrowernumber} );
831
                    $patron = Koha::Patrons->find( $res->{borrowernumber} );
832
                    $item = Koha::Items->find($itemnumber);
832
                    $item = Koha::Items->find($itemnumber);
833
833
834
                    my $local_holds_priority_item_branchcode =
834
                    unless ($item->exclude_from_local_holds_priority || $patron->category->exclude_from_local_holds_priority) {
835
                      $item->$LocalHoldsPriorityItemControl;
835
                        my $local_holds_priority_item_branchcode =
836
                    my $local_holds_priority_patron_branchcode =
836
                            $item->$LocalHoldsPriorityItemControl;
837
                      ( $LocalHoldsPriorityPatronControl eq 'PickupLibrary' )
837
                        my $local_holds_priority_patron_branchcode =
838
                      ? $res->{branchcode}
838
                            ( $LocalHoldsPriorityPatronControl eq 'PickupLibrary' )
839
                      : ( $LocalHoldsPriorityPatronControl eq 'HomeLibrary' )
839
                            ? $res->{branchcode}
840
                      ? $patron->branchcode
840
                            : ( $LocalHoldsPriorityPatronControl eq 'HomeLibrary' )
841
                      : undef;
841
                            ? $patron->branchcode
842
                    $local_hold_match =
842
                            : undef;
843
                      $local_holds_priority_item_branchcode eq
843
                        $local_hold_match =
844
                      $local_holds_priority_patron_branchcode;
844
                            $local_holds_priority_item_branchcode eq
845
                            $local_holds_priority_patron_branchcode;
846
                    }
845
                }
847
                }
846
848
847
                # See if this item is more important than what we've got so far
849
                # 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 43-49 Link Here
43
        [% IF ( volumeddesc ) %]<li><span class="label">Volume:</span> [% volumeddesc | html %]</li>[% END %]
43
        [% IF ( volumeddesc ) %]<li><span class="label">Volume:</span> [% volumeddesc | html %]</li>[% END %]
44
        <li><span class="label">Physical details:</span> [% pages | html %] [% illus | html %] [% size | html %]&nbsp;</li>
44
        <li><span class="label">Physical details:</span> [% pages | html %] [% illus | html %] [% size | html %]&nbsp;</li>
45
        [% IF ( bnotes ) %]<li><span class="label">Notes:</span> [% bnotes | html %]</li>[% END %]
45
        [% IF ( bnotes ) %]<li><span class="label">Notes:</span> [% bnotes | html %]</li>[% END %]
46
        <li><span class="label">No. of items:</span> [% count | html %]&nbsp;[% IF ( hiddencount ) %]total ([% showncount | html %] shown / [% hiddencount | html %] hidden) 
46
        <li><span class="label">No. of items:</span> [% count | html %]&nbsp;[% IF ( hiddencount ) %]total ([% showncount | html %] shown / [% hiddencount | html %] hidden)
47
<a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% biblionumber | uri %]&amp;showallitems=1">Show all items</a>[% END %]</li>
47
<a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% biblionumber | uri %]&amp;showallitems=1">Show all items</a>[% END %]</li>
48
    </ol>
48
    </ol>
49
    </div>
49
    </div>
Lines 205-210 Link Here
205
            [% END %]
205
            [% END %]
206
206
207
            </ol></div></div>
207
            </ol></div></div>
208
209
            <div class="listgroup"><h4>Priority</h4>
210
                <div class="rows">
211
                    <ol class="bibliodetails">
212
                        <li>
213
                            <span class="label">Exclude from local holds priority:</span>
214
                            <form action="updateitem.pl" method="post">
215
                            <input type="hidden" name="biblionumber" value="[% ITEM_DAT.biblionumber | html %]" />
216
                            <input type="hidden" name="biblioitemnumber" value="[% ITEM_DAT.biblioitemnumber | html %]" />
217
                            <input type="hidden" name="itemnumber" value="[% ITEM_DAT.itemnumber | html %]" />
218
                            <select id="exclude_from_local_holds_priority" name="exclude_from_local_holds_priority">
219
                            [% IF ITEM_DAT.exclude_from_local_holds_priority %]
220
                                <option value="1" selected>Yes</option>
221
                                <option value="0">No</option>
222
                            [% ELSE %]
223
                                <option value="1">Yes</option>
224
                                <option value="0" selected>No</option>
225
                            [% END %]
226
                            </select>
227
                            <input type="hidden" name="op" value="set_exclude_priority" />
228
                            <input type="submit" name="submit" class="submit" value="Update" /></form>
229
                        </li>
230
                    </ol>
231
                </div>
232
            </div>
233
208
            <div class="listgroup"><h4>History</h4>
234
            <div class="listgroup"><h4>History</h4>
209
            <div class="rows">
235
            <div class="rows">
210
            <ol class="bibliodetails">
236
            <ol class="bibliodetails">
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tt (+15 lines)
Lines 335-340 $(document).ready(function(){ Link Here
335
        [% END %]
335
        [% END %]
336
    </ol>
336
    </ol>
337
    </fieldset>
337
    </fieldset>
338
    <fieldset class="rows">
339
      <legend>Priority</legend>
340
      <ol>
341
        <li>
342
          <div class="subfield_line">
343
          <label for="exclude_from_local_holds_priority">Exclude from local holds priority:</label>
344
            <select id="exclude_from_local_holds_priority" name="exclude_from_local_holds_priority" class="input_marceditor" style="width: 50px">
345
                <option selected></option>
346
                <option value="1">Yes</option>
347
                <option value="0">No</option>
348
            </select>
349
          </div>
350
        </li>
351
      </ol>
352
    </fieldset>
338
    <fieldset class="action">    
353
    <fieldset class="action">    
339
   <div id="jobpanel">
354
   <div id="jobpanel">
340
       <div id="jobstatus" class="progress_panel">Job progress: <div id="jobprogress"></div> <span id="jobprogresspercent">0</span>%</div>
355
       <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 230-235 if ($op eq "action") { Link Here
230
                            }
231
                            }
231
                        }
232
                        }
232
                        else {
233
                        else {
234
                            $item->exclude_from_local_holds_priority($exclude_from_local_holds_priority)->store if defined $exclude_from_local_holds_priority;
233
                            if ( $values_to_modify || $values_to_blank ) {
235
                            if ( $values_to_modify || $values_to_blank ) {
234
                                my $localmarcitem = Item2Marc($itemdata);
236
                                my $localmarcitem = Item2Marc($itemdata);
235
                                my $modified = 0;
237
                                my $modified = 0;
236
- 

Return to bug 19889