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

(-)a/C4/HoldsQueue.pm (-5 / +43 lines)
Lines 137-147 sub GetHoldsQueueItems { Link Here
137
                         biblio.copyrightdate, biblio.subtitle, biblio.medium,
137
                         biblio.copyrightdate, biblio.subtitle, biblio.medium,
138
                         biblio.part_number, biblio.part_name,
138
                         biblio.part_number, biblio.part_name,
139
                         biblioitems.publicationyear, biblioitems.pages, biblioitems.size,
139
                         biblioitems.publicationyear, biblioitems.pages, biblioitems.size,
140
                         biblioitems.isbn, items.copynumber
140
                         biblioitems.isbn, items.copynumber,
141
                         volumes.id AS volume_id, volumes.description AS volume_description
141
                  FROM tmp_holdsqueue
142
                  FROM tmp_holdsqueue
142
                       JOIN biblio      USING (biblionumber)
143
                       JOIN biblio       USING (biblionumber)
143
                  LEFT JOIN biblioitems USING (biblionumber)
144
                  LEFT JOIN biblioitems  USING (biblionumber)
144
                  LEFT JOIN items       USING (  itemnumber)
145
                  LEFT JOIN items        USING (  itemnumber)
146
                  LEFT JOIN volume_items USING (  itemnumber)
147
                  LEFT JOIN volumes ON ( volume_items.volume_id = volumes.id )
145
                /;
148
                /;
146
    if ($branchlimit) {
149
    if ($branchlimit) {
147
        $query .=" WHERE tmp_holdsqueue.holdingbranch = ?";
150
        $query .=" WHERE tmp_holdsqueue.holdingbranch = ?";
Lines 277-283 sub GetPendingHoldRequestsForBib { Link Here
277
    my $dbh = C4::Context->dbh;
280
    my $dbh = C4::Context->dbh;
278
281
279
    my $request_query = "SELECT biblionumber, borrowernumber, itemnumber, priority, reserves.branchcode,
282
    my $request_query = "SELECT biblionumber, borrowernumber, itemnumber, priority, reserves.branchcode,
280
                                reservedate, reservenotes, borrowers.branchcode AS borrowerbranch, itemtype
283
                                reservedate, reservenotes, borrowers.branchcode AS borrowerbranch, itemtype, volume_id
281
                         FROM reserves
284
                         FROM reserves
282
                         JOIN borrowers USING (borrowernumber)
285
                         JOIN borrowers USING (borrowernumber)
283
                         WHERE biblionumber = ?
286
                         WHERE biblionumber = ?
Lines 409-414 sub MapItemsToHoldRequests { Link Here
409
                  || ( $item->{holdallowed} == 1
412
                  || ( $item->{holdallowed} == 1
410
                    && $item->{homebranch} ne $request->{borrowerbranch} );
413
                    && $item->{homebranch} ne $request->{borrowerbranch} );
411
414
415
                next if $request->{volume_id} && $item->{_object}->volume && $item->{_object}->volume->id ne $request->{volume_id};
416
412
                next unless $item->{_object}->can_be_transferred( { to => $libraries->{ $request->{branchcode} } } );
417
                next unless $item->{_object}->can_be_transferred( { to => $libraries->{ $request->{branchcode} } } );
413
418
414
                my $local_holds_priority_item_branchcode =
419
                my $local_holds_priority_item_branchcode =
Lines 464-469 sub MapItemsToHoldRequests { Link Here
464
                    || ( $request->{branchcode} eq $items_by_itemnumber{ $request->{itemnumber} }->{ $items_by_itemnumber{ $request->{itemnumber} }->{hold_fulfillment_policy} }  )
469
                    || ( $request->{branchcode} eq $items_by_itemnumber{ $request->{itemnumber} }->{ $items_by_itemnumber{ $request->{itemnumber} }->{hold_fulfillment_policy} }  )
465
                and ( !$request->{itemtype} # If hold itemtype is set, item's itemtype must match
470
                and ( !$request->{itemtype} # If hold itemtype is set, item's itemtype must match
466
                    || $items_by_itemnumber{ $request->{itemnumber} }->{itype} eq $request->{itemtype} )
471
                    || $items_by_itemnumber{ $request->{itemnumber} }->{itype} eq $request->{itemtype} )
472
                and ( !$request->{volume_id} # If hold volume is set, item's volume must match
473
                      || ( $items_by_itemnumber{ $request->{itemnumber} }->{_object}->volume
474
                        && $items_by_itemnumber{ $request->{itemnumber} }->{_object}->volume->id eq $request->{volume_id} ) )
467
                )
475
                )
468
                and $items_by_itemnumber{ $request->{itemnumber} }->{_object}->can_be_transferred( { to => $libraries->{ $request->{branchcode} } } )
476
                and $items_by_itemnumber{ $request->{itemnumber} }->{_object}->can_be_transferred( { to => $libraries->{ $request->{branchcode} } } )
469
477
Lines 521-526 sub MapItemsToHoldRequests { Link Here
521
                        || $request->{branchcode} eq $item->{ $item->{hold_fulfillment_policy} } )
529
                        || $request->{branchcode} eq $item->{ $item->{hold_fulfillment_policy} } )
522
                    && ( !$request->{itemtype} # If hold itemtype is set, item's itemtype must match
530
                    && ( !$request->{itemtype} # If hold itemtype is set, item's itemtype must match
523
                        || $items_by_itemnumber{ $request->{itemnumber} }->{itype} eq $request->{itemtype} )
531
                        || $items_by_itemnumber{ $request->{itemnumber} }->{itype} eq $request->{itemtype} )
532
                    && ( !$request->{volume_id} # If hold volume is set, item's volume must match
533
                        || ( $item->{_object}->volume && $item->{_object}->volume->id eq $request->{volume_id} ) )
524
                  )
534
                  )
525
                {
535
                {
526
                    $itemnumber = $item->{itemnumber};
536
                    $itemnumber = $item->{itemnumber};
Lines 547-552 sub MapItemsToHoldRequests { Link Here
547
                    next unless ( !$request->{itemtype}
557
                    next unless ( !$request->{itemtype}
548
                        || $item->{itype} eq $request->{itemtype} );
558
                        || $item->{itype} eq $request->{itemtype} );
549
559
560
                    # If hold volume is set, item's volume must match
561
                    next unless (
562
                        !$request->{volume_id}
563
                        || (   $item->{_object}->volume
564
                            && $item->{_object}->volume->id eq $request->{volume_id} )
565
                    );
566
550
                    $itemnumber = $item->{itemnumber};
567
                    $itemnumber = $item->{itemnumber};
551
                    last;
568
                    last;
552
                }
569
                }
Lines 584-589 sub MapItemsToHoldRequests { Link Here
584
                    next unless ( !$request->{itemtype}
601
                    next unless ( !$request->{itemtype}
585
                        || $item->{itype} eq $request->{itemtype} );
602
                        || $item->{itype} eq $request->{itemtype} );
586
603
604
                    # If hold volume is set, item's volume must match
605
                    next unless (
606
                        !$request->{volume_id}
607
                        || (   $item->{_object}->volume
608
                            && $item->{_object}->volume->id eq $request->{volume_id} )
609
                    );
610
587
                    $itemnumber = $item->{itemnumber};
611
                    $itemnumber = $item->{itemnumber};
588
                    $holdingbranch = $branch;
612
                    $holdingbranch = $branch;
589
                    last PULL_BRANCHES;
613
                    last PULL_BRANCHES;
Lines 603-608 sub MapItemsToHoldRequests { Link Here
603
                        next unless ( !$request->{itemtype}
627
                        next unless ( !$request->{itemtype}
604
                            || $current_item->{itype} eq $request->{itemtype} );
628
                            || $current_item->{itype} eq $request->{itemtype} );
605
629
630
                    # If hold volume is set, item's volume must match
631
                    next unless (
632
                        !$request->{volume_id}
633
                        || (   $current_item->{_object}->volume
634
                            && $current_item->{_object}->volume->id eq $request->{volume_id} )
635
                    );
636
606
                        next unless $items_by_itemnumber{ $current_item->{itemnumber} }->{_object}->can_be_transferred( { to => $libraries->{ $request->{branchcode} } } );
637
                        next unless $items_by_itemnumber{ $current_item->{itemnumber} }->{_object}->can_be_transferred( { to => $libraries->{ $request->{branchcode} } } );
607
638
608
                        $itemnumber = $current_item->{itemnumber};
639
                        $itemnumber = $current_item->{itemnumber};
Lines 629-634 sub MapItemsToHoldRequests { Link Here
629
                        next unless ( !$request->{itemtype}
660
                        next unless ( !$request->{itemtype}
630
                            || $item->{itype} eq $request->{itemtype} );
661
                            || $item->{itype} eq $request->{itemtype} );
631
662
663
                        # If hold volume is set, item's volume must match
664
                        next unless (
665
                            !$request->{volume_id}
666
                            || (   $item->{_object}->volume
667
                                && $item->{_object}->volume->id eq $request->{volume_id} )
668
                        );
669
632
                        next unless $items_by_itemnumber{ $item->{itemnumber} }->{_object}->can_be_transferred( { to => $libraries->{ $request->{branchcode} } } );
670
                        next unless $items_by_itemnumber{ $item->{itemnumber} }->{_object}->can_be_transferred( { to => $libraries->{ $request->{branchcode} } } );
633
671
634
                        $itemnumber = $item->{itemnumber};
672
                        $itemnumber = $item->{itemnumber};
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/view_holdsqueue.tt (-1 / +2 lines)
Lines 156-161 Link Here
156
            <td class="hq-barcode">
156
            <td class="hq-barcode">
157
                [% IF ( itemsloo.item_level_request ) %]
157
                [% IF ( itemsloo.item_level_request ) %]
158
                    <em>Only item:</em> <strong>[% itemsloo.barcode | html %]</strong>
158
                    <em>Only item:</em> <strong>[% itemsloo.barcode | html %]</strong>
159
                [% ELSIF itemsloo.volume_id %]
160
                <strong>[% itemsloo.barcode | html %]</strong> <em>or any item from volume <strong>[% itemsloo.volume_description | html %]</strong></em>
159
                [% ELSE %]
161
                [% ELSE %]
160
                    <strong>[% itemsloo.barcode | html %]</strong> <em>or any available</em>
162
                    <strong>[% itemsloo.barcode | html %]</strong> <em>or any available</em>
161
                [% END %]
163
                [% END %]
162
- 

Return to bug 24860