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

(-)a/C4/HoldsQueue.pm (-3 / +40 lines)
Lines 131-141 sub GetHoldsQueueItems { Link Here
131
                         biblio.copyrightdate, biblio.subtitle, biblio.medium,
131
                         biblio.copyrightdate, biblio.subtitle, biblio.medium,
132
                         biblio.part_number, biblio.part_name,
132
                         biblio.part_number, biblio.part_name,
133
                         biblioitems.publicationyear, biblioitems.pages, biblioitems.size,
133
                         biblioitems.publicationyear, biblioitems.pages, biblioitems.size,
134
                         biblioitems.isbn, biblioitems.editionstatement, items.copynumber
134
                         biblioitems.isbn, biblioitems.editionstatement, items.copynumber,
135
                         item_groups.item_group_id, item_groups.description AS item_group_description
135
                  FROM tmp_holdsqueue
136
                  FROM tmp_holdsqueue
136
                       JOIN biblio      USING (biblionumber)
137
                       JOIN biblio      USING (biblionumber)
137
                  LEFT JOIN biblioitems USING (biblionumber)
138
                  LEFT JOIN biblioitems USING (biblionumber)
138
                  LEFT JOIN items       USING (  itemnumber)
139
                  LEFT JOIN items       USING (  itemnumber)
140
                  LEFT JOIN item_groups ON ( item_group_items.item_group_id = item_groups.item_group_id )
139
                  WHERE 1=1
141
                  WHERE 1=1
140
                /;
142
                /;
141
    if ($params->{branchlimit}) {
143
    if ($params->{branchlimit}) {
Lines 275-281 sub GetPendingHoldRequestsForBib { Link Here
275
    my $dbh = C4::Context->dbh;
277
    my $dbh = C4::Context->dbh;
276
278
277
    my $request_query = "SELECT biblionumber, borrowernumber, itemnumber, priority, reserve_id, reserves.branchcode,
279
    my $request_query = "SELECT biblionumber, borrowernumber, itemnumber, priority, reserve_id, reserves.branchcode,
278
                                reservedate, reservenotes, borrowers.branchcode AS borrowerbranch, itemtype, item_level_hold
280
                                reservedate, reservenotes, borrowers.branchcode AS borrowerbranch, itemtype, item_level_hold, item_group_id
279
                         FROM reserves
281
                         FROM reserves
280
                         JOIN borrowers USING (borrowernumber)
282
                         JOIN borrowers USING (borrowernumber)
281
                         WHERE biblionumber = ?
283
                         WHERE biblionumber = ?
Lines 456-461 sub MapItemsToHoldRequests { Link Here
456
458
457
                next if $request->{itemnumber} && $request->{itemnumber} != $item->{itemnumber};
459
                next if $request->{itemnumber} && $request->{itemnumber} != $item->{itemnumber};
458
460
461
                next if $request->{item_group_id} && $item->{_object}->item_group && $item->{_object}->item_group->id ne $request->{item_group_id};
462
459
                next unless $item->{_object}->can_be_transferred( { to => $libraries->{ $request->{branchcode} } } );
463
                next unless $item->{_object}->can_be_transferred( { to => $libraries->{ $request->{branchcode} } } );
460
464
461
                my $local_holds_priority_item_branchcode =
465
                my $local_holds_priority_item_branchcode =
Lines 510-516 sub MapItemsToHoldRequests { Link Here
510
                and  _checkHoldPolicy($items_by_itemnumber{ $request->{itemnumber} }, $request) # Don't fill item level holds that contravene the hold pickup policy at this time
514
                and  _checkHoldPolicy($items_by_itemnumber{ $request->{itemnumber} }, $request) # Don't fill item level holds that contravene the hold pickup policy at this time
511
                and ( !$request->{itemtype} # If hold itemtype is set, item's itemtype must match
515
                and ( !$request->{itemtype} # If hold itemtype is set, item's itemtype must match
512
                    || $items_by_itemnumber{ $request->{itemnumber} }->{itype} eq $request->{itemtype} )
516
                    || $items_by_itemnumber{ $request->{itemnumber} }->{itype} eq $request->{itemtype} )
513
517
                and ( !$request->{item_group_id} # If hold item_group is set, item's item_group must match
518
                      || ( $items_by_itemnumber{ $request->{itemnumber} }->{_object}->item_group
519
                        && $items_by_itemnumber{ $request->{itemnumber} }->{_object}->item_group->id eq $request->{item_group_id} ) )
514
                and $items_by_itemnumber{ $request->{itemnumber} }->{_object}->can_be_transferred( { to => $libraries->{ $request->{branchcode} } } )
520
                and $items_by_itemnumber{ $request->{itemnumber} }->{_object}->can_be_transferred( { to => $libraries->{ $request->{branchcode} } } )
515
521
516
              )
522
              )
Lines 567-572 sub MapItemsToHoldRequests { Link Here
567
                    && _checkHoldPolicy($item, $request) # Don't fill item level holds that contravene the hold pickup policy at this time
573
                    && _checkHoldPolicy($item, $request) # Don't fill item level holds that contravene the hold pickup policy at this time
568
                    && ( !$request->{itemtype} # If hold itemtype is set, item's itemtype must match
574
                    && ( !$request->{itemtype} # If hold itemtype is set, item's itemtype must match
569
                        || ( $request->{itemnumber} && ( $items_by_itemnumber{ $request->{itemnumber} }->{itype} eq $request->{itemtype} ) ) )
575
                        || ( $request->{itemnumber} && ( $items_by_itemnumber{ $request->{itemnumber} }->{itype} eq $request->{itemtype} ) ) )
576
                    && ( !$request->{item_group_id} # If hold item_group is set, item's item_group must match
577
                        || ( $item->{_object}->item_group && $item->{_object}->item_group->id eq $request->{item_group_id} ) )
570
                  )
578
                  )
571
                {
579
                {
572
                    $itemnumber = $item->{itemnumber};
580
                    $itemnumber = $item->{itemnumber};
Lines 592-597 sub MapItemsToHoldRequests { Link Here
592
                    next unless ( !$request->{itemtype}
600
                    next unless ( !$request->{itemtype}
593
                        || $item->{itype} eq $request->{itemtype} );
601
                        || $item->{itype} eq $request->{itemtype} );
594
602
603
                    # If hold item_group is set, item's item_group must match
604
                    next unless (
605
                        !$request->{item_group_id}
606
                        || (   $item->{_object}->item_group
607
                            && $item->{_object}->item_group->id eq $request->{item_group_id} )
608
                    );
609
595
                    $itemnumber = $item->{itemnumber};
610
                    $itemnumber = $item->{itemnumber};
596
                    last;
611
                    last;
597
                }
612
                }
Lines 629-634 sub MapItemsToHoldRequests { Link Here
629
                    next unless ( !$request->{itemtype}
644
                    next unless ( !$request->{itemtype}
630
                        || $item->{itype} eq $request->{itemtype} );
645
                        || $item->{itype} eq $request->{itemtype} );
631
646
647
                    # If hold item_group is set, item's item_group must match
648
                    next unless (
649
                        !$request->{item_group_id}
650
                        || (   $item->{_object}->item_group
651
                            && $item->{_object}->item_group->id eq $request->{item_group_id} )
652
                    );
653
632
                    $itemnumber = $item->{itemnumber};
654
                    $itemnumber = $item->{itemnumber};
633
                    $holdingbranch = $branch;
655
                    $holdingbranch = $branch;
634
                    last PULL_BRANCHES;
656
                    last PULL_BRANCHES;
Lines 646-651 sub MapItemsToHoldRequests { Link Here
646
668
647
                    next unless $items_by_itemnumber{ $current_item->{itemnumber} }->{_object}->can_be_transferred( { to => $libraries->{ $request->{branchcode} } } );
669
                    next unless $items_by_itemnumber{ $current_item->{itemnumber} }->{_object}->can_be_transferred( { to => $libraries->{ $request->{branchcode} } } );
648
670
671
                    # If hold item_group is set, item's item_group must match
672
                    next unless (
673
                        !$request->{item_group_id}
674
                        || (   $current_item->{_object}->item_group
675
                            && $current_item->{_object}->item_group->id eq $request->{item_group_id} )
676
                    );
677
678
649
                    $itemnumber = $current_item->{itemnumber};
679
                    $itemnumber = $current_item->{itemnumber};
650
                    last; # quit this loop as soon as we have a suitable item
680
                    last; # quit this loop as soon as we have a suitable item
651
                }
681
                }
Lines 666-671 sub MapItemsToHoldRequests { Link Here
666
                        next unless ( !$request->{itemtype}
696
                        next unless ( !$request->{itemtype}
667
                            || $item->{itype} eq $request->{itemtype} );
697
                            || $item->{itype} eq $request->{itemtype} );
668
698
699
                        # If hold item_group is set, item's item_group must match
700
                        next unless (
701
                            !$request->{item_group_id}
702
                            || (   $item->{_object}->item_group
703
                                && $item->{_object}->item_group->id eq $request->{item_group_id} )
704
                        );
705
669
                        next unless $items_by_itemnumber{ $item->{itemnumber} }->{_object}->can_be_transferred( { to => $libraries->{ $request->{branchcode} } } );
706
                        next unless $items_by_itemnumber{ $item->{itemnumber} }->{_object}->can_be_transferred( { to => $libraries->{ $request->{branchcode} } } );
670
707
671
                        $itemnumber = $item->{itemnumber};
708
                        $itemnumber = $item->{itemnumber};
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/view_holdsqueue.tt (-1 / +2 lines)
Lines 187-192 Link Here
187
            <td class="hq-barcode">
187
            <td class="hq-barcode">
188
                [% IF ( itemsloo.item_level_request ) %]
188
                [% IF ( itemsloo.item_level_request ) %]
189
                    <em>Only item:</em> <strong>[% itemsloo.barcode | html %]</strong>
189
                    <em>Only item:</em> <strong>[% itemsloo.barcode | html %]</strong>
190
                [% ELSIF itemsloo.item_group_id %]
191
                <strong>[% itemsloo.barcode | html %]</strong> <em>or any item from item_group <strong>[% itemsloo.item_group_description | html %]</strong></em>
190
                [% ELSE %]
192
                [% ELSE %]
191
                    <strong>[% itemsloo.barcode | html %]</strong> <em>or any available</em>
193
                    <strong>[% itemsloo.barcode | html %]</strong> <em>or any available</em>
192
                [% END %]
194
                [% END %]
193
- 

Return to bug 24860