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

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt (-1 / +10 lines)
Lines 219-225 Link Here
219
                                                                    </select>
219
                                                                    </select>
220
                                                                [% ELSE %]
220
                                                                [% ELSE %]
221
                                                                    <select name="branch" id="branch_[% bibitemloo.biblionumber %]">
221
                                                                    <select name="branch" id="branch_[% bibitemloo.biblionumber %]">
222
                                                                        [% PROCESS options_for_libraries libraries => Branches.all( selected => branch ) %]
222
                                                                        [% FOREACH library IN Branches.all( selected => branch) %]
223
                                                                            [% SET pickup_available_at = bibitemloo.not_available_at.grep(library.branchcode).size ? 0 : 1 %]
224
                                                                            [% IF library.selected AND pickup_available_at %]
225
                                                                                <option value="[% library.branchcode %]" selected="selected" >[% library.branchname %]</option>
226
                                                                            [% ELSIF pickup_available_at %]
227
                                                                                <option value="[% library.branchcode %]">[% library.branchname %]</option>
228
                                                                            [% ELSE %]
229
                                                                                <option value="[% library.branchcode %]" disabled="disabled" title="At least one item is available at this library">[% library.branchname %]</option>
230
                                                                            [% END %]
231
                                                                        [% END %]
223
                                                                    </select>
232
                                                                    </select>
224
                                                                [% END # / UNLESS bibitemloo.holdable %]
233
                                                                [% END # / UNLESS bibitemloo.holdable %]
225
                                                            </li>
234
                                                            </li>
(-)a/opac/opac-reserve.pl (-1 / +23 lines)
Lines 276-281 if ( $query->param('place_reserve') ) { Link Here
276
            $canreserve = 0;
276
            $canreserve = 0;
277
        }
277
        }
278
278
279
        unless ( C4::Context->preference('OPACHoldsIfAvailableAtPickup') ) {
280
            $canreserve = 0 if Koha::Items->search({ biblionumber => $biblioNum, holdingbranch => $branch })->count;
281
        }
282
279
        my $itemtype = $query->param('itemtype') || undef;
283
        my $itemtype = $query->param('itemtype') || undef;
280
        $itemtype = undef if $itemNum;
284
        $itemtype = undef if $itemNum;
281
285
Lines 375-380 $template->param('item_level_itypes' => $itemLevelTypes); Link Here
375
379
376
foreach my $biblioNum (@biblionumbers) {
380
foreach my $biblioNum (@biblionumbers) {
377
381
382
    my @not_available_at = ();
378
    my $record = GetMarcBiblio($biblioNum);
383
    my $record = GetMarcBiblio($biblioNum);
379
    # Init the bib item with the choices for branch pickup
384
    # Init the bib item with the choices for branch pickup
380
    my %biblioLoopIter;
385
    my %biblioLoopIter;
Lines 517-522 foreach my $biblioNum (@biblionumbers) { Link Here
517
                $biblioLoopIter{force_hold} = 1 if $hold_allowed eq 'F';
522
                $biblioLoopIter{force_hold} = 1 if $hold_allowed eq 'F';
518
            }
523
            }
519
            $numCopiesAvailable++;
524
            $numCopiesAvailable++;
525
526
            if ( not C4::Context->preference('OPACHoldsIfAvailableAtPickup') ) {
527
                push @not_available_at, $itemInfo->{holdingbranch};
528
            }
520
        }
529
        }
521
530
522
        $itemLoopIter->{imageurl} = getitemtypeimagelocation( 'opac', $itemTypes->{ $itemInfo->{itype} }{imageurl} );
531
        $itemLoopIter->{imageurl} = getitemtypeimagelocation( 'opac', $itemTypes->{ $itemInfo->{itype} }{imageurl} );
Lines 545-550 foreach my $biblioNum (@biblionumbers) { Link Here
545
        $biblioLoopIter{already_patron_possession} = 1;
554
        $biblioLoopIter{already_patron_possession} = 1;
546
    }
555
    }
547
556
557
    if ( $biblioLoopIter{holdable} ) {
558
        @not_available_at = uniq @not_available_at;
559
        $biblioLoopIter{not_available_at} = \@not_available_at ;
560
    }
561
562
    unless ( C4::Context->preference('OPACHoldsIfAvailableAtPickup') ) {
563
        @not_available_at = uniq @not_available_at;
564
        $biblioLoopIter{not_available_at} = \@not_available_at ;
565
        # The record is not holdable is not available at any of the libraries
566
        if ( Koha::Libraries->search->count == @not_available_at ) {
567
            $biblioLoopIter{holdable} = 0;
568
        }
569
    }
570
548
    $biblioLoopIter{holdable} &&= CanBookBeReserved($borrowernumber,$biblioNum) eq 'OK';
571
    $biblioLoopIter{holdable} &&= CanBookBeReserved($borrowernumber,$biblioNum) eq 'OK';
549
572
550
    # For multiple holds per record, if a patron has previously placed a hold,
573
    # For multiple holds per record, if a patron has previously placed a hold,
551
- 

Return to bug 17453