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 278-283 if ( $query->param('place_reserve') ) { Link Here
278
            $canreserve = 0;
278
            $canreserve = 0;
279
        }
279
        }
280
280
281
        unless ( C4::Context->preference('OPACHoldsIfAvailableAtPickup') ) {
282
            $canreserve = 0 if Koha::Items->search({ biblionumber => $biblioNum, holdingbranch => $branch })->count;
283
        }
284
281
        my $itemtype = $query->param('itemtype') || undef;
285
        my $itemtype = $query->param('itemtype') || undef;
282
        $itemtype = undef if $itemNum;
286
        $itemtype = undef if $itemNum;
283
287
Lines 378-383 $template->param('item_level_itypes' => $itemLevelTypes); Link Here
378
382
379
foreach my $biblioNum (@biblionumbers) {
383
foreach my $biblioNum (@biblionumbers) {
380
384
385
    my @not_available_at = ();
381
    my $record = GetMarcBiblio($biblioNum);
386
    my $record = GetMarcBiblio($biblioNum);
382
    # Init the bib item with the choices for branch pickup
387
    # Init the bib item with the choices for branch pickup
383
    my %biblioLoopIter;
388
    my %biblioLoopIter;
Lines 520-525 foreach my $biblioNum (@biblionumbers) { Link Here
520
                $biblioLoopIter{force_hold} = 1 if $hold_allowed eq 'F';
525
                $biblioLoopIter{force_hold} = 1 if $hold_allowed eq 'F';
521
            }
526
            }
522
            $numCopiesAvailable++;
527
            $numCopiesAvailable++;
528
529
            if ( not C4::Context->preference('OPACHoldsIfAvailableAtPickup') ) {
530
                push @not_available_at, $itemInfo->{holdingbranch};
531
            }
523
        }
532
        }
524
533
525
        $itemLoopIter->{imageurl} = getitemtypeimagelocation( 'opac', $itemTypes->{ $itemInfo->{itype} }{imageurl} );
534
        $itemLoopIter->{imageurl} = getitemtypeimagelocation( 'opac', $itemTypes->{ $itemInfo->{itype} }{imageurl} );
Lines 548-553 foreach my $biblioNum (@biblionumbers) { Link Here
548
        $biblioLoopIter{already_patron_possession} = 1;
557
        $biblioLoopIter{already_patron_possession} = 1;
549
    }
558
    }
550
559
560
    if ( $biblioLoopIter{holdable} ) {
561
        @not_available_at = uniq @not_available_at;
562
        $biblioLoopIter{not_available_at} = \@not_available_at ;
563
    }
564
565
    unless ( C4::Context->preference('OPACHoldsIfAvailableAtPickup') ) {
566
        @not_available_at = uniq @not_available_at;
567
        $biblioLoopIter{not_available_at} = \@not_available_at ;
568
        # The record is not holdable is not available at any of the libraries
569
        if ( Koha::Libraries->search->count == @not_available_at ) {
570
            $biblioLoopIter{holdable} = 0;
571
        }
572
    }
573
551
    $biblioLoopIter{holdable} &&= CanBookBeReserved($borrowernumber,$biblioNum) eq 'OK';
574
    $biblioLoopIter{holdable} &&= CanBookBeReserved($borrowernumber,$biblioNum) eq 'OK';
552
575
553
    # For multiple holds per record, if a patron has previously placed a hold,
576
    # For multiple holds per record, if a patron has previously placed a hold,
554
- 

Return to bug 17453