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

(-)a/C4/HoldsQueue.pm (-3 / +41 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_group_items ON ( items.itemnumber =  item_group_items.item_id )
141
                  LEFT JOIN item_groups ON ( item_group_items.item_group_id = item_groups.item_group_id )
139
                  WHERE 1=1
142
                  WHERE 1=1
140
                /;
143
                /;
141
    if ($params->{branchlimit}) {
144
    if ($params->{branchlimit}) {
Lines 275-281 sub GetPendingHoldRequestsForBib { Link Here
275
    my $dbh = C4::Context->dbh;
278
    my $dbh = C4::Context->dbh;
276
279
277
    my $request_query = "SELECT biblionumber, borrowernumber, itemnumber, priority, reserve_id, reserves.branchcode,
280
    my $request_query = "SELECT biblionumber, borrowernumber, itemnumber, priority, reserve_id, reserves.branchcode,
278
                                reservedate, reservenotes, borrowers.branchcode AS borrowerbranch, itemtype, item_level_hold
281
                                reservedate, reservenotes, borrowers.branchcode AS borrowerbranch, itemtype, item_level_hold, item_group_id
279
                         FROM reserves
282
                         FROM reserves
280
                         JOIN borrowers USING (borrowernumber)
283
                         JOIN borrowers USING (borrowernumber)
281
                         WHERE biblionumber = ?
284
                         WHERE biblionumber = ?
Lines 458-463 sub MapItemsToHoldRequests { Link Here
458
461
459
                next if $request->{itemnumber} && $request->{itemnumber} != $item->{itemnumber};
462
                next if $request->{itemnumber} && $request->{itemnumber} != $item->{itemnumber};
460
463
464
                next if $request->{item_group_id} && $item->{_object}->item_group && $item->{_object}->item_group->id ne $request->{item_group_id};
465
461
                next unless $item->{_object}->can_be_transferred( { to => $libraries->{ $request->{branchcode} } } );
466
                next unless $item->{_object}->can_be_transferred( { to => $libraries->{ $request->{branchcode} } } );
462
467
463
                my $local_holds_priority_item_branchcode =
468
                my $local_holds_priority_item_branchcode =
Lines 512-518 sub MapItemsToHoldRequests { Link Here
512
                and  _checkHoldPolicy($items_by_itemnumber{ $request->{itemnumber} }, $request) # Don't fill item level holds that contravene the hold pickup policy at this time
517
                and  _checkHoldPolicy($items_by_itemnumber{ $request->{itemnumber} }, $request) # Don't fill item level holds that contravene the hold pickup policy at this time
513
                and ( !$request->{itemtype} # If hold itemtype is set, item's itemtype must match
518
                and ( !$request->{itemtype} # If hold itemtype is set, item's itemtype must match
514
                    || $items_by_itemnumber{ $request->{itemnumber} }->{itype} eq $request->{itemtype} )
519
                    || $items_by_itemnumber{ $request->{itemnumber} }->{itype} eq $request->{itemtype} )
515
520
                and ( !$request->{item_group_id} # If hold item_group is set, item's item_group must match
521
                      || ( $items_by_itemnumber{ $request->{itemnumber} }->{_object}->item_group
522
                        && $items_by_itemnumber{ $request->{itemnumber} }->{_object}->item_group->id eq $request->{item_group_id} ) )
516
                and $items_by_itemnumber{ $request->{itemnumber} }->{_object}->can_be_transferred( { to => $libraries->{ $request->{branchcode} } } )
523
                and $items_by_itemnumber{ $request->{itemnumber} }->{_object}->can_be_transferred( { to => $libraries->{ $request->{branchcode} } } )
517
524
518
              )
525
              )
Lines 569-574 sub MapItemsToHoldRequests { Link Here
569
                    && _checkHoldPolicy($item, $request) # Don't fill item level holds that contravene the hold pickup policy at this time
576
                    && _checkHoldPolicy($item, $request) # Don't fill item level holds that contravene the hold pickup policy at this time
570
                    && ( !$request->{itemtype} # If hold itemtype is set, item's itemtype must match
577
                    && ( !$request->{itemtype} # If hold itemtype is set, item's itemtype must match
571
                        || ( $request->{itemnumber} && ( $items_by_itemnumber{ $request->{itemnumber} }->{itype} eq $request->{itemtype} ) ) )
578
                        || ( $request->{itemnumber} && ( $items_by_itemnumber{ $request->{itemnumber} }->{itype} eq $request->{itemtype} ) ) )
579
                    && ( !$request->{item_group_id} # If hold item_group is set, item's item_group must match
580
                        || ( $item->{_object}->item_group && $item->{_object}->item_group->id eq $request->{item_group_id} ) )
572
                  )
581
                  )
573
                {
582
                {
574
                    $itemnumber = $item->{itemnumber};
583
                    $itemnumber = $item->{itemnumber};
Lines 594-599 sub MapItemsToHoldRequests { Link Here
594
                    next unless ( !$request->{itemtype}
603
                    next unless ( !$request->{itemtype}
595
                        || $item->{itype} eq $request->{itemtype} );
604
                        || $item->{itype} eq $request->{itemtype} );
596
605
606
                    # If hold item_group is set, item's item_group must match
607
                    next unless (
608
                        !$request->{item_group_id}
609
                        || (   $item->{_object}->item_group
610
                            && $item->{_object}->item_group->id eq $request->{item_group_id} )
611
                    );
612
597
                    $itemnumber = $item->{itemnumber};
613
                    $itemnumber = $item->{itemnumber};
598
                    last;
614
                    last;
599
                }
615
                }
Lines 627-632 sub MapItemsToHoldRequests { Link Here
627
                    next unless ( !$request->{itemtype}
643
                    next unless ( !$request->{itemtype}
628
                        || $item->{itype} eq $request->{itemtype} );
644
                        || $item->{itype} eq $request->{itemtype} );
629
645
646
                    # If hold item_group is set, item's item_group must match
647
                    next unless (
648
                        !$request->{item_group_id}
649
                        || (   $item->{_object}->item_group
650
                            && $item->{_object}->item_group->id eq $request->{item_group_id} )
651
                    );
652
630
                    $itemnumber = $item->{itemnumber};
653
                    $itemnumber = $item->{itemnumber};
631
                    $holdingbranch = $branch;
654
                    $holdingbranch = $branch;
632
                    last PULL_BRANCHES;
655
                    last PULL_BRANCHES;
Lines 644-649 sub MapItemsToHoldRequests { Link Here
644
667
645
                    next unless $items_by_itemnumber{ $current_item->{itemnumber} }->{_object}->can_be_transferred( { to => $libraries->{ $request->{branchcode} } } );
668
                    next unless $items_by_itemnumber{ $current_item->{itemnumber} }->{_object}->can_be_transferred( { to => $libraries->{ $request->{branchcode} } } );
646
669
670
                    # If hold item_group is set, item's item_group must match
671
                    next unless (
672
                        !$request->{item_group_id}
673
                        || (   $current_item->{_object}->item_group
674
                            && $current_item->{_object}->item_group->id eq $request->{item_group_id} )
675
                    );
676
677
647
                    $itemnumber = $current_item->{itemnumber};
678
                    $itemnumber = $current_item->{itemnumber};
648
                    last; # quit this loop as soon as we have a suitable item
679
                    last; # quit this loop as soon as we have a suitable item
649
                }
680
                }
Lines 664-669 sub MapItemsToHoldRequests { Link Here
664
                        next unless ( !$request->{itemtype}
695
                        next unless ( !$request->{itemtype}
665
                            || $item->{itype} eq $request->{itemtype} );
696
                            || $item->{itype} eq $request->{itemtype} );
666
697
698
                        # If hold item_group is set, item's item_group must match
699
                        next unless (
700
                            !$request->{item_group_id}
701
                            || (   $item->{_object}->item_group
702
                                && $item->{_object}->item_group->id eq $request->{item_group_id} )
703
                        );
704
667
                        next unless $items_by_itemnumber{ $item->{itemnumber} }->{_object}->can_be_transferred( { to => $libraries->{ $request->{branchcode} } } );
705
                        next unless $items_by_itemnumber{ $item->{itemnumber} }->{_object}->can_be_transferred( { to => $libraries->{ $request->{branchcode} } } );
668
706
669
                        $itemnumber = $item->{itemnumber};
707
                        $itemnumber = $item->{itemnumber};
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/view_holdsqueue.tt (-1 / +2 lines)
Lines 198-203 Link Here
198
                        <td class="hq-barcode">
198
                        <td class="hq-barcode">
199
                            [% IF ( itemsloo.item_level_request ) %]
199
                            [% IF ( itemsloo.item_level_request ) %]
200
                                <em>Only item:</em> <strong>[% itemsloo.barcode | html %]</strong>
200
                                <em>Only item:</em> <strong>[% itemsloo.barcode | html %]</strong>
201
                            [% ELSIF itemsloo.item_group_id %]
202
                                <strong>[% itemsloo.barcode | html %]</strong> <em>or any item from item_group <strong>[% itemsloo.item_group_description | html %]</strong></em>
201
                            [% ELSE %]
203
                            [% ELSE %]
202
                                <strong>[% itemsloo.barcode | html %]</strong> <em>or any available</em>
204
                                <strong>[% itemsloo.barcode | html %]</strong> <em>or any available</em>
203
                            [% END %]
205
                            [% END %]
204
- 

Return to bug 24860