@@ -, +, @@ from local holds priority LocalHoldsPriorityPatronControl in pickup library, and library of the item's home library the same as the item's home library "Yes" several (existing) barcodes and press continue --- C4/HoldsQueue.pm | 5 +++- C4/Reserves.pm | 24 ++++++++------- admin/categories.pl | 3 ++ catalogue/updateitem.pl | 3 ++ .../prog/en/modules/admin/categories.tt | 13 ++++++++ .../prog/en/modules/catalogue/moredetail.tt | 30 +++++++++++++++++-- .../prog/en/modules/tools/batchMod-edit.tt | 15 ++++++++++ tools/batchMod.pl | 2 ++ 8 files changed, 81 insertions(+), 14 deletions(-) --- a/C4/HoldsQueue.pm +++ a/C4/HoldsQueue.pm @@ -401,13 +401,16 @@ sub MapItemsToHoldRequests { foreach my $request (@$hold_requests) { last if $num_items_remaining == 0; + my $patron = Koha::Patrons->find($request->{borrowernumber}); + next if $patron->category->exclude_from_local_holds_priority; my $local_hold_match; foreach my $item (@$available_items) { next if ( !$item->{holdallowed} ) || ( $item->{holdallowed} == 1 - && $item->{homebranch} ne $request->{borrowerbranch} ); + && $item->{homebranch} ne $request->{borrowerbranch} + || $item->{_object}->exclude_from_local_holds_priority ); next if $request->{itemnumber} && $request->{itemnumber} != $item->{itemnumber}; --- a/C4/Reserves.pm +++ a/C4/Reserves.pm @@ -831,17 +831,19 @@ sub CheckReserves { $patron = Koha::Patrons->find( $res->{borrowernumber} ); $item = Koha::Items->find($itemnumber); - my $local_holds_priority_item_branchcode = - $item->$LocalHoldsPriorityItemControl; - my $local_holds_priority_patron_branchcode = - ( $LocalHoldsPriorityPatronControl eq 'PickupLibrary' ) - ? $res->{branchcode} - : ( $LocalHoldsPriorityPatronControl eq 'HomeLibrary' ) - ? $patron->branchcode - : undef; - $local_hold_match = - $local_holds_priority_item_branchcode eq - $local_holds_priority_patron_branchcode; + unless ($item->exclude_from_local_holds_priority || $patron->category->exclude_from_local_holds_priority) { + my $local_holds_priority_item_branchcode = + $item->$LocalHoldsPriorityItemControl; + my $local_holds_priority_patron_branchcode = + ( $LocalHoldsPriorityPatronControl eq 'PickupLibrary' ) + ? $res->{branchcode} + : ( $LocalHoldsPriorityPatronControl eq 'HomeLibrary' ) + ? $patron->branchcode + : undef; + $local_hold_match = + $local_holds_priority_item_branchcode eq + $local_holds_priority_patron_branchcode; + } } # See if this item is more important than what we've got so far --- a/admin/categories.pl +++ a/admin/categories.pl @@ -94,6 +94,7 @@ elsif ( $op eq 'add_validate' ) { my $default_privacy = $input->param('default_privacy'); my $reset_password = $input->param('reset_password'); my $change_password = $input->param('change_password'); + my $exclude_from_local_holds_priority = $input->param('exclude_from_local_holds_priority'); my @branches = grep { $_ ne q{} } $input->multi_param('branches'); $reset_password = undef if $reset_password eq -1; @@ -129,6 +130,7 @@ elsif ( $op eq 'add_validate' ) { $category->default_privacy($default_privacy); $category->reset_password($reset_password); $category->change_password($change_password); + $category->exclude_from_local_holds_priority($exclude_from_local_holds_priority); eval { $category->store; $category->replace_branch_limitations( \@branches ); @@ -157,6 +159,7 @@ elsif ( $op eq 'add_validate' ) { default_privacy => $default_privacy, reset_password => $reset_password, change_password => $change_password, + exclude_from_local_holds_priority => $exclude_from_local_holds_priority, }); eval { $category->store; --- a/catalogue/updateitem.pl +++ a/catalogue/updateitem.pl @@ -40,6 +40,7 @@ my $itemnotes=$cgi->param('itemnotes'); my $itemnotes_nonpublic=$cgi->param('itemnotes_nonpublic'); my $withdrawn=$cgi->param('withdrawn'); my $damaged=$cgi->param('damaged'); +my $exclude_from_local_holds_priority = $cgi->param('exclude_from_local_holds_priority'); my $confirm=$cgi->param('confirm'); my $dbh = C4::Context->dbh; @@ -71,6 +72,8 @@ elsif ( $op eq "set_public_note" ) { # i.e., itemnotes parameter passed from for $item->itemlost($itemlost); } elsif ( $op eq "set_withdrawn" && $withdrawn ne $item_data_hashref->{'withdrawn'}) { $item->withdrawn($withdrawn); +} elsif ( $op eq "set_exclude_priority" && $exclude_from_local_holds_priority ne $item_data_hashref->{'exclude_from_local_holds_priority'}) { + $item->exclude_from_local_holds_priority($exclude_from_local_holds_priority); } elsif ( $op eq "set_damaged" && $damaged ne $item_data_hashref->{'damaged'}) { $item->damaged($damaged); } else { --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categories.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categories.tt @@ -297,6 +297,19 @@ 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 batch_anonymise.pl which should be set up by your system administrator. +
  • + + + If Yes, holds placed by patrons of this category will not be given priority +
  • --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt @@ -8,7 +8,7 @@ [% INCLUDE 'doc-head-open.inc' %] Koha › Catalog › Item details for [% INCLUDE 'biblio-title-head.inc' %] [% INCLUDE 'doc-head-close.inc' %] - + [% USE KohaDates %] @@ -43,7 +43,7 @@ [% IF ( volumeddesc ) %]
  • Volume: [% volumeddesc | html %]
  • [% END %]
  • Physical details: [% pages | html %] [% illus | html %] [% size | html %] 
  • [% IF ( bnotes ) %]
  • Notes: [% bnotes | html %]
  • [% END %] -
  • No. of items: [% count | html %] [% IF ( hiddencount ) %]total ([% showncount | html %] shown / [% hiddencount | html %] hidden) +
  • No. of items: [% count | html %] [% IF ( hiddencount ) %]total ([% showncount | html %] shown / [% hiddencount | html %] hidden) Show all items[% END %]
  • @@ -205,6 +205,32 @@ [% END %] + +

    Priority

    +
    +
      +
    1. + Exclude from local holds priority: +
      + + + + + +
      +
    2. +
    +
    +
    +

    History

      --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tt @@ -335,6 +335,21 @@ $(document).ready(function(){ [% END %]
    +
    + Priority +
      +
    1. +
      + + +
      +
    2. +
    +
    Job progress:
    0%
    --- a/tools/batchMod.pl +++ a/tools/batchMod.pl @@ -57,6 +57,7 @@ my $completedJobID = $input->param('completedJobID'); my $runinbackground = $input->param('runinbackground'); my $src = $input->param('src'); my $use_default_values = $input->param('use_default_values'); +my $exclude_from_local_holds_priority = $input->param('exclude_from_local_holds_priority'); my $template_name; my $template_flag; @@ -230,6 +231,7 @@ if ($op eq "action") { } } else { + $item->exclude_from_local_holds_priority($exclude_from_local_holds_priority)->store if defined $exclude_from_local_holds_priority; if ( $values_to_modify || $values_to_blank ) { my $localmarcitem = Item2Marc($itemdata); my $modified = 0; --